Fork me on GitHub

mn:generate-openapi-generic

Full name:

io.micronaut.maven:micronaut-maven-plugin:4.6.0-SNAPSHOT: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
<apiPackageName> String - The package name for the APIs (controller interfaces).
Default: io.micronaut.openapi.api
User Property: micronaut.openapi.api.package.name
<definitionFile> File - The OpenAPI specification file path relative to the project's root path.
Default: io.micronaut.openapi.invoker
User Property: micronaut.openapi.definition
<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
<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
<useBeanValidation> boolean - Whether to generate validation annotations for models and APIs.
Default: true
User Property: micronaut.openapi.use.bean.validation
<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
<generatorClassName> String - The classname of the generator to be used for code generation.

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.


User Property: micronaut.openapi.generator.builder.classname
<lang> String 4.3.0 Allows specifying the language of the generated code.
Default: java
User Property: micronaut.openapi.lang
<parameterMappings> List<ParameterMapping> - Define parameter mappings that allow using custom types for parameter binding. See ParameterMapping for details.
User Property: micronaut.openapi.parameterMappings
<properties> Map<String,String> - The configuration properties that will be passed on to the custom generator options builder.

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.


User Property: micronaut.openapi.generator.properties
<responseBodyMappings> List<ResponseBodyMapping> - Define parameter mappings that allow using custom types for parameter binding. See ResponseBodyMapping for details.
User Property: micronaut.openapi.responseBodyMappings

Parameter Details

<apiPackageName>

The package name for the APIs (controller interfaces).
  • Type: java.lang.String
  • Required: Yes
  • User Property: micronaut.openapi.api.package.name
  • Default: io.micronaut.openapi.api

<definitionFile>

The OpenAPI specification file path relative to the project's root path.
  • Type: java.io.File
  • Required: Yes
  • User Property: micronaut.openapi.definition
  • Default: io.micronaut.openapi.invoker

<generatorClassName>

The classname of the generator to be used for code generation.

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

<invokerPackageName>

The name of the package that can be used for various classes required for invocation.
  • Type: java.lang.String
  • Required: Yes
  • User Property: micronaut.openapi.invoker.package.name
  • Default: io.micronaut.openapi.invoker

<lang>

Allows specifying the language of the generated code.
  • Type: java.lang.String
  • Since: 4.3.0
  • Required: No
  • User Property: micronaut.openapi.lang
  • Default: java

<modelPackageName>

The package name for the model classes.
  • Type: java.lang.String
  • Required: Yes
  • User Property: micronaut.openapi.model.package.name
  • Default: io.micronaut.openapi.model

<outputDirectory>

The output directory to which all the sources will be generated.
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.directory}/generated-sources/openapi

<outputKinds>

Comma-separated values of output kinds to generate. The values are defined by the 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>

Define parameter mappings that allow using custom types for parameter binding. See ParameterMapping for details.
  • Type: java.util.List<io.micronaut.maven.openapi.ParameterMapping>
  • Required: No
  • User Property: micronaut.openapi.parameterMappings

<properties>

The configuration properties that will be passed on to the custom generator options builder.

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

<responseBodyMappings>

Define parameter mappings that allow using custom types for parameter binding. See ResponseBodyMapping for details.
  • Type: java.util.List<io.micronaut.maven.openapi.ResponseBodyMapping>
  • Required: No
  • User Property: micronaut.openapi.responseBodyMappings

<useBeanValidation>

Whether to generate validation annotations for models and APIs.
  • Type: boolean
  • Required: Yes
  • User Property: micronaut.openapi.use.bean.validation
  • Default: true

<useOptional>

Whether to use java.util.Optional for non-required model properties and API parameters.
  • Type: boolean
  • Required: Yes
  • User Property: micronaut.openapi.use.optional
  • Default: false

<useReactive>

Whether to use reactor types for operation responses.
  • Type: boolean
  • Required: Yes
  • User Property: micronaut.openapi.use.reactive
  • Default: true