Package io.micronaut.maven.openapi
Class OpenApiServerMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.micronaut.maven.AbstractMicronautMojo
io.micronaut.maven.openapi.AbstractOpenApiMojo
io.micronaut.maven.openapi.OpenApiServerMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="generate-openapi-server",
defaultPhase=GENERATE_SOURCES)
public class OpenApiServerMojo
extends AbstractOpenApiMojo
Generates an OpenAPI server.
The sources are generated in the target directory.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
If set to true, the generated code should be made compatible with Micronaut AOT.protected String
The package name of the controller if controller implementation files are generated.protected boolean
The property that defines if this mojo should be used in configuration.protected boolean
Determines if the server should use flux for arrays.protected boolean
If set to true, the `javax.annotation.Generated` annotation will be added to all generated classes.protected boolean
Determines if the server should use lombok.static final String
protected boolean
Whether to generate authentication annotations for APIs.Fields inherited from class io.micronaut.maven.openapi.AbstractOpenApiMojo
additionalEnumTypeAnnotations, additionalModelTypeAnnotations, additionalOneOfTypeAnnotations, additionalProperties, allowUnicodeIdentifiers, alwaysUseGenerateHttpResponse, apiNamePrefix, apiNameSuffix, apiPackageName, dateTimeFormat, definitionFile, ensureUniqueParams, enumNameMapping, generateHttpResponseWhereRequired, generateSwaggerAnnotations, implicitHeaders, implicitHeadersRegex, importMapping, inlineSchemaNameMapping, inlineSchemaOption, invokerPackageName, ksp, lang, modelNameMapping, modelNamePrefix, modelNameSuffix, modelPackageName, nameMapping, openapiNormalizer, outputDirectory, outputKinds, parameterMappings, prependFormOrBodyParameters, project, removeOperationIdPrefixCount, removeOperationIdPrefixDelimiter, responseBodyMappings, schemaMapping, serializationFramework, skipOperationExample, skipSortingOperations, sortModelPropertiesByRequiredFlag, sortParamsByRequiredFlag, typeMapping, useBeanValidation, useEnumCaseInsensitive, useJakartaEe, useOneOfInterfaces, useOptional, useReactive
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureBuilder
(io.micronaut.openapi.generator.MicronautCodeGeneratorBuilder builder) Configures the OpenAPI generator.protected boolean
Determines if this mojo must be executed.Methods inherited from class io.micronaut.maven.openapi.AbstractOpenApiMojo
execute
Methods inherited from class io.micronaut.maven.AbstractMicronautMojo
setLog
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setPluginContext
-
Field Details
-
MOJO_NAME
- See Also:
-
controllerPackageName
@Parameter(property="micronaut.openapi.server.controller.package.name", defaultValue="io.micronaut.openapi.controller.package.name", required=true) protected String controllerPackageNameThe package name of the controller if controller implementation files are generated. -
useAuth
@Parameter(property="micronaut.openapi.server.use.auth", defaultValue="false") protected boolean useAuthWhether to generate authentication annotations for APIs. -
lombok
Determines if the server should use lombok.- Since:
- 4.2.2
-
fluxForArrays
Determines if the server should use flux for arrays.- Since:
- 4.2.2
-
generatedAnnotation
@Parameter(property="micronaut.openapi.server.generated.annotation", defaultValue="true") protected boolean generatedAnnotationIf set to true, the `javax.annotation.Generated` annotation will be added to all generated classes.- Since:
- 4.2.2
-
aotCompatible
If set to true, the generated code should be made compatible with Micronaut AOT.- Since:
- 4.2.2
-
enabled
The property that defines if this mojo should be used in configuration.
-
-
Constructor Details
-
OpenApiServerMojo
public OpenApiServerMojo()
-
-
Method Details
-
isEnabled
Description copied from class:AbstractOpenApiMojo
Determines if this mojo must be executed.- Specified by:
isEnabled
in classAbstractOpenApiMojo
- Returns:
- true if the mojo is enabled
-
configureBuilder
protected void configureBuilder(io.micronaut.openapi.generator.MicronautCodeGeneratorBuilder builder) Description copied from class:AbstractOpenApiMojo
Configures the OpenAPI generator. When this method is called, common properties shared by all generators have already been configured, so this method should only take care of configuring the generator specific parameters.- Specified by:
configureBuilder
in classAbstractOpenApiMojo
- Parameters:
builder
- the generator configuration builder
-