Package dev.hilla
Class OpenAPIUtil
java.lang.Object
dev.hilla.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 StringgenerateOpenAPI(Path buildDirectory) Generate a new openapi.json and return it, based on the classes in the build directory.static StringgetCurrentOpenAPI(Path buildDirectory) Reads the open api file from the build directory.
-
Constructor Details
-
OpenAPIUtil
public OpenAPIUtil()
-
-
Method Details
-
getCurrentOpenAPI
Reads the open api file from the build directory.- Parameters:
buildDirectory- the build directory,targetif running with Maven- Returns:
- the contents of the generated openapi.json
- Throws:
IOException- if something went wrong
-
generateOpenAPI
Generate a new openapi.json and return it, based on the classes in the build directory.- Parameters:
buildDirectory- the build directory,targetif running with Maven- Returns:
- the contents of the generated openapi.json
- Throws:
IOException- if something went wrong
-
findOpenApiClasses
Parses the given open api and finds all used classes.- Parameters:
openApiAsText- the open api JSON as text- Returns:
- a set of classes used
- Throws:
IOException- if parsing fails
-