com.vaadin.hilla.
Class OpenAPIUtil
Utilities for interacting with the generated openapi.json.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindOpenApiClasses
(String openApiAsText) Parses the given open api and finds all used classes.
static String
getCurrentOpenAPI
(Path buildDirectory, boolean isProductionMode) Reads the open api file from the build directory.
getCurrentOpenAPIPath
(Path buildDirectory, boolean isProductionMode) Returns the path to open api file from the build directory.
-
Constructor Details
-
OpenAPIUtil
public OpenAPIUtil()
-
-
Method Details
-
getCurrentOpenAPI
public static String getCurrentOpenAPI(Path buildDirectory, boolean isProductionMode) throws IOException Reads the open api file from the build directory.
Parameters:
buildDirectory
- the build directory,target
if running with MavenisProductionMode
- whether to generate the openapi for production modeReturns:
the contents of the generated openapi.json
Throws:
IOException
- if something went wrong -
getCurrentOpenAPIPath
public static Optional<Path> getCurrentOpenAPIPath(Path buildDirectory, boolean isProductionMode) throws IOException Returns the path to open api file from the build directory.
Parameters:
buildDirectory
- the build directory,target
if running with MavenisProductionMode
- whether to generate the openapi for production modeReturns:
the Path to the openapi json file
Throws:
IOException
- if something went wrong -
findOpenApiClasses
Parses the given open api and finds all used classes.
Parameters:
openApiAsText
- the open api JSON as textReturns:
a set of classes used
Throws:
IOException
- if parsing fails
-