Package io.micronaut.maven.openapi
Class OpenApiClientMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
io.micronaut.maven.AbstractMicronautMojo
io.micronaut.maven.openapi.AbstractOpenApiMojo
io.micronaut.maven.openapi.OpenApiClientMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="generate-openapi-client",
defaultPhase=GENERATE_SOURCES)
public class OpenApiClientMojo
extends AbstractOpenApiMojo
Generates an OpenAPI client.
The sources are generated in the target directory.
-
Field Summary
Modifier and TypeFieldDescriptionAdditional annotations to be used on the generated client API classes.protected String
The pattern for authorization filter.protected String
The base path separator.protected String
Client id.protected boolean
If set to true, Api annotation @Client will be with `path` attribute.protected boolean
The property that defines if this mojo is used.protected boolean
Determines if the client 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 client should use lombok.static final String
protected boolean
Whether to configure authentication for client.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:
-
clientId
Client id. -
clientPath
If set to true, Api annotation @Client will be with `path` attribute. -
useAuth
@Parameter(property="micronaut.openapi.client.use.auth", defaultValue="false") protected boolean useAuthWhether to configure authentication for client. -
additionalTypeAnnotations
@Parameter(property="micronaut.openapi.client.additional.type.annotations") protected List<String> additionalTypeAnnotationsAdditional annotations to be used on the generated client API classes. -
basePathSeparator
@Parameter(property="micronaut.openapi.client.base.path.separator") protected String basePathSeparatorThe base path separator. -
authorizationFilterPattern
@Parameter(property="micronaut.openapi.client.authorization.filter.pattern") protected String authorizationFilterPatternThe pattern for authorization filter. -
enabled
The property that defines if this mojo is used. -
lombok
Determines if the client should use lombok.- Since:
- 4.2.2
-
fluxForArrays
Determines if the client should use flux for arrays.- Since:
- 4.2.2
-
generatedAnnotation
@Parameter(property="micronaut.openapi.client.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
-
-
Constructor Details
-
OpenApiClientMojo
public OpenApiClientMojo()
-
-
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
-