public abstract class DefaultCodegenConfig extends Object implements io.swagger.codegen.CodegenConfig
| Constructor and Description |
|---|
DefaultCodegenConfig()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAdditionPropertiesToCodeGenModel(io.swagger.codegen.CodegenModel codegenModel,
io.swagger.v3.oas.models.media.Schema schema) |
protected void |
addConsumesInfo(io.swagger.v3.oas.models.Operation operation,
io.swagger.codegen.CodegenOperation codegenOperation) |
void |
addHandlebarHelpers(com.github.jknack.handlebars.Handlebars handlebars) |
protected void |
addImport(io.swagger.codegen.CodegenModel m,
String type) |
Map<String,Object> |
additionalProperties() |
void |
addOperationToGroup(String tag,
String resourcePath,
io.swagger.v3.oas.models.Operation operation,
io.swagger.codegen.CodegenOperation co,
Map<String,List<io.swagger.codegen.CodegenOperation>> operations)
Add operation to group
|
protected void |
addProducesInfo(io.swagger.v3.oas.models.responses.ApiResponse response,
io.swagger.codegen.CodegenOperation codegenOperation) |
protected void |
addProperties(Map<String,io.swagger.v3.oas.models.media.Schema> properties,
List<String> required,
io.swagger.v3.oas.models.media.Schema schema,
Map<String,io.swagger.v3.oas.models.media.Schema> allSchemas) |
String |
addRegularExpressionDelimiter(String pattern)
If the pattern misses the delimiter, add "/" to the beginning and end
Otherwise, return the original pattern
|
String |
apiDocFileFolder() |
String |
apiDocFilename(String templateName,
String tag)
Return the full path and API documentation file
|
Map<String,String> |
apiDocTemplateFiles() |
String |
apiFileFolder() |
String |
apiFilename(String templateName,
String tag) |
String |
apiPackage() |
Map<String,String> |
apiTemplateFiles() |
String |
apiTestFileFolder() |
String |
apiTestFilename(String templateName,
String tag)
Return the full path and API test file
|
Map<String,String> |
apiTestTemplateFiles() |
protected io.swagger.codegen.CliOption |
buildLibraryCliOption(Map<String,String> supportedLibraries) |
static String |
camelize(String word)
Camelize name (parameter, property, method, etc) with upper case for first letter
copied from Twitter elephant bird
https://github.com/twitter/elephant-bird/blob/master/core/src/main/java/com/twitter/elephantbird/util/Strings.java
|
static String |
camelize(String word,
boolean lowercaseFirstLetter)
Camelize name (parameter, property, method, etc)
|
List<io.swagger.codegen.CliOption> |
cliOptions() |
boolean |
convertPropertyToBoolean(String propertyKey) |
boolean |
convertPropertyToBooleanAndWriteBack(String propertyKey)
reads propertyKey from additionalProperties, converts it to a boolean and
writes it back to additionalProperties to be usable as a boolean in
mustache files.
|
protected String |
dashize(String word)
Dashize the given word.
|
Set<String> |
defaultIncludes() |
protected io.swagger.v3.oas.models.media.Schema |
detectParent(io.swagger.v3.oas.models.media.ComposedSchema composedSchema,
Map<String,io.swagger.v3.oas.models.media.Schema> allSchemas) |
String |
embeddedTemplateDir() |
String |
escapeQuotationMark(String input)
Escape single and/or double quote to avoid code injection
|
String |
escapeReservedWord(String name)
Return the escaped name of the reserved word
|
String |
escapeText(String input) |
String |
escapeUnsafeCharacters(String input)
override with any special text escaping logic to handle unsafe
characters so as to avoid code injection
|
String |
fileSuffix() |
String |
findCommonPrefixOfVars(List<Object> vars)
Returns the common prefix of variables for enum naming
|
protected io.swagger.v3.oas.models.responses.ApiResponse |
findMethodResponse(io.swagger.v3.oas.models.responses.ApiResponses responses)
Override with any special handling of response codes
|
io.swagger.codegen.CodegenModel |
fromModel(String name,
io.swagger.v3.oas.models.media.Schema schema)
Convert Swagger Model object to Codegen Model object without providing all model definitions
|
io.swagger.codegen.CodegenModel |
fromModel(String name,
io.swagger.v3.oas.models.media.Schema schema,
Map<String,io.swagger.v3.oas.models.media.Schema> allDefinitions)
Convert Swagger Model object to Codegen Model object
|
io.swagger.codegen.CodegenOperation |
fromOperation(String path,
String httpMethod,
io.swagger.v3.oas.models.Operation operation,
Map<String,io.swagger.v3.oas.models.media.Schema> schemas)
Convert Swagger Operation object to Codegen Operation object (without providing a Swagger object)
|
io.swagger.codegen.CodegenOperation |
fromOperation(String path,
String httpMethod,
io.swagger.v3.oas.models.Operation operation,
Map<String,io.swagger.v3.oas.models.media.Schema> schemas,
io.swagger.v3.oas.models.OpenAPI openAPI)
Convert Swagger Operation object to Codegen Operation object
|
io.swagger.codegen.CodegenParameter |
fromParameter(io.swagger.v3.oas.models.parameters.Parameter parameter,
Set<String> imports)
Convert Swagger Parameter object to Codegen Parameter object
|
io.swagger.codegen.CodegenProperty |
fromProperty(String name,
io.swagger.v3.oas.models.media.Schema propertySchema)
Convert Swagger Property object to Codegen Property object
|
io.swagger.codegen.CodegenParameter |
fromRequestBody(io.swagger.v3.oas.models.parameters.RequestBody body,
Map<String,io.swagger.v3.oas.models.media.Schema> schemas,
Set<String> imports) |
io.swagger.codegen.CodegenResponse |
fromResponse(String responseCode,
io.swagger.v3.oas.models.responses.ApiResponse response)
Convert Swagger Response object to Codegen Response object
|
List<io.swagger.codegen.CodegenSecurity> |
fromSecurity(Map<String,io.swagger.v3.oas.models.security.SecurityScheme> securitySchemeMap)
Convert map of Swagger SecurityScheme objects to a list of Codegen Security objects
|
String |
generateExamplePath(String path,
io.swagger.v3.oas.models.Operation operation)
Return the example path
|
String |
getAlias(String name)
Determine the type alias for the given type if it exists.
|
protected String |
getCollectionFormat(io.swagger.v3.oas.models.parameters.Parameter parameter) |
String |
getCommonTemplateDir() |
protected Set<String> |
getConsumesInfo(io.swagger.v3.oas.models.Operation operation) |
protected String |
getContentType(io.swagger.v3.oas.models.parameters.RequestBody requestBody) |
String |
getGitRepoId()
Git repo ID
|
String |
getGitUserId()
Git user ID
|
String |
getHttpUserAgent()
HTTP user agent
|
String |
getIgnoreFilePathOverride()
Provides an override location, if any is specified, for the .swagger-codegen-ignore.
|
protected Map<String,Object> |
getInnerEnumAllowableValues(io.swagger.codegen.CodegenProperty property) |
String |
getInputSpec() |
String |
getLibrary()
Library template (sub-template).
|
protected String |
getOrGenerateOperationId(io.swagger.v3.oas.models.Operation operation,
String path,
String httpMethod)
Get operationId from the operation object, and if it's blank, generate a new one from the given parameters.
|
String |
getOutputDir() |
protected io.swagger.v3.oas.models.parameters.Parameter |
getParameterFromRef(String ref,
io.swagger.v3.oas.models.OpenAPI openAPI) |
protected String |
getParentName(io.swagger.v3.oas.models.media.ComposedSchema composedSchema,
Map<String,io.swagger.v3.oas.models.media.Schema> allSchemas) |
protected Set<String> |
getProducesInfo(io.swagger.v3.oas.models.Operation operation) |
String |
getReleaseNote()
Release note
|
protected io.swagger.v3.oas.models.media.Schema |
getSchemaFromBody(io.swagger.v3.oas.models.parameters.RequestBody requestBody) |
protected io.swagger.v3.oas.models.media.Schema |
getSchemaFromResponse(io.swagger.v3.oas.models.responses.ApiResponse response) |
String |
getSchemaType(io.swagger.v3.oas.models.media.Schema property)
returns the swagger type for the property
|
protected String |
getSimpleRef(String ref) |
protected String |
getSymbolName(String input)
Return the symbol name of a symbol
|
String |
getterAndSetterCapitalize(String name)
Camelize the method name of the getter and setter
|
String |
getTypeDeclaration(io.swagger.v3.oas.models.media.Schema schema)
Output the type declaration of the property
|
String |
getTypeDeclaration(String name)
Output the type declaration of a given name
|
Map<String,String> |
importMapping() |
String |
initialCaps(String name)
Capitalize the string
|
Map<String,String> |
instantiationTypes() |
boolean |
isDataTypeBinary(String dataType) |
boolean |
isDataTypeFile(String dataType) |
protected Boolean |
isPropertyInnerMostEnum(io.swagger.codegen.CodegenProperty property)
Update property for map container
|
boolean |
isRemoveOperationIdPrefix() |
protected boolean |
isReservedWord(String word) |
boolean |
isSkipOverwrite() |
Set<String> |
languageSpecificPrimitives() |
String |
modelDocFileFolder() |
Map<String,String> |
modelDocTemplateFiles() |
String |
modelFileFolder() |
String |
modelPackage() |
Map<String,String> |
modelTemplateFiles() |
String |
modelTestFileFolder() |
Map<String,String> |
modelTestTemplateFiles() |
protected boolean |
needToImport(String type)
Check the type to see if it needs import the library/module/package
|
String |
outputFolder() |
Map<String,Object> |
postProcessAllModels(Map<String,Object> processedModels) |
void |
postProcessModelProperty(io.swagger.codegen.CodegenModel model,
io.swagger.codegen.CodegenProperty property) |
Map<String,Object> |
postProcessModels(Map<String,Object> objs) |
Map<String,Object> |
postProcessModelsEnum(Map<String,Object> objs)
post process enum defined in model's properties
|
Map<String,Object> |
postProcessOperations(Map<String,Object> objs) |
Map<String,Object> |
postProcessOperationsWithModels(Map<String,Object> objs,
List<Object> allModels) |
void |
postProcessParameter(io.swagger.codegen.CodegenParameter parameter) |
Map<String,Object> |
postProcessSupportingFileData(Map<String,Object> objs) |
void |
preprocessOpenAPI(io.swagger.v3.oas.models.OpenAPI openAPI) |
com.samskivert.mustache.Mustache.Compiler |
processCompiler(com.samskivert.mustache.Mustache.Compiler compiler) |
void |
processModelEnums(Map<String,Object> objs) |
void |
processOpenAPI(io.swagger.v3.oas.models.OpenAPI openAPI) |
void |
processOpts() |
String |
removeNonNameElementToCamelCase(String name)
Remove characters not suitable for variable or method name from the input and camelize it
|
protected String |
removeNonNameElementToCamelCase(String name,
String nonNameElementPattern)
Remove characters that is not good to be included in method name from the input and camelize it
|
Set<String> |
reservedWords() |
Map<String,String> |
reservedWordsMappings() |
String |
sanitizeName(String name)
Sanitize name (parameter, property, method, etc)
|
String |
sanitizeTag(String tag)
Sanitize tag
|
void |
setAllowUnicodeIdentifiers(Boolean allowUnicodeIdentifiers) |
void |
setApiPackage(String apiPackage) |
void |
setCommonTemplateDir(String commonTemplateDir) |
void |
setEnsureUniqueParams(Boolean ensureUniqueParams) |
void |
setGitRepoId(String gitRepoId)
Set Git repo ID.
|
void |
setGitUserId(String gitUserId)
Set Git user ID.
|
void |
setHttpUserAgent(String httpUserAgent)
Set HTTP user agent.
|
void |
setIgnoreFilePathOverride(String ignoreFileOverride)
Sets an override location for the .swagger-codegen.ignore location for the first code generation.
|
void |
setInputSpec(String inputSpec) |
void |
setLibrary(String library)
Set library template (sub-template).
|
void |
setModelNamePrefix(String modelNamePrefix) |
void |
setModelNameSuffix(String modelNameSuffix) |
void |
setModelPackage(String modelPackage) |
protected void |
setNonArrayMapProperty(io.swagger.codegen.CodegenProperty property,
String type) |
void |
setOutputDir(String dir) |
void |
setParameterBooleanFlagWithCodegenProperty(io.swagger.codegen.CodegenParameter parameter,
io.swagger.codegen.CodegenProperty property)
Set CodegenParameter boolean flag using CodegenProperty.
|
void |
setParameterExampleValue(io.swagger.codegen.CodegenParameter p)
Return the example value of the parameter.
|
void |
setReleaseNote(String releaseNote)
Set release note.
|
void |
setRemoveOperationIdPrefix(boolean removeOperationIdPrefix) |
protected void |
setReservedWordsLowerCase(List<String> words) |
void |
setSkipOverwrite(boolean skipOverwrite) |
void |
setSortParamsByRequiredFlag(Boolean sortParamsByRequiredFlag) |
void |
setTemplateDir(String templateDir) |
boolean |
shouldOverwrite(String filename) |
String |
snakeCase(String name)
Return the snake-case of the string
|
Map<String,String> |
supportedLibraries()
All library languages supported.
|
List<io.swagger.codegen.SupportingFile> |
supportingFiles() |
String |
templateDir() |
String |
testPackage() |
String |
toApiDocFilename(String name)
Return the file name of the Api Documentation
|
String |
toApiFilename(String name)
Return the file name of the Api Test
|
String |
toApiImport(String name)
Return the fully-qualified "Api" name for import
|
String |
toApiName(String name)
Output the API (class) name (capitalized) ending with "Api"
Return DefaultApi if name is empty
|
String |
toApiTestFilename(String name)
Return the file name of the Api Test
|
String |
toApiVarName(String name)
Return the variable name in the Api
|
String |
toBooleanGetter(String name)
Output the Getter name for boolean property, e.g.
|
String |
toDefaultValue(io.swagger.v3.oas.models.media.Schema property)
Return the default value of the property
|
String |
toDefaultValueWithParam(String name,
io.swagger.v3.oas.models.media.Schema property)
Return the property initialized from a data object
Useful for initialization with a plain object in Javascript
|
String |
toEnumDefaultValue(String value,
String datatype)
Return the enum default value in the language specified format
|
String |
toEnumName(io.swagger.codegen.CodegenProperty property)
Return the Enum name (e.g.
|
String |
toEnumValue(String value,
String datatype)
Return the enum value in the language specified format
e.g.
|
String |
toEnumVarName(String value,
String datatype)
Return the sanitized variable name for enum
|
protected List<Map<String,Object>> |
toExamples(Map<String,Object> examples) |
String |
toExampleValue(io.swagger.v3.oas.models.media.Schema property)
Return the example value of the property
|
String |
toGetter(String name)
Output the Getter name, e.g.
|
String |
toInstantiationType(io.swagger.v3.oas.models.media.Schema property)
Return the instantiation type of the property, especially for map and array
|
String |
toModelDocFilename(String name)
Return the capitalized file name of the model documentation
|
String |
toModelFilename(String name)
Return the capitalized file name of the model
|
String |
toModelImport(String name)
Return the fully-qualified "Model" name for import
|
String |
toModelName(String name)
Output the proper model name (capitalized).
|
String |
toModelTestFilename(String name)
Return the capitalized file name of the model test
|
String |
toOperationId(String operationId)
Return the operation ID (method name)
|
String |
toParamName(String name)
Return the parameter name by removing invalid characters and proper escaping if
it's a reserved word.
|
String |
toRegularExpression(String pattern)
Return the regular expression/JSON schema pattern (http://json-schema.org/latest/json-schema-validation.html#anchor33)
|
String |
toSetter(String name)
Output the Getter name, e.g.
|
String |
toVarName(String name)
Return the variable name by removing invalid characters and proper escaping if
it's a reserved word.
|
Map<String,String> |
typeMapping() |
static String |
underscore(String word)
Underscore the given word.
|
void |
updateCodegenPropertyEnum(io.swagger.codegen.CodegenProperty var)
Update codegen property's enum by adding "enumVars" (with name and value)
|
protected void |
updateDataTypeWithEnumForArray(io.swagger.codegen.CodegenProperty property)
Update datatypeWithEnum for array container
|
protected void |
updateDataTypeWithEnumForMap(io.swagger.codegen.CodegenProperty property)
Update datatypeWithEnum for map container
|
protected void |
updatePropertyForArray(io.swagger.codegen.CodegenProperty property,
io.swagger.codegen.CodegenProperty innerProperty)
Update property for array(list) container
|
protected void |
updatePropertyForMap(io.swagger.codegen.CodegenProperty property,
io.swagger.codegen.CodegenProperty innerProperty)
Update property for map container
|
Map<String,Object> |
vendorExtensions() |
void |
writeOptional(String outputFolder,
io.swagger.codegen.SupportingFile supportingFile)
Only write if the file doesn't exist
|
void |
writePropertyBack(String propertyKey,
boolean value) |
protected static final org.slf4j.Logger LOGGER
public static final String DEFAULT_CONTENT_TYPE
public static final String REQUEST_BODY_NAME
protected String inputSpec
protected String outputFolder
protected String modelPackage
protected String apiPackage
protected String fileSuffix
protected String modelNamePrefix
protected String modelNameSuffix
protected String testPackage
protected String templateDir
protected String embeddedTemplateDir
protected String commonTemplateDir
protected List<io.swagger.codegen.SupportingFile> supportingFiles
protected List<io.swagger.codegen.CliOption> cliOptions
protected boolean skipOverwrite
protected boolean removeOperationIdPrefix
protected boolean supportsInheritance
protected boolean supportsMixins
protected String library
protected Boolean sortParamsByRequiredFlag
protected Boolean ensureUniqueParams
protected Boolean allowUnicodeIdentifiers
protected String gitUserId
protected String gitRepoId
protected String releaseNote
protected String httpUserAgent
protected Boolean hideGenerationTimestamp
protected String ignoreFilePathOverride
public DefaultCodegenConfig()
public List<io.swagger.codegen.CliOption> cliOptions()
cliOptions in interface io.swagger.codegen.CodegenConfigpublic void processOpts()
processOpts in interface io.swagger.codegen.CodegenConfigpublic Map<String,Object> postProcessAllModels(Map<String,Object> processedModels)
postProcessAllModels in interface io.swagger.codegen.CodegenConfigpublic Map<String,Object> postProcessModels(Map<String,Object> objs)
postProcessModels in interface io.swagger.codegen.CodegenConfigpublic Map<String,Object> postProcessModelsEnum(Map<String,Object> objs)
objs - Map of modelspublic String findCommonPrefixOfVars(List<Object> vars)
vars - List of variable namespublic String toEnumDefaultValue(String value, String datatype)
value - enum variable namedatatype - data typepublic String toEnumValue(String value, String datatype)
value - enum variable namedatatype - data typepublic String toEnumVarName(String value, String datatype)
value - enum variable namedatatype - data typepublic Map<String,Object> postProcessOperations(Map<String,Object> objs)
postProcessOperations in interface io.swagger.codegen.CodegenConfigpublic Map<String,Object> postProcessOperationsWithModels(Map<String,Object> objs, List<Object> allModels)
postProcessOperationsWithModels in interface io.swagger.codegen.CodegenConfigpublic Map<String,Object> postProcessSupportingFileData(Map<String,Object> objs)
postProcessSupportingFileData in interface io.swagger.codegen.CodegenConfigpublic void postProcessModelProperty(io.swagger.codegen.CodegenModel model,
io.swagger.codegen.CodegenProperty property)
postProcessModelProperty in interface io.swagger.codegen.CodegenConfigpublic void postProcessParameter(io.swagger.codegen.CodegenParameter parameter)
postProcessParameter in interface io.swagger.codegen.CodegenConfigpublic void preprocessOpenAPI(io.swagger.v3.oas.models.OpenAPI openAPI)
preprocessOpenAPI in interface io.swagger.codegen.CodegenConfigpublic void processOpenAPI(io.swagger.v3.oas.models.OpenAPI openAPI)
processOpenAPI in interface io.swagger.codegen.CodegenConfigpublic com.samskivert.mustache.Mustache.Compiler processCompiler(com.samskivert.mustache.Mustache.Compiler compiler)
processCompiler in interface io.swagger.codegen.CodegenConfigpublic String escapeText(String input)
escapeText in interface io.swagger.codegen.CodegenConfigpublic String escapeUnsafeCharacters(String input)
escapeUnsafeCharacters in interface io.swagger.codegen.CodegenConfiginput - String to be cleaned uppublic String escapeQuotationMark(String input)
escapeQuotationMark in interface io.swagger.codegen.CodegenConfiginput - String to be cleaned uppublic Set<String> defaultIncludes()
defaultIncludes in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> typeMapping()
typeMapping in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> instantiationTypes()
instantiationTypes in interface io.swagger.codegen.CodegenConfigpublic Set<String> reservedWords()
reservedWords in interface io.swagger.codegen.CodegenConfigpublic Set<String> languageSpecificPrimitives()
languageSpecificPrimitives in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> importMapping()
importMapping in interface io.swagger.codegen.CodegenConfigpublic String testPackage()
testPackage in interface io.swagger.codegen.CodegenConfigpublic String modelPackage()
modelPackage in interface io.swagger.codegen.CodegenConfigpublic String apiPackage()
apiPackage in interface io.swagger.codegen.CodegenConfigpublic String fileSuffix()
fileSuffix in interface io.swagger.codegen.CodegenConfigpublic String templateDir()
templateDir in interface io.swagger.codegen.CodegenConfigpublic String embeddedTemplateDir()
embeddedTemplateDir in interface io.swagger.codegen.CodegenConfigpublic String getCommonTemplateDir()
getCommonTemplateDir in interface io.swagger.codegen.CodegenConfigpublic void setCommonTemplateDir(String commonTemplateDir)
public Map<String,String> apiDocTemplateFiles()
apiDocTemplateFiles in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> modelDocTemplateFiles()
modelDocTemplateFiles in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> reservedWordsMappings()
reservedWordsMappings in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> apiTestTemplateFiles()
apiTestTemplateFiles in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> modelTestTemplateFiles()
modelTestTemplateFiles in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> apiTemplateFiles()
apiTemplateFiles in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> modelTemplateFiles()
modelTemplateFiles in interface io.swagger.codegen.CodegenConfigpublic String apiFileFolder()
apiFileFolder in interface io.swagger.codegen.CodegenConfigpublic String modelFileFolder()
modelFileFolder in interface io.swagger.codegen.CodegenConfigpublic String apiTestFileFolder()
apiTestFileFolder in interface io.swagger.codegen.CodegenConfigpublic String modelTestFileFolder()
modelTestFileFolder in interface io.swagger.codegen.CodegenConfigpublic String apiDocFileFolder()
apiDocFileFolder in interface io.swagger.codegen.CodegenConfigpublic String modelDocFileFolder()
modelDocFileFolder in interface io.swagger.codegen.CodegenConfigpublic Map<String,Object> additionalProperties()
additionalProperties in interface io.swagger.codegen.CodegenConfigpublic Map<String,Object> vendorExtensions()
vendorExtensions in interface io.swagger.codegen.CodegenConfigpublic List<io.swagger.codegen.SupportingFile> supportingFiles()
supportingFiles in interface io.swagger.codegen.CodegenConfigpublic String outputFolder()
outputFolder in interface io.swagger.codegen.CodegenConfigpublic void setOutputDir(String dir)
setOutputDir in interface io.swagger.codegen.CodegenConfigpublic String getOutputDir()
getOutputDir in interface io.swagger.codegen.CodegenConfigpublic String getInputSpec()
getInputSpec in interface io.swagger.codegen.CodegenConfigpublic void setInputSpec(String inputSpec)
setInputSpec in interface io.swagger.codegen.CodegenConfigpublic void setTemplateDir(String templateDir)
public void setModelPackage(String modelPackage)
public void setModelNamePrefix(String modelNamePrefix)
public void setModelNameSuffix(String modelNameSuffix)
public void setApiPackage(String apiPackage)
public void setSortParamsByRequiredFlag(Boolean sortParamsByRequiredFlag)
public void setEnsureUniqueParams(Boolean ensureUniqueParams)
public void setAllowUnicodeIdentifiers(Boolean allowUnicodeIdentifiers)
public String toRegularExpression(String pattern)
pattern - the pattern (regular expression)public String toApiFilename(String name)
toApiFilename in interface io.swagger.codegen.CodegenConfigname - the file name of the Apipublic String toApiDocFilename(String name)
toApiDocFilename in interface io.swagger.codegen.CodegenConfigname - the file name of the Apipublic String toApiTestFilename(String name)
toApiTestFilename in interface io.swagger.codegen.CodegenConfigname - the file name of the Apipublic String toApiVarName(String name)
toApiVarName in interface io.swagger.codegen.CodegenConfigname - the varible name of the Apipublic String toModelFilename(String name)
toModelFilename in interface io.swagger.codegen.CodegenConfigname - the model namepublic String toModelTestFilename(String name)
toModelTestFilename in interface io.swagger.codegen.CodegenConfigname - the model namepublic String toModelDocFilename(String name)
toModelDocFilename in interface io.swagger.codegen.CodegenConfigname - the model namepublic String toOperationId(String operationId)
operationId - operation IDpublic String toVarName(String name)
name - the variable namepublic String toParamName(String name)
toParamName in interface io.swagger.codegen.CodegenConfigname - Codegen property objectpublic String toEnumName(io.swagger.codegen.CodegenProperty property)
property - Codegen propertypublic String escapeReservedWord(String name)
escapeReservedWord in interface io.swagger.codegen.CodegenConfigname - the name to be escapedpublic String toModelImport(String name)
toModelImport in interface io.swagger.codegen.CodegenConfigname - the name of the "Model"public String toApiImport(String name)
toApiImport in interface io.swagger.codegen.CodegenConfigname - the name of the "Api"protected String getSymbolName(String input)
input - Symbol (e.g. $)public String generateExamplePath(String path, io.swagger.v3.oas.models.Operation operation)
generateExamplePath in interface io.swagger.codegen.CodegenConfigpath - the path of the operationoperation - Swagger operation objectpublic String toInstantiationType(io.swagger.v3.oas.models.media.Schema property)
property - Swagger property objectpublic void setParameterExampleValue(io.swagger.codegen.CodegenParameter p)
p - Swagger property objectpublic String toExampleValue(io.swagger.v3.oas.models.media.Schema property)
property - Schema property objectpublic String toDefaultValue(io.swagger.v3.oas.models.media.Schema property)
property - Schema property objectpublic String toDefaultValueWithParam(String name, io.swagger.v3.oas.models.media.Schema property)
name - Name of the property objectproperty - openAPI schema objectpublic String getSchemaType(io.swagger.v3.oas.models.media.Schema property)
property - Schema property objectpublic String snakeCase(String name)
name - string to be snake-casedpublic String initialCaps(String name)
name - string to be capitalizedpublic String getTypeDeclaration(String name)
getTypeDeclaration in interface io.swagger.codegen.CodegenConfigname - namepublic String getTypeDeclaration(io.swagger.v3.oas.models.media.Schema schema)
getTypeDeclaration in interface io.swagger.codegen.CodegenConfigschema - Schema Property objectpublic String getAlias(String name)
name - The type name.public String toBooleanGetter(String name)
toBooleanGetter in interface io.swagger.codegen.CodegenConfigname - the name of the propertypublic String toGetter(String name)
toGetter in interface io.swagger.codegen.CodegenConfigname - the name of the propertypublic String toSetter(String name)
toSetter in interface io.swagger.codegen.CodegenConfigname - the name of the propertypublic String toApiName(String name)
toApiName in interface io.swagger.codegen.CodegenConfigname - the name of the Apipublic String toModelName(String name)
toModelName in interface io.swagger.codegen.CodegenConfigname - the name of the modelpublic io.swagger.codegen.CodegenModel fromModel(String name, io.swagger.v3.oas.models.media.Schema schema)
fromModel in interface io.swagger.codegen.CodegenConfigname - the name of the modelschema - Schema objectpublic io.swagger.codegen.CodegenModel fromModel(String name, io.swagger.v3.oas.models.media.Schema schema, Map<String,io.swagger.v3.oas.models.media.Schema> allDefinitions)
fromModel in interface io.swagger.codegen.CodegenConfigname - the name of the modelschema - Swagger Model objectallDefinitions - a map of all Swagger models from the specprotected void addAdditionPropertiesToCodeGenModel(io.swagger.codegen.CodegenModel codegenModel,
io.swagger.v3.oas.models.media.Schema schema)
protected void addProperties(Map<String,io.swagger.v3.oas.models.media.Schema> properties, List<String> required, io.swagger.v3.oas.models.media.Schema schema, Map<String,io.swagger.v3.oas.models.media.Schema> allSchemas)
public String getterAndSetterCapitalize(String name)
name - string to be camelizedpublic io.swagger.codegen.CodegenProperty fromProperty(String name, io.swagger.v3.oas.models.media.Schema propertySchema)
name - name of the propertypropertySchema - Schema objectprotected void updatePropertyForArray(io.swagger.codegen.CodegenProperty property,
io.swagger.codegen.CodegenProperty innerProperty)
property - Codegen propertyinnerProperty - Codegen inner property of map or listprotected void updatePropertyForMap(io.swagger.codegen.CodegenProperty property,
io.swagger.codegen.CodegenProperty innerProperty)
property - Codegen propertyinnerProperty - Codegen inner property of map or listprotected Boolean isPropertyInnerMostEnum(io.swagger.codegen.CodegenProperty property)
property - Codegen propertyprotected Map<String,Object> getInnerEnumAllowableValues(io.swagger.codegen.CodegenProperty property)
protected void updateDataTypeWithEnumForArray(io.swagger.codegen.CodegenProperty property)
property - Codegen propertyprotected void updateDataTypeWithEnumForMap(io.swagger.codegen.CodegenProperty property)
property - Codegen propertyprotected void setNonArrayMapProperty(io.swagger.codegen.CodegenProperty property,
String type)
protected io.swagger.v3.oas.models.responses.ApiResponse findMethodResponse(io.swagger.v3.oas.models.responses.ApiResponses responses)
responses - Swagger Operation's responsespublic io.swagger.codegen.CodegenOperation fromOperation(String path, String httpMethod, io.swagger.v3.oas.models.Operation operation, Map<String,io.swagger.v3.oas.models.media.Schema> schemas)
fromOperation in interface io.swagger.codegen.CodegenConfigpath - the path of the operationhttpMethod - HTTP methodoperation - Swagger operation objectschemas - a map of Swagger modelspublic io.swagger.codegen.CodegenOperation fromOperation(String path, String httpMethod, io.swagger.v3.oas.models.Operation operation, Map<String,io.swagger.v3.oas.models.media.Schema> schemas, io.swagger.v3.oas.models.OpenAPI openAPI)
fromOperation in interface io.swagger.codegen.CodegenConfigpath - the path of the operationhttpMethod - HTTP methodoperation - Swagger operation objectschemas - a map of schemasopenAPI - a OpenAPI object representing the specpublic io.swagger.codegen.CodegenResponse fromResponse(String responseCode, io.swagger.v3.oas.models.responses.ApiResponse response)
responseCode - HTTP response coderesponse - Swagger Response objectpublic io.swagger.codegen.CodegenParameter fromParameter(io.swagger.v3.oas.models.parameters.Parameter parameter,
Set<String> imports)
parameter - Swagger parameter objectimports - set of imports for library/package/modulepublic io.swagger.codegen.CodegenParameter fromRequestBody(io.swagger.v3.oas.models.parameters.RequestBody body,
Map<String,io.swagger.v3.oas.models.media.Schema> schemas,
Set<String> imports)
public boolean isDataTypeBinary(String dataType)
public boolean isDataTypeFile(String dataType)
public List<io.swagger.codegen.CodegenSecurity> fromSecurity(Map<String,io.swagger.v3.oas.models.security.SecurityScheme> securitySchemeMap)
fromSecurity in interface io.swagger.codegen.CodegenConfigsecuritySchemeMap - a map of Swagger SecuritySchemeDefinition objectprotected boolean isReservedWord(String word)
protected String getOrGenerateOperationId(io.swagger.v3.oas.models.Operation operation, String path, String httpMethod)
operation - the operation objectpath - the path of the operationhttpMethod - the HTTP method of the operationprotected boolean needToImport(String type)
type - name of the typepublic void addOperationToGroup(String tag, String resourcePath, io.swagger.v3.oas.models.Operation operation, io.swagger.codegen.CodegenOperation co, Map<String,List<io.swagger.codegen.CodegenOperation>> operations)
addOperationToGroup in interface io.swagger.codegen.CodegenConfigtag - name of the tagresourcePath - path of the resourceoperation - Swagger Operation objectco - Codegen Operation objectoperations - map of Codegen operationspublic static String underscore(String word)
word - The wordprotected String dashize(String word)
word - The wordprotected void addImport(io.swagger.codegen.CodegenModel m,
String type)
public String removeNonNameElementToCamelCase(String name)
name - string to be camelizeprotected String removeNonNameElementToCamelCase(String name, String nonNameElementPattern)
name - string to be camelizenonNameElementPattern - a regex pattern of the characters that is not good to be included in namepublic static String camelize(String word)
word - string to be camelizepublic static String camelize(String word, boolean lowercaseFirstLetter)
word - string to be camelizelowercaseFirstLetter - lower case for first letter if set to truepublic String apiFilename(String templateName, String tag)
apiFilename in interface io.swagger.codegen.CodegenConfigpublic String apiDocFilename(String templateName, String tag)
apiDocFilename in interface io.swagger.codegen.CodegenConfigtemplateName - template nametag - tagpublic String apiTestFilename(String templateName, String tag)
apiTestFilename in interface io.swagger.codegen.CodegenConfigtemplateName - template nametag - tagpublic boolean shouldOverwrite(String filename)
shouldOverwrite in interface io.swagger.codegen.CodegenConfigpublic boolean isSkipOverwrite()
isSkipOverwrite in interface io.swagger.codegen.CodegenConfigpublic void setSkipOverwrite(boolean skipOverwrite)
setSkipOverwrite in interface io.swagger.codegen.CodegenConfigpublic boolean isRemoveOperationIdPrefix()
isRemoveOperationIdPrefix in interface io.swagger.codegen.CodegenConfigpublic void setRemoveOperationIdPrefix(boolean removeOperationIdPrefix)
setRemoveOperationIdPrefix in interface io.swagger.codegen.CodegenConfigpublic Map<String,String> supportedLibraries()
supportedLibraries in interface io.swagger.codegen.CodegenConfigpublic void setLibrary(String library)
setLibrary in interface io.swagger.codegen.CodegenConfiglibrary - Library templatepublic String getLibrary()
getLibrary in interface io.swagger.codegen.CodegenConfigpublic void setGitUserId(String gitUserId)
setGitUserId in interface io.swagger.codegen.CodegenConfiggitUserId - Git user IDpublic String getGitUserId()
getGitUserId in interface io.swagger.codegen.CodegenConfigpublic void setGitRepoId(String gitRepoId)
setGitRepoId in interface io.swagger.codegen.CodegenConfiggitRepoId - Git repo IDpublic String getGitRepoId()
getGitRepoId in interface io.swagger.codegen.CodegenConfigpublic void setReleaseNote(String releaseNote)
setReleaseNote in interface io.swagger.codegen.CodegenConfigreleaseNote - Release notepublic String getReleaseNote()
getReleaseNote in interface io.swagger.codegen.CodegenConfigpublic void setHttpUserAgent(String httpUserAgent)
setHttpUserAgent in interface io.swagger.codegen.CodegenConfighttpUserAgent - HTTP user agentpublic String getHttpUserAgent()
getHttpUserAgent in interface io.swagger.codegen.CodegenConfigprotected io.swagger.codegen.CliOption buildLibraryCliOption(Map<String,String> supportedLibraries)
public String sanitizeName(String name)
name - string to be sanitizepublic String sanitizeTag(String tag)
sanitizeTag in interface io.swagger.codegen.CodegenConfigtag - Tagpublic void addHandlebarHelpers(com.github.jknack.handlebars.Handlebars handlebars)
addHandlebarHelpers in interface io.swagger.codegen.CodegenConfigpublic void writeOptional(String outputFolder, io.swagger.codegen.SupportingFile supportingFile)
outputFolder - Output foldersupportingFile - Supporting filepublic void setParameterBooleanFlagWithCodegenProperty(io.swagger.codegen.CodegenParameter parameter,
io.swagger.codegen.CodegenProperty property)
parameter - Codegen Parameterproperty - Codegen propertypublic void updateCodegenPropertyEnum(io.swagger.codegen.CodegenProperty var)
var - list of CodegenPropertypublic String addRegularExpressionDelimiter(String pattern)
pattern - the pattern (regular expression)public boolean convertPropertyToBooleanAndWriteBack(String propertyKey)
propertyKey - property keypublic String getIgnoreFilePathOverride()
getIgnoreFilePathOverride in interface io.swagger.codegen.CodegenConfigpublic void setIgnoreFilePathOverride(String ignoreFileOverride)
setIgnoreFilePathOverride in interface io.swagger.codegen.CodegenConfigignoreFileOverride - The full path to an ignore filepublic boolean convertPropertyToBoolean(String propertyKey)
public void writePropertyBack(String propertyKey, boolean value)
protected String getContentType(io.swagger.v3.oas.models.parameters.RequestBody requestBody)
protected io.swagger.v3.oas.models.media.Schema getSchemaFromBody(io.swagger.v3.oas.models.parameters.RequestBody requestBody)
protected io.swagger.v3.oas.models.media.Schema getSchemaFromResponse(io.swagger.v3.oas.models.responses.ApiResponse response)
protected io.swagger.v3.oas.models.parameters.Parameter getParameterFromRef(String ref, io.swagger.v3.oas.models.OpenAPI openAPI)
protected void addConsumesInfo(io.swagger.v3.oas.models.Operation operation,
io.swagger.codegen.CodegenOperation codegenOperation)
protected void addProducesInfo(io.swagger.v3.oas.models.responses.ApiResponse response,
io.swagger.codegen.CodegenOperation codegenOperation)
protected io.swagger.v3.oas.models.media.Schema detectParent(io.swagger.v3.oas.models.media.ComposedSchema composedSchema,
Map<String,io.swagger.v3.oas.models.media.Schema> allSchemas)
protected String getParentName(io.swagger.v3.oas.models.media.ComposedSchema composedSchema, Map<String,io.swagger.v3.oas.models.media.Schema> allSchemas)
protected String getCollectionFormat(io.swagger.v3.oas.models.parameters.Parameter parameter)
Copyright © 2018. All rights reserved.