Class OpenApiClientMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
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 Details

    • MOJO_NAME

      public static final String MOJO_NAME
      See Also:
    • clientId

      @Parameter(property="micronaut.openapi.client.id", defaultValue="") protected String clientId
      Client id.
    • useAuth

      @Parameter(property="micronaut.openapi.client.use.auth", defaultValue="false") protected boolean useAuth
      Whether to configure authentication for client.
    • additionalTypeAnnotations

      @Parameter(property="micronaut.openapi.client.additional.type.annotations") protected List<String> additionalTypeAnnotations
      Additional annotations to be used on the generated client API classes.
    • basePathSeparator

      @Parameter(property="micronaut.openapi.client.base.path.separator") protected String basePathSeparator
      The base path separator.
    • authorizationFilterPattern

      @Parameter(property="micronaut.openapi.client.authorization.filter.pattern") protected String authorizationFilterPattern
      The pattern for authorization filter.
    • enabled

      @Parameter(property="micronaut.openapi.generate.client") protected boolean enabled
      The property that defines if this mojo is used.
    • lombok

      @Parameter(property="micronaut.openapi.client.lombok") protected boolean lombok
      Determines if the client should use lombok.
      Since:
      4.2.2
    • fluxForArrays

      @Parameter(property="micronaut.openapi.client.flux.for.arrays") protected boolean 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 generatedAnnotation
      If set to true, the `javax.annotation.Generated` annotation will be added to all generated classes.
      Since:
      4.2.2
  • Constructor Details

  • Method Details

    • isEnabled

      protected boolean isEnabled()
      Description copied from class: AbstractOpenApiMojo
      Determines if this mojo must be executed.
      Specified by:
      isEnabled in class AbstractOpenApiMojo
      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 class AbstractOpenApiMojo
      Parameters:
      builder - the generator configuration builder