Package io.micronaut.openapi.generator
Interface MicronautCodeGeneratorOptionsBuilder
public interface MicronautCodeGeneratorOptionsBuilder
Builder for generic options that the Micronaut code generator supports.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The possible date-time formatting configurations.static enum
The possible languages for generator. -
Method Summary
Modifier and TypeMethodDescriptionwithApiPackage
(String apiPackage) Sets the package of the generated API classes.withArtifactId
(String artifactId) Sets the artifact id of the project.withBeanValidation
(boolean beanValidation) If set to true, the generated code will use bean validation.Configure the date-time format.withGenerateHttpResponseAlways
(boolean generateHttpResponseAlways) If true, the generated operation return types will be wrapped in HttpResponse.withGenerateHttpResponseWhereRequired
(boolean generateHttpResponseWhereRequired) Wrap the operations response in HttpResponse object where non-200 HTTP status codes or additional headers are defined.withInvokerPackage
(String invokerPackage) Sets the package of the generated invoker classes.Sets the generator language.withModelPackage
(String modelPackage) Sets the package of the generated model classes.withOptional
(boolean optional) If set to true, the generated code will make use ofOptional
.withParameterMappings
(List<ParameterMapping> parameterMappings) Add the parameter mappings.withReactive
(boolean reactive) If set to true, the generator will use reactive types.withResponseBodyMappings
(List<ResponseBodyMapping> responseBodyMappings) Add the response body mappings.Configure the serialization library.withTestFramework
(MicronautCodeGeneratorEntryPoint.TestFramework testFramework) Configures the test framework to use for generated tests.
-
Method Details
-
withLang
MicronautCodeGeneratorOptionsBuilder withLang(MicronautCodeGeneratorOptionsBuilder.GeneratorLanguage lang) Sets the generator language.- Parameters:
lang
- generator language- Returns:
- this builder
-
withApiPackage
Sets the package of the generated API classes.- Parameters:
apiPackage
- the package name- Returns:
- this builder
-
withInvokerPackage
Sets the package of the generated invoker classes.- Parameters:
invokerPackage
- the package name- Returns:
- this builder
-
withModelPackage
Sets the package of the generated model classes.- Parameters:
modelPackage
- the package name- Returns:
- this builder
-
withArtifactId
Sets the artifact id of the project.- Parameters:
artifactId
- the artifact id- Returns:
- this builder
-
withParameterMappings
MicronautCodeGeneratorOptionsBuilder withParameterMappings(List<ParameterMapping> parameterMappings) Add the parameter mappings.- Parameters:
parameterMappings
- the parameter mappings specified by aParameterMapping
objects- Returns:
- this builder
-
withResponseBodyMappings
MicronautCodeGeneratorOptionsBuilder withResponseBodyMappings(List<ResponseBodyMapping> responseBodyMappings) Add the response body mappings.- Parameters:
responseBodyMappings
- the response body mappings specified by aResponseBodyMapping
objects- Returns:
- this builder
-
withReactive
If set to true, the generator will use reactive types.- Parameters:
reactive
- the reactive flag- Returns:
- this builder
-
withGenerateHttpResponseAlways
MicronautCodeGeneratorOptionsBuilder withGenerateHttpResponseAlways(boolean generateHttpResponseAlways) If true, the generated operation return types will be wrapped in HttpResponse.- Parameters:
generateHttpResponseAlways
- the wrapping flag- Returns:
- this builder
-
withGenerateHttpResponseWhereRequired
MicronautCodeGeneratorOptionsBuilder withGenerateHttpResponseWhereRequired(boolean generateHttpResponseWhereRequired) Wrap the operations response in HttpResponse object where non-200 HTTP status codes or additional headers are defined.- Parameters:
generateHttpResponseWhereRequired
- the wrapping flag- Returns:
- this builder
-
withBeanValidation
If set to true, the generated code will use bean validation.- Parameters:
beanValidation
- the bean validation flag- Returns:
- this builder
-
withOptional
If set to true, the generated code will make use ofOptional
.- Parameters:
optional
- the optional flag- Returns:
- this builder
-
withTestFramework
MicronautCodeGeneratorOptionsBuilder withTestFramework(MicronautCodeGeneratorEntryPoint.TestFramework testFramework) Configures the test framework to use for generated tests.- Parameters:
testFramework
- the test framework- Returns:
- this builder
-
withSerializationLibrary
Configure the serialization library.- Parameters:
library
- the serialization library.- Returns:
- this builder
-
withDateTimeFormat
MicronautCodeGeneratorOptionsBuilder withDateTimeFormat(MicronautCodeGeneratorOptionsBuilder.DateTimeFormat format) Configure the date-time format.- Parameters:
format
- the date-time format.- Returns:
- this builder
-