mn:generate-openapi-generic
Full name:
io.micronaut.maven:micronaut-maven-plugin:4.7.1:generate-openapi-generic
Description:
A generic OpenAPI mojo that will be used for configuring custom Micronaut OpenAPI generator extensions.
Attributes:
- Requires a Maven project to be executed.
- The goal is not marked as thread-safe and thus does not support parallel builds.
- Since version:
4.0.0
. - Binds by default to the lifecycle phase:
generate-sources
.
Required Parameters
Name | Type | Since | Description |
---|---|---|---|
<alwaysUseGenerateHttpResponse> |
boolean |
- |
If true, the generated operation return types will be wrapped in HttpResponse. Default: false User Property: micronaut.openapi.always.use.generate.http.response |
<apiPackageName> |
String |
- |
The package name for the APIs (controller interfaces). Default: io.micronaut.openapi.api User Property: micronaut.openapi.api.package.name |
<dateTimeFormat> |
String |
- |
Configure the date-time format. Default: ZONED_DATETIME User Property: micronaut.openapi.date.time.format |
<definitionFile> |
File |
- |
The OpenAPI specification file path relative to the project's root path. Default: io.micronaut.openapi.invoker User Property: micronaut.openapi.definition |
<generateHttpResponseWhereRequired> |
boolean |
- |
Wrap the operations response in HttpResponse object where non-200 HTTP status codes or additional headers are defined. Default: false User Property: micronaut.openapi.generate.http.response.where.required |
<invokerPackageName> |
String |
- |
The name of the package that can be used for various classes required for invocation. Default: io.micronaut.openapi.invoker User Property: micronaut.openapi.invoker.package.name |
<ksp> |
boolean |
- |
If set to true, generated code will be fully compatible with KSP, but not 100% with KAPT. Default: false User Property: micronaut.openapi.ksp |
<modelPackageName> |
String |
- |
The package name for the model classes. Default: io.micronaut.openapi.model User Property: micronaut.openapi.model.package.name |
<outputDirectory> |
File |
- |
The output directory to which all the sources will be generated. Default: ${project.build.directory}/generated-sources/openapi |
<outputKinds> |
List<String> |
- |
Comma-separated values of output kinds to generate. The values are defined by the io.micronaut.openapi.generator.MicronautCodeGeneratorEntryPoint.OutputKind enum.Default: apis,models,supporting_files User Property: micronaut.openapi.outputs |
<serializationFramework> |
String |
- |
Configure the serialization library. Default: MICRONAUT_SERDE_JACKSON User Property: micronaut.openapi.serialization.framework |
<useBeanValidation> |
boolean |
- |
Whether to generate validation annotations for models and APIs. Default: true User Property: micronaut.openapi.use.bean.validation |
<useOneOfInterfaces> |
boolean |
- |
Flag to indicate whether to use the utils.OneOfImplementorAdditionalData related logic. Default: true User Property: micronaut.openapi.use.one.of.interfaces |
<useOptional> |
boolean |
- |
Whether to use java.util.Optional for non-required model properties and API parameters.Default: false User Property: micronaut.openapi.use.optional |
<useReactive> |
boolean |
- |
Whether to use reactor types for operation responses. Default: true User Property: micronaut.openapi.use.reactive |
Optional Parameters
Name | Type | Since | Description |
---|---|---|---|
<additionalEnumTypeAnnotations> |
List<String> |
- |
Additional annotations for enum type (class level annotations). User Property: micronaut.openapi.additionalEnumTypeAnnotations |
<additionalModelTypeAnnotations> |
List<String> |
- |
Additional annotations for model type (class level annotations). User Property: micronaut.openapi.additionalModelTypeAnnotations |
<additionalOneOfTypeAnnotations> |
List<String> |
- |
Additional annotations for oneOf interfaces (class level annotations). User Property: micronaut.openapi.additionalOneOfTypeAnnotations |
<additionalProperties> |
Map<String,Object> |
- |
Additional generator properties. User Property: micronaut.openapi.additionalProperties |
<allowUnicodeIdentifiers> |
boolean |
- |
boolean, toggles whether Unicode identifiers are allowed in names or not, default is false. User Property: micronaut.openapi.allowUnicodeIdentifiers |
<apiNamePrefix> |
String |
- |
Set the api name prefix. User Property: micronaut.openapi.apiNamePrefix |
<apiNameSuffix> |
String |
- |
Set the api name suffix. User Property: micronaut.openapi.apiNameSuffix |
<ensureUniqueParams> |
boolean |
- |
Whether to ensure parameter names are unique in an operation (rename parameters that are not). Default: true User Property: micronaut.openapi.ensureUniqueParams |
<enumNameMapping> |
Map<String,String> |
- |
Add the enum name mappings. User Property: micronaut.openapi.enumNameMapping |
<generateSwaggerAnnotations> |
boolean |
- |
If set to true, controller and client method will be generated with openAPI annotations. Default: false User Property: micronaut.openapi.generateSwaggerAnnotations |
<generatorClassName> |
String |
- |
The classname of the generator to be used for code generation.
The generator must property overwrite the User Property: micronaut.openapi.generator.builder.classname |
<implicitHeaders> |
boolean |
- |
Set the implicit headers flag. Default: false User Property: micronaut.openapi.implicitHeaders |
<implicitHeadersRegex> |
String |
- |
Set the implicit headers regex. User Property: micronaut.openapi.implicitHeadersRegex |
<importMapping> |
Map<String,String> |
- |
Add the import mappings. User Property: micronaut.openapi.importMapping |
<inlineSchemaNameMapping> |
Map<String,String> |
- |
Add the inline schema name mappings. User Property: micronaut.openapi.inlineSchemaNameMapping |
<inlineSchemaOption> |
Map<String,String> |
- |
Add the inline schema options. User Property: micronaut.openapi.inlineSchemaOption |
<lang> |
String |
4.3.0 |
Allows specifying the language of the generated code. Default: java User Property: micronaut.openapi.lang |
<modelNameMapping> |
Map<String,String> |
- |
Add the model name mappings. User Property: micronaut.openapi.modelNameMapping |
<modelNamePrefix> |
String |
- |
Set the model name prefix. User Property: micronaut.openapi.modelNamePrefix |
<modelNameSuffix> |
String |
- |
Set the model name suffix. User Property: micronaut.openapi.modelNameSuffix |
<nameMapping> |
Map<String,String> |
- |
Add the name mappings. User Property: micronaut.openapi.nameMapping |
<openapiNormalizer> |
Map<String,String> |
- |
Add the OpenAPI normalizer options. User Property: micronaut.openapi.openapiNormalizer |
<parameterMappings> |
List<ParameterMapping> |
- |
Define parameter mappings that allow using custom types for parameter binding. See ParameterMapping for details.User Property: micronaut.openapi.parameterMappings |
<prependFormOrBodyParameters> |
boolean |
- |
Add form or body parameters to the beginning of the parameter list. User Property: micronaut.openapi.prependFormOrBodyParameters |
<properties> |
Map<String,String> |
- |
The configuration properties that will be passed on to the custom generator options builder.
Any configuration parameters with key User Property: micronaut.openapi.generator.properties |
<removeOperationIdPrefixCount> |
int |
- |
Count of delimiter for the prefix. Use -1 for last. Default: 1 Default: 1 User Property: micronaut.openapi.removeOperationIdPrefixCount |
<removeOperationIdPrefixDelimiter> |
String |
- |
Character to use as a delimiter for the prefix. Default: '_' Default: _ User Property: micronaut.openapi.removeOperationIdPrefixDelimiter |
<responseBodyMappings> |
List<ResponseBodyMapping> |
- |
Define parameter mappings that allow using custom types for parameter binding. See ResponseBodyMapping for details.User Property: micronaut.openapi.responseBodyMappings |
<schemaMapping> |
Map<String,String> |
- |
Add the schema mappings. User Property: micronaut.openapi.schemaMapping |
<skipOperationExample> |
boolean |
- |
Skip examples defined in operations to avoid out of memory errors. Default: false User Property: micronaut.openapi.skipOperationExample |
<skipSortingOperations> |
boolean |
- |
Skip sorting operations. Default: false User Property: micronaut.openapi.skipSortingOperations |
<sortModelPropertiesByRequiredFlag> |
boolean |
- |
Sort model properties to place required parameters before optional parameters. Default: true User Property: micronaut.openapi.sortModelPropertiesByRequiredFlag |
<sortParamsByRequiredFlag> |
boolean |
- |
Sort method arguments to place required parameters before optional parameters. Default: true Default: true User Property: micronaut.openapi.sortParamsByRequiredFlag |
<typeMapping> |
Map<String,String> |
- |
Add the type mappings. User Property: micronaut.openapi.typeMapping |
<useEnumCaseInsensitive> |
boolean |
- |
If set to true, the generated enums check enum value with ignoring case. Default: false User Property: micronaut.openapi.useEnumCaseInsensitive |
<useJakartaEe> |
boolean |
- |
Flag to indicate whether to use the "jakarta" or "javax" package. Default: true User Property: micronaut.openapi.useJakartaEe |
Parameter Details
<additionalEnumTypeAnnotations>
- Type:
java.util.List<java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.additionalEnumTypeAnnotations
<additionalModelTypeAnnotations>
- Type:
java.util.List<java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.additionalModelTypeAnnotations
<additionalOneOfTypeAnnotations>
- Type:
java.util.List<java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.additionalOneOfTypeAnnotations
<additionalProperties>
- Type:
java.util.Map<java.lang.String, java.lang.Object>
- Required:
No
- User Property:
micronaut.openapi.additionalProperties
<allowUnicodeIdentifiers>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.allowUnicodeIdentifiers
<alwaysUseGenerateHttpResponse>
- Type:
boolean
- Required:
Yes
- User Property:
micronaut.openapi.always.use.generate.http.response
- Default:
false
<apiNamePrefix>
- Type:
java.lang.String
- Required:
No
- User Property:
micronaut.openapi.apiNamePrefix
<apiNameSuffix>
- Type:
java.lang.String
- Required:
No
- User Property:
micronaut.openapi.apiNameSuffix
<apiPackageName>
- Type:
java.lang.String
- Required:
Yes
- User Property:
micronaut.openapi.api.package.name
- Default:
io.micronaut.openapi.api
<dateTimeFormat>
- Type:
java.lang.String
- Required:
Yes
- User Property:
micronaut.openapi.date.time.format
- Default:
ZONED_DATETIME
<definitionFile>
- Type:
java.io.File
- Required:
Yes
- User Property:
micronaut.openapi.definition
- Default:
io.micronaut.openapi.invoker
<ensureUniqueParams>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.ensureUniqueParams
- Default:
true
<enumNameMapping>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.enumNameMapping
<generateHttpResponseWhereRequired>
- Type:
boolean
- Required:
Yes
- User Property:
micronaut.openapi.generate.http.response.where.required
- Default:
false
<generateSwaggerAnnotations>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.generateSwaggerAnnotations
- Default:
false
<generatorClassName>
The generator must property overwrite the AbstractMicronautJavaCodegen#optionsBuilder()
method and the builder should have setters or withers for the properties to be used in maven configuration.
- Type:
java.lang.String
- Required:
No
- User Property:
micronaut.openapi.generator.builder.classname
<implicitHeaders>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.implicitHeaders
- Default:
false
<implicitHeadersRegex>
- Type:
java.lang.String
- Required:
No
- User Property:
micronaut.openapi.implicitHeadersRegex
<importMapping>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.importMapping
<inlineSchemaNameMapping>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.inlineSchemaNameMapping
<inlineSchemaOption>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.inlineSchemaOption
<invokerPackageName>
- Type:
java.lang.String
- Required:
Yes
- User Property:
micronaut.openapi.invoker.package.name
- Default:
io.micronaut.openapi.invoker
<ksp>
- Type:
boolean
- Required:
Yes
- User Property:
micronaut.openapi.ksp
- Default:
false
<lang>
- Type:
java.lang.String
- Since:
4.3.0
- Required:
No
- User Property:
micronaut.openapi.lang
- Default:
java
<modelNameMapping>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.modelNameMapping
<modelNamePrefix>
- Type:
java.lang.String
- Required:
No
- User Property:
micronaut.openapi.modelNamePrefix
<modelNameSuffix>
- Type:
java.lang.String
- Required:
No
- User Property:
micronaut.openapi.modelNameSuffix
<modelPackageName>
- Type:
java.lang.String
- Required:
Yes
- User Property:
micronaut.openapi.model.package.name
- Default:
io.micronaut.openapi.model
<nameMapping>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.nameMapping
<openapiNormalizer>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.openapiNormalizer
<outputDirectory>
- Type:
java.io.File
- Required:
Yes
- Default:
${project.build.directory}/generated-sources/openapi
<outputKinds>
io.micronaut.openapi.generator.MicronautCodeGeneratorEntryPoint.OutputKind
enum.- Type:
java.util.List<java.lang.String>
- Required:
Yes
- User Property:
micronaut.openapi.outputs
- Default:
apis,models,supporting_files
<parameterMappings>
ParameterMapping
for details.- Type:
java.util.List<io.micronaut.maven.openapi.ParameterMapping>
- Required:
No
- User Property:
micronaut.openapi.parameterMappings
<prependFormOrBodyParameters>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.prependFormOrBodyParameters
<properties>
Any configuration parameters with key micronaut.openapi.generator.properties.[PROPERTY_NAME]
will be passed on to the generator options builder. String, integer and boolean value types are supported for additional properties.
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.generator.properties
<removeOperationIdPrefixCount>
- Type:
int
- Required:
No
- User Property:
micronaut.openapi.removeOperationIdPrefixCount
- Default:
1
<removeOperationIdPrefixDelimiter>
- Type:
java.lang.String
- Required:
No
- User Property:
micronaut.openapi.removeOperationIdPrefixDelimiter
- Default:
_
<responseBodyMappings>
ResponseBodyMapping
for details.- Type:
java.util.List<io.micronaut.maven.openapi.ResponseBodyMapping>
- Required:
No
- User Property:
micronaut.openapi.responseBodyMappings
<schemaMapping>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.schemaMapping
<serializationFramework>
- Type:
java.lang.String
- Required:
Yes
- User Property:
micronaut.openapi.serialization.framework
- Default:
MICRONAUT_SERDE_JACKSON
<skipOperationExample>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.skipOperationExample
<skipSortingOperations>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.skipSortingOperations
<sortModelPropertiesByRequiredFlag>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.sortModelPropertiesByRequiredFlag
- Default:
true
<sortParamsByRequiredFlag>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.sortParamsByRequiredFlag
- Default:
true
<typeMapping>
- Type:
java.util.Map<java.lang.String, java.lang.String>
- Required:
No
- User Property:
micronaut.openapi.typeMapping
<useBeanValidation>
- Type:
boolean
- Required:
Yes
- User Property:
micronaut.openapi.use.bean.validation
- Default:
true
<useEnumCaseInsensitive>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.useEnumCaseInsensitive
- Default:
false
<useJakartaEe>
- Type:
boolean
- Required:
No
- User Property:
micronaut.openapi.useJakartaEe
- Default:
true
<useOneOfInterfaces>
- Type:
boolean
- Required:
Yes
- User Property:
micronaut.openapi.use.one.of.interfaces
- Default:
true
<useOptional>
java.util.Optional
for non-required model properties and API parameters.- Type:
boolean
- Required:
Yes
- User Property:
micronaut.openapi.use.optional
- Default:
false
<useReactive>
- Type:
boolean
- Required:
Yes
- User Property:
micronaut.openapi.use.reactive
- Default:
true