public class DefaultGenerator extends AbstractGenerator implements Generator
Modifier and Type | Field and Description |
---|---|
protected String |
basePath |
protected String |
basePathWithoutHost |
protected CodegenConfig |
config |
protected String |
contextPath |
protected CodegenIgnoreProcessor |
ignoreProcessor |
protected Boolean |
isGenerateApiDocumentation |
protected Boolean |
isGenerateApis |
protected Boolean |
isGenerateApiTests |
protected Boolean |
isGenerateModelDocumentation |
protected Boolean |
isGenerateModels |
protected Boolean |
isGenerateModelTests |
protected Boolean |
isGenerateSupportingFiles |
protected Boolean |
isGenerateSwaggerMetadata |
protected org.slf4j.Logger |
LOGGER |
protected ClientOptInput |
opts |
protected io.swagger.models.Swagger |
swagger |
Constructor and Description |
---|
DefaultGenerator() |
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
buildSupportFileBundle(List<Object> allOperations,
List<Object> allModels) |
protected void |
configureGeneratorProperties() |
protected void |
configureSwaggerInfo() |
List<File> |
generate() |
protected void |
generateApis(List<File> files,
List<Object> allOperations,
List<Object> allModels) |
protected void |
generateModelDocumentation(List<File> files,
Map<String,Object> models,
String modelName) |
protected void |
generateModels(List<File> files,
List<Object> allModels) |
protected void |
generateModelTests(List<File> files,
Map<String,Object> models,
String modelName) |
protected static String |
generateParameterId(io.swagger.models.parameters.Parameter parameter) |
protected void |
generateSupportingFiles(List<File> files,
Map<String,Object> bundle) |
protected Boolean |
getGeneratorPropertyDefaultSwitch(String key,
Boolean defaultValue) |
protected String |
getScheme() |
Generator |
opts(ClientOptInput opts) |
protected static void |
processMimeTypes(List<String> mimeTypeList,
Map<String,Object> operation,
String source) |
protected Map<String,Object> |
processModels(CodegenConfig config,
Map<String,io.swagger.models.Model> definitions,
Map<String,io.swagger.models.Model> allDefinitions) |
protected void |
processOperation(String resourcePath,
String httpMethod,
io.swagger.models.Operation operation,
Map<String,List<CodegenOperation>> operations,
io.swagger.models.Path path) |
protected Map<String,Object> |
processOperations(CodegenConfig config,
String tag,
List<CodegenOperation> ops,
List<Object> allModels) |
Map<String,List<CodegenOperation>> |
processPaths(Map<String,io.swagger.models.Path> paths) |
protected File |
processTemplateToFile(Map<String,Object> templateData,
String templateName,
String outputFilename) |
void |
setGenerateSwaggerMetadata(Boolean generateSwaggerMetadata)
Programmatically disable the output of .swagger-codegen/VERSION, .swagger-codegen-ignore,
or other metadata files used by Swagger Codegen.
|
void |
setGeneratorPropertyDefault(String key,
String value)
Set generator properties otherwise pulled from system properties.
|
embeddedTemplateExists, getCPResourcePath, getFullTemplateFile, getTemplateReader, readResourceContents, readTemplate, writeToFile
protected final org.slf4j.Logger LOGGER
protected CodegenConfig config
protected ClientOptInput opts
protected io.swagger.models.Swagger swagger
protected CodegenIgnoreProcessor ignoreProcessor
protected Boolean isGenerateApis
protected Boolean isGenerateModels
protected Boolean isGenerateSupportingFiles
protected Boolean isGenerateApiTests
protected Boolean isGenerateApiDocumentation
protected Boolean isGenerateModelTests
protected Boolean isGenerateModelDocumentation
protected Boolean isGenerateSwaggerMetadata
protected String basePath
protected String basePathWithoutHost
protected String contextPath
public Generator opts(ClientOptInput opts)
public void setGenerateSwaggerMetadata(Boolean generateSwaggerMetadata)
generateSwaggerMetadata
- true: enable outputs, false: disable outputspublic void setGeneratorPropertyDefault(String key, String value)
key
- The system property keyvalue
- The system property valueprotected Boolean getGeneratorPropertyDefaultSwitch(String key, Boolean defaultValue)
protected String getScheme()
protected void configureGeneratorProperties()
protected void configureSwaggerInfo()
protected void generateModelTests(List<File> files, Map<String,Object> models, String modelName) throws IOException
IOException
protected void generateModelDocumentation(List<File> files, Map<String,Object> models, String modelName) throws IOException
IOException
protected void generateApis(List<File> files, List<Object> allOperations, List<Object> allModels)
protected void generateSupportingFiles(List<File> files, Map<String,Object> bundle)
protected Map<String,Object> buildSupportFileBundle(List<Object> allOperations, List<Object> allModels)
protected File processTemplateToFile(Map<String,Object> templateData, String templateName, String outputFilename) throws IOException
IOException
protected static void processMimeTypes(List<String> mimeTypeList, Map<String,Object> operation, String source)
public Map<String,List<CodegenOperation>> processPaths(Map<String,io.swagger.models.Path> paths)
protected void processOperation(String resourcePath, String httpMethod, io.swagger.models.Operation operation, Map<String,List<CodegenOperation>> operations, io.swagger.models.Path path)
protected static String generateParameterId(io.swagger.models.parameters.Parameter parameter)
protected Map<String,Object> processOperations(CodegenConfig config, String tag, List<CodegenOperation> ops, List<Object> allModels)
Copyright © 2021. All rights reserved.