Class JetOpenApiAnnotationsExtension
java.lang.Object
net.jacobpeterson.jet.openapiannotationsplugin.JetOpenApiAnnotationsExtension
JetOpenApiAnnotationsExtension is a Gradle extension for JetOpenApiAnnotationsPlugin.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.file.ConfigurableFileCollectionFor theJetOpenApiAnnotationsTask, the classpath files to load into aClassLoaderthat should be scanned forOpenApiannotations.abstract org.gradle.api.file.ConfigurableFileCollectionFor theJetOpenApiAnnotationsTask, the classpaths to load into aClassLoaderfor dependency classes used in fields thatOpenApiSchema.fromClass().abstract org.gradle.api.provider.Property<Boolean> For theJetOpenApiAnnotationsTask, set totrueto, if not already provided, generateOpenApiOperation.operationId()by concatenatingOpenApiPathItem.methods()with the lower-camelcase conversion of the path segments ofOpenApiPathItem.MapEntry.key()after the index ofOpenApiOperation.tags().abstract org.gradle.api.provider.Property<Boolean> For theJetOpenApiAnnotationsTask, set totrueto move the JSON schema generated fromOpenApiSchema.fromClass()toOpenApiComponents.schemas(), set tofalseotherwise.abstract org.gradle.api.file.DirectoryPropertyTheJetOpenApiAnnotationsTaskoutput directory.abstract org.gradle.api.provider.Property<Boolean> abstract org.gradle.api.provider.Property<SchemaGeneratorConfigBuilderProvider> For theJetOpenApiAnnotationsTask, aMapcontaining simple type mappings with the fully qualified class name as the key and the raw JSON schema as the value.abstract org.gradle.api.provider.Property<Boolean> abstract org.gradle.api.provider.Property<Boolean> For theJetOpenApiAnnotationsTask, set totrueto use theJacksonSchemaModule, set tofalseotherwise.abstract org.gradle.api.provider.Property<Boolean> For theJetOpenApiAnnotationsTask, set totrueto use theNullableSchemaModule, set tofalseotherwise.abstract org.gradle.api.provider.Property<Boolean> For theJetOpenApiAnnotationsTask, set totrueto use theSchemaNameSchemaModule, set tofalseotherwise.abstract org.gradle.api.provider.Property<Boolean> For theJetOpenApiAnnotationsTask, set totrueto validate the OpenAPI specification JSON output generated fromOpenApiannotations using supported OpenAPI JSON schemas (seeOpenApipublic constants starting with$SCHEMA_), set tofalseotherwise.
-
Constructor Details
-
JetOpenApiAnnotationsExtension
public JetOpenApiAnnotationsExtension()
-
-
Method Details
-
getAnnotatedClasspaths
public abstract org.gradle.api.file.ConfigurableFileCollection getAnnotatedClasspaths()For theJetOpenApiAnnotationsTask, the classpath files to load into aClassLoaderthat should be scanned forOpenApiannotations. Can be JAR files or a directories containing.classfiles, but only.classfiles will be scanned forOpenApiannotations. The classes inside JAR files will not be scanned.Defaults to
DefaultTask.getOutputs(). -
getClasspaths
public abstract org.gradle.api.file.ConfigurableFileCollection getClasspaths()For theJetOpenApiAnnotationsTask, the classpaths to load into aClassLoaderfor dependency classes used in fields thatOpenApiSchema.fromClass(). Can be JAR files or directories containing.classfiles. These classpaths will not be scanned forOpenApiannotations.Defaults to
JavaCompile.getClasspath(). -
getSchemaGeneratorConfigBuilderProvider
public abstract org.gradle.api.provider.Property<SchemaGeneratorConfigBuilderProvider> getSchemaGeneratorConfigBuilderProvider() -
getSchemaGeneratorUseNullableModule
For theJetOpenApiAnnotationsTask, set totrueto use theNullableSchemaModule, set tofalseotherwise.Defaults to
true. -
getSchemaGeneratorUseSchemaNameModule
For theJetOpenApiAnnotationsTask, set totrueto use theSchemaNameSchemaModule, set tofalseotherwise.Defaults to
true. -
getSchemaGeneratorUseGsonModule
For theJetOpenApiAnnotationsTask, set totrueto useGsonSchemaModulethe, set tofalseotherwise.Defaults to
false. -
getSchemaGeneratorUseJacksonModule
For theJetOpenApiAnnotationsTask, set totrueto use theJacksonSchemaModule, set tofalseotherwise.Defaults to
false. -
getSchemaGeneratorSimpleTypeMappings
public abstract org.gradle.api.provider.MapProperty<String,String> getSchemaGeneratorSimpleTypeMappings()For theJetOpenApiAnnotationsTask, aMapcontaining simple type mappings with the fully qualified class name as the key and the raw JSON schema as the value. -
getGenerateOperationId
For theJetOpenApiAnnotationsTask, set totrueto, if not already provided, generateOpenApiOperation.operationId()by concatenatingOpenApiPathItem.methods()with the lower-camelcase conversion of the path segments ofOpenApiPathItem.MapEntry.key()after the index ofOpenApiOperation.tags(). For example, if method isPOST, path item key is/account/create, and tag isaccount, then the generated operation ID ispostCreate. For many OpenAPI generated clients, this results in intuitively-named method calls, for example:account.postCreate(...).Defaults to
true. -
getMoveClassSchemasToComponents
For theJetOpenApiAnnotationsTask, set totrueto move the JSON schema generated fromOpenApiSchema.fromClass()toOpenApiComponents.schemas(), set tofalseotherwise.Defaults to
true. -
getSchemaValidation
For theJetOpenApiAnnotationsTask, set totrueto validate the OpenAPI specification JSON output generated fromOpenApiannotations using supported OpenAPI JSON schemas (seeOpenApipublic constants starting with$SCHEMA_), set tofalseotherwise.Defaults to
true. -
getOutputDirectory
public abstract org.gradle.api.file.DirectoryProperty getOutputDirectory()TheJetOpenApiAnnotationsTaskoutput directory.Defaults to
JetOpenApiAnnotationsPlugin.BUILD_OUTPUT_DEFAULT_DIRECTORY_NAME. -
getOutputDirectoryIncludeInJar
Set totrueto include thegetOutputDirectory()in eachJarTask, set tofalseotherwise.Defaults to
true.
-