Package dev.hilla.generator
Class OpenAPISpecGenerator
- java.lang.Object
-
- dev.hilla.generator.OpenAPISpecGenerator
-
public class OpenAPISpecGenerator extends Object
A generator class that creates the OpenAPI specification file from the sources provided.- See Also:
- OpenAPI specification
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPPLICATION_API_VERSIONstatic StringAPPLICATION_TITLEstatic StringDEFAULT_APPLICATION_API_VERSIONstatic StringDEFAULT_APPLICATION_TITLEstatic StringDEFAULT_PREFIXstatic StringDEFAULT_SERVERstatic StringDEFAULT_SERVER_DESCRIPTIONstatic StringPREFIXstatic StringSERVERstatic StringSERVER_DESCRIPTION
-
Constructor Summary
Constructors Constructor Description OpenAPISpecGenerator(Properties applicationProperties)Creates the generator, getting the data needed for the generation out of the application properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerateOpenApiSpec(Collection<Path> sourcesPaths, ClassLoader classLoader, Path specOutputFile)Generates the OpenAPI spec file based on the sources provided.voidgenerateOpenApiSpec(Collection<Path> sourcesPaths, Path specOutputFile)Generates the OpenAPI spec file based on the sources provided.
-
-
-
Field Detail
-
APPLICATION_TITLE
public static final String APPLICATION_TITLE
- See Also:
- Constant Field Values
-
APPLICATION_API_VERSION
public static final String APPLICATION_API_VERSION
- See Also:
- Constant Field Values
-
SERVER
public static final String SERVER
- See Also:
- Constant Field Values
-
SERVER_DESCRIPTION
public static final String SERVER_DESCRIPTION
- See Also:
- Constant Field Values
-
PREFIX
public static final String PREFIX
- See Also:
- Constant Field Values
-
DEFAULT_SERVER
public static final String DEFAULT_SERVER
- See Also:
- Constant Field Values
-
DEFAULT_SERVER_DESCRIPTION
public static final String DEFAULT_SERVER_DESCRIPTION
- See Also:
- Constant Field Values
-
DEFAULT_APPLICATION_TITLE
public static final String DEFAULT_APPLICATION_TITLE
- See Also:
- Constant Field Values
-
DEFAULT_APPLICATION_API_VERSION
public static final String DEFAULT_APPLICATION_API_VERSION
- See Also:
- Constant Field Values
-
DEFAULT_PREFIX
public static final String DEFAULT_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
OpenAPISpecGenerator
public OpenAPISpecGenerator(Properties applicationProperties)
Creates the generator, getting the data needed for the generation out of the application properties.- Parameters:
applicationProperties- the properties with the data required for the generation
-
-
Method Detail
-
generateOpenApiSpec
public void generateOpenApiSpec(Collection<Path> sourcesPaths, Path specOutputFile)
Generates the OpenAPI spec file based on the sources provided.- Parameters:
sourcesPaths- the source root to be analyzedspecOutputFile- the target file to write the generation output to
-
generateOpenApiSpec
public void generateOpenApiSpec(Collection<Path> sourcesPaths, ClassLoader classLoader, Path specOutputFile)
Generates the OpenAPI spec file based on the sources provided.- Parameters:
sourcesPaths- the source root to be analyzedclassLoader- the ClassLoader which is able to load the classes in sourcesPathsspecOutputFile- the target file to write the generation output to
-
-