Package org.openapitools.codegen
Class DefaultGenerator
- java.lang.Object
-
- org.openapitools.codegen.DefaultGenerator
-
-
Field Summary
Fields Modifier and Type Field Description protected CodegenConfig
config
protected CodegenIgnoreProcessor
ignoreProcessor
protected org.slf4j.Logger
LOGGER
protected io.swagger.v3.oas.models.OpenAPI
openAPI
protected ClientOptInput
opts
protected TemplateProcessor
templateProcessor
-
Constructor Summary
Constructors Constructor Description DefaultGenerator()
DefaultGenerator(Boolean dryRun)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<File>
generate()
TemplateProcessor
getTemplateProcessor()
Retrieves an instance to the configured template processor, available after user-defined options are applied viaopts(ClientOptInput)
.Generator
opts(ClientOptInput opts)
Map<String,List<CodegenOperation>>
processPaths(io.swagger.v3.oas.models.Paths paths)
protected File
processTemplateToFile(Map<String,Object> templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption)
Map<String,List<CodegenOperation>>
processWebhooks(Map<String,io.swagger.v3.oas.models.PathItem> webhooks)
void
setGenerateMetadata(Boolean generateMetadata)
Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore, or other metadata files used by OpenAPI Generator.void
setGeneratorPropertyDefault(String key, String value)
Set generator properties otherwise pulled from system properties.
-
-
-
Field Detail
-
LOGGER
protected final org.slf4j.Logger LOGGER
-
config
protected CodegenConfig config
-
opts
protected ClientOptInput opts
-
openAPI
protected io.swagger.v3.oas.models.OpenAPI openAPI
-
ignoreProcessor
protected CodegenIgnoreProcessor ignoreProcessor
-
templateProcessor
protected TemplateProcessor templateProcessor
-
-
Constructor Detail
-
DefaultGenerator
public DefaultGenerator()
-
DefaultGenerator
public DefaultGenerator(Boolean dryRun)
-
-
Method Detail
-
opts
public Generator opts(ClientOptInput opts)
-
getTemplateProcessor
public TemplateProcessor getTemplateProcessor()
Retrieves an instance to the configured template processor, available after user-defined options are applied viaopts(ClientOptInput)
.- Returns:
- A configured
TemplateProcessor
, or null.
-
setGenerateMetadata
public void setGenerateMetadata(Boolean generateMetadata)
Programmatically disable the output of .openapi-generator/VERSION, .openapi-generator-ignore, or other metadata files used by OpenAPI Generator.- Parameters:
generateMetadata
- true: enable outputs, false: disable outputs
-
setGeneratorPropertyDefault
public void setGeneratorPropertyDefault(String key, String value)
Set generator properties otherwise pulled from system properties. Useful for running tests in parallel without relying on System.properties.- Parameters:
key
- The system property keyvalue
- The system property value
-
processTemplateToFile
protected File processTemplateToFile(Map<String,Object> templateData, String templateName, String outputFilename, boolean shouldGenerate, String skippedByOption) throws IOException
- Throws:
IOException
-
processPaths
public Map<String,List<CodegenOperation>> processPaths(io.swagger.v3.oas.models.Paths paths)
-
-