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
FieldsModifier and TypeFieldDescriptionAdditional annotations to be used on the generated client API classes.protected StringThe pattern for authorization filter.protected StringThe base path separator.protected StringClient id.protected booleanIf set to true, Api annotation @Client will be with `path` attribute.protected booleanThe property that defines if this mojo is used.protected booleanDetermines if the client should use flux for arrays.protected booleanIf set to true, the `javax.annotation.Generated` annotation will be added to all generated classes.protected booleanDetermines if the client should use lombok.static final Stringprotected booleanWhether to configure authentication for client.Fields inherited from class io.micronaut.maven.openapi.AbstractOpenApiMojo
additionalEnumTypeAnnotations, additionalModelTypeAnnotations, additionalOneOfTypeAnnotations, additionalProperties, allowUnicodeIdentifiers, alwaysUseGenerateHttpResponse, apiNamePrefix, apiNameSuffix, apiPackageName, coroutines, dateTimeFormat, definitionFile, ensureUniqueParams, enumNameMapping, generateControllerAsAbstract, generateHttpResponseWhereRequired, generateSwaggerAnnotations, implicitHeaders, implicitHeadersRegex, importMapping, inlineSchemaNameMapping, inlineSchemaOption, invokerPackageName, jsonIncludeAlwaysForRequiredFields, ksp, lang, modelNameMapping, modelNamePrefix, modelNameSuffix, modelPackageName, nameMapping, openapiNormalizer, outputDirectory, outputKinds, parameterMappings, prependFormOrBodyParameters, project, removeOperationIdPrefixCount, removeOperationIdPrefixDelimiter, requiredPropertiesInConstructor, responseBodyMappings, schemaMapping, serializationFramework, skipOperationExample, skipSortingOperations, sortModelPropertiesByRequiredFlag, sortParamsByRequiredFlag, typeMapping, useBeanValidation, useEnumCaseInsensitive, useJakartaEe, useOneOfInterfaces, useOptional, useReactive, useSealedFields inherited from interface org.apache.maven.plugin.Mojo
ROLE - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigureBuilder(io.micronaut.openapi.generator.MicronautCodeGeneratorBuilder builder) Configures the OpenAPI generator.protected booleanDetermines if this mojo must be executed.Methods inherited from class io.micronaut.maven.openapi.AbstractOpenApiMojo
executeMethods inherited from class io.micronaut.maven.AbstractMicronautMojo
setLogMethods 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:AbstractOpenApiMojoDetermines if this mojo must be executed.- Specified by:
 isEnabledin classAbstractOpenApiMojo- Returns:
 - true if the mojo is enabled
 
 - 
configureBuilder
protected void configureBuilder(io.micronaut.openapi.generator.MicronautCodeGeneratorBuilder builder) Description copied from class:AbstractOpenApiMojoConfigures 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:
 configureBuilderin classAbstractOpenApiMojo- Parameters:
 builder- the generator configuration builder
 
 -