Class OpenApiGeneratorGenerateExtension
-
- All Implemented Interfaces:
public class OpenApiGeneratorGenerateExtensionGradle project level extension object definition for the
generatetaskJim Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private final Property<Boolean>verboseprivate final Property<Boolean>quietprivate final Property<Boolean>validateSpecprivate final Property<String>generatorNameprivate final DirectoryPropertyoutputDirprivate final RegularFilePropertyinputSpecprivate final DirectoryPropertyinputSpecRootDirectoryprivate final ConfigurableFileCollectioninputSpecFilesprivate final DirectoryPropertymergedFileOutputDirprivate final Property<Boolean>inputSpecRootDirectorySkipMergeprivate final Property<String>mergedFileNameprivate final Property<String>mergedFileInfoNameprivate final Property<String>mergedFileInfoDescriptionprivate final Property<String>mergedFileInfoVersionprivate final Property<String>mergeModeprivate final Property<String>mergeConflictStrategyprivate final Property<String>remoteInputSpecprivate final DirectoryPropertytemplateDirprivate final Property<String>templateResourcePathprivate final Property<String>authprivate final MapProperty<String, String>globalPropertiesprivate final RegularFilePropertyconfigFileprivate final Property<Boolean>skipOverwriteprivate final Property<String>packageNameprivate final Property<String>apiPackageprivate final Property<String>modelPackageprivate final Property<String>modelNamePrefixprivate final Property<String>modelNameSuffixprivate final Property<String>apiNameSuffixprivate final MapProperty<String, String>instantiationTypesprivate final MapProperty<String, String>typeMappingsprivate final MapProperty<String, Object>additionalPropertiesprivate final MapProperty<String, String>serverVariablesprivate final ListProperty<String>languageSpecificPrimitivesprivate final ListProperty<String>openapiGeneratorIgnoreListprivate final MapProperty<String, String>importMappingsprivate final MapProperty<String, String>schemaMappingsprivate final ListProperty<String>forcedGenerateSchemasprivate final MapProperty<String, String>inlineSchemaNameMappingsprivate final MapProperty<String, String>inlineSchemaOptionsprivate final MapProperty<String, String>nameMappingsprivate final MapProperty<String, String>parameterNameMappingsprivate final MapProperty<String, String>modelNameMappingsprivate final MapProperty<String, String>enumNameMappingsprivate final MapProperty<String, String>operationIdNameMappingsprivate final MapProperty<String, String>openapiNormalizerprivate final Property<String>invokerPackageprivate final Property<String>groupIdprivate final Property<String>idprivate final Property<String>versionprivate final Property<String>libraryprivate final Property<String>gitHostprivate final Property<String>gitUserIdprivate final Property<String>gitRepoIdprivate final Property<String>releaseNoteprivate final Property<String>httpUserAgentprivate final MapProperty<String, String>reservedWordsMappingsprivate final RegularFilePropertyignoreFileOverrideprivate final Property<Boolean>removeOperationIdPrefixprivate final Property<Boolean>skipOperationExampleprivate final ListProperty<String>apiFilesConstrainedToprivate final ListProperty<String>modelFilesConstrainedToprivate final ListProperty<String>supportingFilesConstrainedToprivate final Property<Boolean>generateModelTestsprivate final Property<Boolean>generateModelDocumentationprivate final Property<Boolean>generateApiTestsprivate final Property<Boolean>generateApiDocumentationprivate final Property<Boolean>logToStderrprivate final Property<Boolean>enablePostProcessFileprivate final Property<Boolean>skipValidateSpecprivate final Property<Boolean>generateAliasAsModelprivate final MapProperty<String, String>configOptionsprivate final Property<String>engineprivate final Property<Boolean>cleanupOutputprivate final Property<Boolean>dryRunprivate final Property<Boolean>strictSpecprivate final Property<Boolean>minimalUpdateprivate final Property<Boolean>generateRecursiveDependentModelsprivate final Property<String>workerIsolationprivate final Property<String>maxWorkerHeapSize
-
Constructor Summary
Constructors Constructor Description OpenApiGeneratorGenerateExtension(Project project)
-
Method Summary
Modifier and Type Method Description final Property<Boolean>getVerbose()The verbosity of generation final Property<Boolean>getQuiet()Whether generation should run in quiet mode. final Property<Boolean>getValidateSpec()Whether an input specification should be validated upon generation. final Property<String>getGeneratorName()The name of the generator which will handle codegen. final DirectoryPropertygetOutputDir()The output target directory into which code will be generated. final RegularFilePropertygetInputSpec()The Open API 2.0/3.x specification location. final DirectoryPropertygetInputSpecRootDirectory()Local root folder with spec files. final ConfigurableFileCollectiongetInputSpecFiles()An explicit ordered list of spec files to merge. final DirectoryPropertygetMergedFileOutputDir()Directory where the merged spec file is written when inputSpecFiles is used. final Property<Boolean>getInputSpecRootDirectorySkipMerge()Skip bundling all spec files into a merged spec file, if true. final Property<String>getMergedFileName()The name of the merged spec file produced when inputSpecRootDirectory is used. final Property<String>getMergedFileInfoName()Title placed in the info.titlefield of the merged spec.final Property<String>getMergedFileInfoDescription()Description placed in the info.descriptionfield of the merged spec.final Property<String>getMergedFileInfoVersion()Version placed in the info.versionfield of the merged spec.final Property<String>getMergeMode()How multiple spec files are merged. final Property<String>getMergeConflictStrategy()Strategy when two specs define the same component name or path+method with conflicting (non-identical) definitions. final Property<String>getRemoteInputSpec()The remote Open API 2.0/3.x specification URL location. final DirectoryPropertygetTemplateDir()The template directory holding a custom template. final Property<String>getTemplateResourcePath()The template location (which may be a directory or a classpath location) holding custom templates. final Property<String>getAuth()Adds authorization headers when fetching the OpenAPI definitions remotely. final MapProperty<String, String>getGlobalProperties()Sets specified global properties. final RegularFilePropertygetConfigFile()Path to json configuration file. final Property<Boolean>getSkipOverwrite()Specifies if the existing files should be overwritten during the generation. final Property<String>getPackageName()Package for generated classes (where supported) final Property<String>getApiPackage()Package for generated api classes final Property<String>getModelPackage()Package for generated models final Property<String>getModelNamePrefix()Prefix that will be prepended to all model names. final Property<String>getModelNameSuffix()Suffix that will be appended to all model names. final Property<String>getApiNameSuffix()Suffix that will be appended to all api names. final MapProperty<String, String>getInstantiationTypes()Sets instantiation type mappings. final MapProperty<String, String>getTypeMappings()Sets mappings between OpenAPI spec types and generated code types. final MapProperty<String, Object>getAdditionalProperties()Sets additional properties that can be referenced by the mustache templates. final MapProperty<String, String>getServerVariables()Sets server variable for server URL template substitution, in the format of name=value,name=value. final ListProperty<String>getLanguageSpecificPrimitives()Specifies additional language specific primitive types in the format of type1,type2,type3,type3. final ListProperty<String>getOpenapiGeneratorIgnoreList()Specifies .openapi-generator-ignore list in the form of relative/path/to/file1,relative/path/to/file2. final MapProperty<String, String>getImportMappings()Specifies mappings between a given class and the import that should be used for that class. final MapProperty<String, String>getSchemaMappings()Specifies mappings between a given schema and the new one final ListProperty<String>getForcedGenerateSchemas()Specifies schema names that must be generated even when listed in schemaMappings or importMappings final MapProperty<String, String>getInlineSchemaNameMappings()Specifies mappings between an inline schema name and the new name final MapProperty<String, String>getInlineSchemaOptions()Key/value options controlling how inline schemas are handled during generation. final MapProperty<String, String>getNameMappings()Specifies mappings between a property name and the new name final MapProperty<String, String>getParameterNameMappings()Specifies mappings between a parameter name and the new name final MapProperty<String, String>getModelNameMappings()Specifies mappings between a model name and the new name final MapProperty<String, String>getEnumNameMappings()Specifies mappings between an enum name and the new name final MapProperty<String, String>getOperationIdNameMappings()Specifies mappings between an operation id name and the new name final MapProperty<String, String>getOpenapiNormalizer()Key/value rules passed to the OpenAPI normalizer, which pre-processes the parsed spec before code generation begins. final Property<String>getInvokerPackage()Root package for generated code. final Property<String>getGroupId()GroupId in generated pom.xml/build.gradle.kts or other build script. final Property<String>getId()ArtifactId in generated pom.xml/build.gradle.kts or other build script. final Property<String>getVersion()Artifact version in generated pom.xml/build.gradle.kts or other build script. final Property<String>getLibrary()Reference the library template (sub-template) of a generator. final Property<String>getGitHost()Git host, e.g. final Property<String>getGitUserId()Git user ID, e.g. final Property<String>getGitRepoId()Git repo ID, e.g. final Property<String>getReleaseNote()Release note, default to 'Minor update'. final Property<String>getHttpUserAgent()HTTP user agent, e.g. final MapProperty<String, String>getReservedWordsMappings()Specifies how a reserved name should be escaped to. final RegularFilePropertygetIgnoreFileOverride()Specifies an override location for the .openapi-generator-ignore file. final Property<Boolean>getRemoveOperationIdPrefix()Remove prefix of operationId, e.g. final Property<Boolean>getSkipOperationExample()Skip examples defined in the operation final ListProperty<String>getApiFilesConstrainedTo()Defines which API-related files should be generated. final ListProperty<String>getModelFilesConstrainedTo()Defines which model-related files should be generated. final ListProperty<String>getSupportingFilesConstrainedTo()Defines which supporting files should be generated. final Property<Boolean>getGenerateModelTests()Defines whether model-related test files should be generated. final Property<Boolean>getGenerateModelDocumentation()Defines whether model-related documentation files should be generated. final Property<Boolean>getGenerateApiTests()Defines whether api-related test files should be generated. final Property<Boolean>getGenerateApiDocumentation()Defines whether api-related documentation files should be generated. final Property<Boolean>getLogToStderr()To write all log messages (not just errors) to STDERR. final Property<Boolean>getEnablePostProcessFile()To enable the file post-processing hook. final Property<Boolean>getSkipValidateSpec()To skip spec validation. final Property<Boolean>getGenerateAliasAsModel()To generate alias (array, list, map) as model. final MapProperty<String, String>getConfigOptions()A map of options specific to a generator. final Property<String>getEngine()Templating engine: "mustache" (default) or "handlebars" (beta) final Property<Boolean>getCleanupOutput()Defines whether the output dir should be cleaned up before generating the output. final Property<Boolean>getDryRun()Defines whether the generator should run in dry-run mode. final Property<Boolean>getStrictSpec()When true, applies strict validation against the OpenAPI specification, failing on any deviation.final Property<Boolean>getMinimalUpdate()When true, only writes output files that have changed relative to an existing generated output.final Property<Boolean>getGenerateRecursiveDependentModels()When true, recursively generates all models that the selected models depend on, even if those dependent models were not explicitly listed for generation.final Property<String>getWorkerIsolation()Controls how the code generation worker is isolated from the Gradle daemon. final Property<String>getMaxWorkerHeapSize()Maximum heap size for the worker process when workerIsolation is "process" (e.g. final UnitapplyDefaults()final UnitsetOutputDir(String path)Backwards-compatibility bridge for outputDir final UnitsetInputSpec(String path)Backwards-compatibility bridge for inputSpec final UnitsetInputSpecRootDirectory(String path)Backwards-compatibility bridge for inputSpecRootDirectory final UnitsetTemplateDir(String path)Backwards-compatibility bridge for templateDir final UnitsetConfigFile(String path)Backwards-compatibility bridge for configFile final UnitsetIgnoreFileOverride(String path)Backwards-compatibility bridge for ignoreFileOverride final Unitset(RegularFileProperty $self, String path)Extension function to allow setting inputSpec with a String path in Kotlin DSL. final Unitset(DirectoryProperty $self, String path)Extension function to allow setting directory properties with a String path in Kotlin DSL. -
-
Method Detail
-
getVerbose
final Property<Boolean> getVerbose()
The verbosity of generation
-
getValidateSpec
final Property<Boolean> getValidateSpec()
Whether an input specification should be validated upon generation. Defaults to
true.
-
getGeneratorName
final Property<String> getGeneratorName()
The name of the generator which will handle codegen. (see "openApiGenerators" task)
-
getOutputDir
final DirectoryProperty getOutputDir()
The output target directory into which code will be generated.
-
getInputSpec
final RegularFileProperty getInputSpec()
The Open API 2.0/3.x specification location.
Be default, Gradle will treat the openApiGenerate task as up-to-date based only on this file, regardless of changes to any $ref referenced files. Use the
inputSpecRootDirectoryproperty to have Gradle track changes to an entire directory of spec files.
-
getInputSpecRootDirectory
final DirectoryProperty getInputSpecRootDirectory()
Local root folder with spec files.
By default, a merged spec file will be generated based on the contents of the directory. To disable this, set the
inputSpecRootDirectorySkipMergeproperty.
-
getInputSpecFiles
final ConfigurableFileCollection getInputSpecFiles()
An explicit ordered list of spec files to merge.
When set, the generator merges exactly these files in the given order, rather than scanning a directory. Use with mergeMode and mergeConflictStrategy. The merged output is written to mergedFileOutputDir. Takes precedence over inputSpecRootDirectory if both are set.
-
getMergedFileOutputDir
final DirectoryProperty getMergedFileOutputDir()
Directory where the merged spec file is written when inputSpecFiles is used. Must be set when inputSpecFiles is non-empty.
-
getInputSpecRootDirectorySkipMerge
final Property<Boolean> getInputSpecRootDirectorySkipMerge()
Skip bundling all spec files into a merged spec file, if true.
Default false.
-
getMergedFileName
final Property<String> getMergedFileName()
The name of the merged spec file produced when inputSpecRootDirectory is used. Defaults to
"merged".
-
getMergedFileInfoName
final Property<String> getMergedFileInfoName()
Title placed in the
info.titlefield of the merged spec. Defaults to"merged spec". Only used when inputSpecRootDirectory is set.
-
getMergedFileInfoDescription
final Property<String> getMergedFileInfoDescription()
Description placed in the
info.descriptionfield of the merged spec. Defaults to"merged spec". Only used when inputSpecRootDirectory is set.
-
getMergedFileInfoVersion
final Property<String> getMergedFileInfoVersion()
Version placed in the
info.versionfield of the merged spec. Defaults to"1.0.0". Only used when inputSpecRootDirectory is set.
-
getMergeMode
final Property<String> getMergeMode()
How multiple spec files are merged. Accepted values: "REF" (default, original $ref-based shallow merge, backward-compatible) or "DEEP" (full inline merge with component deduplication and conflict detection).
-
getMergeConflictStrategy
final Property<String> getMergeConflictStrategy()
Strategy when two specs define the same component name or path+method with conflicting (non-identical) definitions. Accepted values: "WARN" (default, keep first definition and log a warning) or "FAIL" (throw an exception and abort the build). Only applies when mergeMode is "DEEP".
-
getRemoteInputSpec
final Property<String> getRemoteInputSpec()
The remote Open API 2.0/3.x specification URL location.
-
getTemplateDir
final DirectoryProperty getTemplateDir()
The template directory holding a custom template.
-
getTemplateResourcePath
final Property<String> getTemplateResourcePath()
The template location (which may be a directory or a classpath location) holding custom templates.
-
getAuth
final Property<String> getAuth()
Adds authorization headers when fetching the OpenAPI definitions remotely. Pass in a URL-encoded string of name:header with a comma separating multiple values
-
getGlobalProperties
final MapProperty<String, String> getGlobalProperties()
Sets specified global properties.
-
getConfigFile
final RegularFileProperty getConfigFile()
Path to json configuration file. File content should be in a json format { "optionKey":"optionValue", "optionKey1":"optionValue1"...} Supported options can be different for each language. Run config-help -g {generator name} command for language specific config options.
-
getSkipOverwrite
final Property<Boolean> getSkipOverwrite()
Specifies if the existing files should be overwritten during the generation.
-
getPackageName
final Property<String> getPackageName()
Package for generated classes (where supported)
-
getApiPackage
final Property<String> getApiPackage()
Package for generated api classes
-
getModelPackage
final Property<String> getModelPackage()
Package for generated models
-
getModelNamePrefix
final Property<String> getModelNamePrefix()
Prefix that will be prepended to all model names. Default is the empty string.
-
getModelNameSuffix
final Property<String> getModelNameSuffix()
Suffix that will be appended to all model names. Default is the empty string.
-
getApiNameSuffix
final Property<String> getApiNameSuffix()
Suffix that will be appended to all api names. Default is the empty string.
-
getInstantiationTypes
final MapProperty<String, String> getInstantiationTypes()
Sets instantiation type mappings.
-
getTypeMappings
final MapProperty<String, String> getTypeMappings()
Sets mappings between OpenAPI spec types and generated code types.
-
getAdditionalProperties
final MapProperty<String, Object> getAdditionalProperties()
Sets additional properties that can be referenced by the mustache templates.
-
getServerVariables
final MapProperty<String, String> getServerVariables()
Sets server variable for server URL template substitution, in the format of name=value,name=value.
-
getLanguageSpecificPrimitives
final ListProperty<String> getLanguageSpecificPrimitives()
Specifies additional language specific primitive types in the format of type1,type2,type3,type3. For example: String,boolean,Boolean,Double.
-
getOpenapiGeneratorIgnoreList
final ListProperty<String> getOpenapiGeneratorIgnoreList()
Specifies .openapi-generator-ignore list in the form of relative/path/to/file1,relative/path/to/file2. For example: README.md,pom.xml.
-
getImportMappings
final MapProperty<String, String> getImportMappings()
Specifies mappings between a given class and the import that should be used for that class.
-
getSchemaMappings
final MapProperty<String, String> getSchemaMappings()
Specifies mappings between a given schema and the new one
-
getForcedGenerateSchemas
final ListProperty<String> getForcedGenerateSchemas()
Specifies schema names that must be generated even when listed in schemaMappings or importMappings
-
getInlineSchemaNameMappings
final MapProperty<String, String> getInlineSchemaNameMappings()
Specifies mappings between an inline schema name and the new name
-
getInlineSchemaOptions
final MapProperty<String, String> getInlineSchemaOptions()
Key/value options controlling how inline schemas are handled during generation.
Common keys:
RESOLVE_INLINE_ENUMS(promote inline enums to top-level models),ARRAY_ITEMS_SUFFIX,MAP_ITEMS_SUFFIX. Runconfig-help -g {generatorName}for the full list of supported options.
-
getNameMappings
final MapProperty<String, String> getNameMappings()
Specifies mappings between a property name and the new name
-
getParameterNameMappings
final MapProperty<String, String> getParameterNameMappings()
Specifies mappings between a parameter name and the new name
-
getModelNameMappings
final MapProperty<String, String> getModelNameMappings()
Specifies mappings between a model name and the new name
-
getEnumNameMappings
final MapProperty<String, String> getEnumNameMappings()
Specifies mappings between an enum name and the new name
-
getOperationIdNameMappings
final MapProperty<String, String> getOperationIdNameMappings()
Specifies mappings between an operation id name and the new name
-
getOpenapiNormalizer
final MapProperty<String, String> getOpenapiNormalizer()
Key/value rules passed to the OpenAPI normalizer, which pre-processes the parsed spec before code generation begins.
Example rules:
REFACTOR_ALLOF_WITH_PROPERTIES_ONLY=true,REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY=true. See the OpenAPI Generator docs for the full list of normalizer rules.
-
getInvokerPackage
final Property<String> getInvokerPackage()
Root package for generated code.
-
getGroupId
final Property<String> getGroupId()
GroupId in generated pom.xml/build.gradle.kts or other build script. Language-specific conversions occur in non-jvm generators.
-
getId
final Property<String> getId()
ArtifactId in generated pom.xml/build.gradle.kts or other build script. Language-specific conversions occur in non-jvm generators.
-
getVersion
final Property<String> getVersion()
Artifact version in generated pom.xml/build.gradle.kts or other build script. Language-specific conversions occur in non-jvm generators.
-
getLibrary
final Property<String> getLibrary()
Reference the library template (sub-template) of a generator.
-
getGitHost
final Property<String> getGitHost()
Git host, e.g. gitlab.com.
-
getGitUserId
final Property<String> getGitUserId()
Git user ID, e.g. openapitools.
-
getGitRepoId
final Property<String> getGitRepoId()
Git repo ID, e.g. openapi-generator.
-
getReleaseNote
final Property<String> getReleaseNote()
Release note, default to 'Minor update'.
-
getHttpUserAgent
final Property<String> getHttpUserAgent()
HTTP user agent, e.g. codegen_csharp_api_client, default to 'OpenAPI-Generator/{packageVersion}/{language}'
-
getReservedWordsMappings
final MapProperty<String, String> getReservedWordsMappings()
Specifies how a reserved name should be escaped to. Otherwise, the default _<name> is used.
-
getIgnoreFileOverride
final RegularFileProperty getIgnoreFileOverride()
Specifies an override location for the .openapi-generator-ignore file. Most useful on initial generation.
-
getRemoveOperationIdPrefix
final Property<Boolean> getRemoveOperationIdPrefix()
Remove prefix of operationId, e.g. config_getId => getId
-
getSkipOperationExample
final Property<Boolean> getSkipOperationExample()
Skip examples defined in the operation
-
getApiFilesConstrainedTo
final ListProperty<String> getApiFilesConstrainedTo()
Defines which API-related files should be generated. This allows you to create a subset of generated files (or none at all).
NOTE: Configuring any one of apiFilesConstrainedTo, modelFilesConstrainedTo, or supportingFilesConstrainedTo results in others being disabled. That is, OpenAPI Generator considers any one of these to define a subset of generation. For more control over generation of individual files, configure an ignore file and refer to it via ignoreFileOverride.
-
getModelFilesConstrainedTo
final ListProperty<String> getModelFilesConstrainedTo()
Defines which model-related files should be generated. This allows you to create a subset of generated files (or none at all).
NOTE: Configuring any one of apiFilesConstrainedTo, modelFilesConstrainedTo, or supportingFilesConstrainedTo results in others being disabled. That is, OpenAPI Generator considers any one of these to define a subset of generation. For more control over generation of individual files, configure an ignore file and refer to it via ignoreFileOverride.
-
getSupportingFilesConstrainedTo
final ListProperty<String> getSupportingFilesConstrainedTo()
Defines which supporting files should be generated. This allows you to create a subset of generated files (or none at all).
Supporting files are those related to
projects/frameworkswhich may be modified by consumers.NOTE: Configuring any one of apiFilesConstrainedTo, modelFilesConstrainedTo, or supportingFilesConstrainedTo results in others being disabled. That is, OpenAPI Generator considers any one of these to define a subset of generation. For more control over generation of individual files, configure an ignore file and refer to it via ignoreFileOverride.
-
getGenerateModelTests
final Property<Boolean> getGenerateModelTests()
Defines whether model-related test files should be generated.
This option enables/disables generation of ALL model-related test files.
For more control over generation of individual files, configure an ignore file and refer to it via ignoreFileOverride. Defaults to
true.
-
getGenerateModelDocumentation
final Property<Boolean> getGenerateModelDocumentation()
Defines whether model-related documentation files should be generated.
This option enables/disables generation of ALL model-related documentation files.
For more control over generation of individual files, configure an ignore file and refer to it via ignoreFileOverride. Defaults to
true.
-
getGenerateApiTests
final Property<Boolean> getGenerateApiTests()
Defines whether api-related test files should be generated.
This option enables/disables generation of ALL api-related test files.
For more control over generation of individual files, configure an ignore file and refer to it via ignoreFileOverride. Defaults to
true.
-
getGenerateApiDocumentation
final Property<Boolean> getGenerateApiDocumentation()
Defines whether api-related documentation files should be generated.
This option enables/disables generation of ALL api-related documentation files.
For more control over generation of individual files, configure an ignore file and refer to it via ignoreFileOverride. Defaults to
true.
-
getLogToStderr
final Property<Boolean> getLogToStderr()
To write all log messages (not just errors) to STDERR. Defaults to
false.
-
getEnablePostProcessFile
final Property<Boolean> getEnablePostProcessFile()
To enable the file post-processing hook. This enables executing an external post-processor (usually a linter program). This only enables the post-processor. To define the post-processing command, define an environment variable such as LANG_POST_PROCESS_FILE (e.g. GO_POST_PROCESS_FILE, SCALA_POST_PROCESS_FILE). Please open an issue if your target generator does not support this functionality. Defaults to
false.
-
getSkipValidateSpec
final Property<Boolean> getSkipValidateSpec()
To skip spec validation. When true, we will skip the default behavior of validating a spec before generation. Defaults to
false.
-
getGenerateAliasAsModel
final Property<Boolean> getGenerateAliasAsModel()
To generate alias (array, list, map) as model. When false, top-level objects defined as array, list, or map will result in those definitions generated as top-level Array-of-items, List-of-items, Map-of-items definitions. When true, A model representation either containing or extending the array,list,map (depending on specific generator implementation) will be generated. Defaults to
false.
-
getConfigOptions
final MapProperty<String, String> getConfigOptions()
A map of options specific to a generator.
-
getEngine
final Property<String> getEngine()
Templating engine: "mustache" (default) or "handlebars" (beta)
-
getCleanupOutput
final Property<Boolean> getCleanupOutput()
Defines whether the output dir should be cleaned up before generating the output. Defaults to
false.
-
getDryRun
final Property<Boolean> getDryRun()
Defines whether the generator should run in dry-run mode. Defaults to
false.
-
getStrictSpec
final Property<Boolean> getStrictSpec()
When
true, applies strict validation against the OpenAPI specification, failing on any deviation. When not set, any value from configFile is used; the generator's own default isfalse.
-
getMinimalUpdate
final Property<Boolean> getMinimalUpdate()
When
true, only writes output files that have changed relative to an existing generated output. Reduces unnecessary file churn in version control. When not set, any value from configFile is used; the generator's own default isfalse.
-
getGenerateRecursiveDependentModels
final Property<Boolean> getGenerateRecursiveDependentModels()
When
true, recursively generates all models that the selected models depend on, even if those dependent models were not explicitly listed for generation. Only relevant when modelFilesConstrainedTo is configured. When not set, any value from configFile is used; the generator's own default isfalse.
-
getWorkerIsolation
final Property<String> getWorkerIsolation()
Controls how the code generation worker is isolated from the Gradle daemon.
"classloader" (default): runs inside the Gradle daemon JVM with a separate ClassLoader. No process startup overhead, but generator classes accumulate in daemon Metaspace. Suitable for projects with very few generation tasks.
"process": runs in a separate JVM. Metaspace is isolated from the daemon and freed when the worker exits. Gradle reuses the worker process across tasks that share the same classpath, so the JVM startup cost is typically paid only once per parallel slot. Best for projects with many generation tasks.
-
getMaxWorkerHeapSize
final Property<String> getMaxWorkerHeapSize()
Maximum heap size for the worker process when workerIsolation is "process" (e.g. "512m", "1g"). Has no effect when workerIsolation is "classloader". When not set, the JVM uses ergonomic defaults (typically based on available system memory). Only set this if you hit OutOfMemoryError during generation of unusually large specs.
-
applyDefaults
final Unit applyDefaults()
-
setOutputDir
final Unit setOutputDir(String path)
Backwards-compatibility bridge for outputDir
-
setInputSpec
final Unit setInputSpec(String path)
Backwards-compatibility bridge for inputSpec
-
setInputSpecRootDirectory
final Unit setInputSpecRootDirectory(String path)
Backwards-compatibility bridge for inputSpecRootDirectory
-
setTemplateDir
final Unit setTemplateDir(String path)
Backwards-compatibility bridge for templateDir
-
setConfigFile
final Unit setConfigFile(String path)
Backwards-compatibility bridge for configFile
-
setIgnoreFileOverride
final Unit setIgnoreFileOverride(String path)
Backwards-compatibility bridge for ignoreFileOverride
-
set
final Unit set(RegularFileProperty $self, String path)
Extension function to allow setting inputSpec with a String path in Kotlin DSL. Example: inputSpec.set("$rootDir/api.yaml")
-
-
-
-