public class SwiftCodegen extends DefaultCodegen implements CodegenConfig
Modifier and Type | Field and Description |
---|---|
protected static String |
LIBRARY_PROMISE_KIT |
static String |
POD_AUTHORS |
static String |
POD_DESCRIPTION |
static String |
POD_DOCSET_URL |
static String |
POD_DOCUMENTATION_URL |
static String |
POD_HOMEPAGE |
static String |
POD_LICENSE |
static String |
POD_SCREENSHOTS |
static String |
POD_SOCIAL_MEDIA_URL |
static String |
POD_SOURCE |
static String |
POD_SUMMARY |
static String |
PROJECT_NAME |
protected String |
projectName |
static String |
RESPONSE_AS |
protected static String[] |
RESPONSE_LIBRARIES |
protected String[] |
responseAs |
protected String |
sourceFolder |
static String |
UNWRAP_REQUIRED |
protected boolean |
unwrapRequired |
additionalProperties, apiPackage, apiTemplateFiles, cliOptions, defaultIncludes, embeddedTemplateDir, ensureUniqueParams, fileSuffix, importMapping, instantiationTypes, languageSpecificPrimitives, library, LOGGER, modelPackage, modelTemplateFiles, outputFolder, reservedWords, skipOverwrite, sortParamsByRequiredFlag, supportedLibraries, supportingFiles, supportsInheritance, templateDir, typeMapping
Constructor and Description |
---|
SwiftCodegen() |
Modifier and Type | Method and Description |
---|---|
String |
apiFileFolder() |
String |
escapeReservedWord(String name)
Return the escaped name of the reserved word
|
CodegenOperation |
fromOperation(String path,
String httpMethod,
io.swagger.models.Operation operation,
Map<String,io.swagger.models.Model> definitions,
io.swagger.models.Swagger swagger)
Convert Swagger Operation object to Codegen Operation object
|
CodegenProperty |
fromProperty(String name,
io.swagger.models.properties.Property p)
Convert Swagger Property object to Codegen Property object
|
String |
getHelp() |
String |
getName() |
String |
getSwaggerType(io.swagger.models.properties.Property p)
returns the swagger type for the property
|
CodegenType |
getTag() |
String |
getTypeDeclaration(io.swagger.models.properties.Property p)
Output the type declaration of the property
|
String |
modelFileFolder() |
void |
processOpts() |
void |
setProjectName(String projectName) |
void |
setResponseAs(String[] responseAs) |
void |
setUnwrapRequired(boolean unwrapRequired) |
String |
toApiName(String name)
Output the API (class) name (capitalized) ending with "Api"
Return DefaultApi if name is empty
|
String |
toDefaultValue(io.swagger.models.properties.Property p)
Return the default value of the property
|
String |
toInstantiationType(io.swagger.models.properties.Property p)
Return the instantiation type of the property, especially for map and array
|
String |
toSwiftyEnumName(String value) |
additionalProperties, addOperationToGroup, apiFilename, apiPackage, apiTemplateFiles, buildLibraryCliOption, camelize, camelize, cliOptions, dashize, defaultIncludes, embeddedTemplateDir, escapeText, fileSuffix, fromModel, fromModel, fromOperation, fromParameter, fromResponse, fromSecurity, generateExamplePath, getLibrary, getOrGenerateOperationId, getOutputDir, getterAndSetterCapitalize, getTypeDeclaration, importMapping, initialCaps, instantiationTypes, isSkipOverwrite, languageSpecificPrimitives, modelPackage, modelTemplateFiles, needToImport, outputFolder, postProcessModelProperty, postProcessModels, postProcessOperations, postProcessParameter, postProcessSupportingFileData, preprocessSwagger, processSwagger, removeNonNameElementToCamelCase, reservedWords, sanitizeName, setApiPackage, setEnsureUniqueParams, setLibrary, setModelPackage, setNonArrayMapProperty, setOutputDir, setSkipOverwrite, setSortParamsByRequiredFlag, setTemplateDir, shouldOverwrite, snakeCase, supportedLibraries, supportingFiles, templateDir, toApiFilename, toApiImport, toApiVarName, toDefaultValueWithParam, toEnumName, toExamples, toModelFilename, toModelImport, toModelName, toOperationId, toParamName, toVarName, typeMapping, underscore
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
additionalProperties, addOperationToGroup, apiFilename, apiPackage, apiTemplateFiles, cliOptions, defaultIncludes, embeddedTemplateDir, escapeText, fileSuffix, fromModel, fromModel, fromOperation, fromSecurity, generateExamplePath, getLibrary, getOutputDir, getTypeDeclaration, importMapping, instantiationTypes, isSkipOverwrite, languageSpecificPrimitives, modelPackage, modelTemplateFiles, outputFolder, postProcessModelProperty, postProcessModels, postProcessOperations, postProcessParameter, postProcessSupportingFileData, preprocessSwagger, processSwagger, reservedWords, setLibrary, setOutputDir, setSkipOverwrite, shouldOverwrite, supportedLibraries, supportingFiles, templateDir, toApiFilename, toApiImport, toApiVarName, toModelFilename, toModelImport, toModelName, toParamName, typeMapping
public static final String PROJECT_NAME
public static final String RESPONSE_AS
public static final String UNWRAP_REQUIRED
public static final String POD_SOURCE
public static final String POD_AUTHORS
public static final String POD_SOCIAL_MEDIA_URL
public static final String POD_DOCSET_URL
public static final String POD_LICENSE
public static final String POD_HOMEPAGE
public static final String POD_SUMMARY
public static final String POD_DESCRIPTION
public static final String POD_SCREENSHOTS
public static final String POD_DOCUMENTATION_URL
protected static final String LIBRARY_PROMISE_KIT
protected static final String[] RESPONSE_LIBRARIES
protected String projectName
protected boolean unwrapRequired
protected String[] responseAs
protected String sourceFolder
public CodegenType getTag()
getTag
in interface CodegenConfig
public String getName()
getName
in interface CodegenConfig
public String getHelp()
getHelp
in interface CodegenConfig
public void processOpts()
processOpts
in interface CodegenConfig
processOpts
in class DefaultCodegen
public String escapeReservedWord(String name)
DefaultCodegen
escapeReservedWord
in interface CodegenConfig
escapeReservedWord
in class DefaultCodegen
name
- the name to be escapedpublic String modelFileFolder()
modelFileFolder
in interface CodegenConfig
modelFileFolder
in class DefaultCodegen
public String apiFileFolder()
apiFileFolder
in interface CodegenConfig
apiFileFolder
in class DefaultCodegen
public String getTypeDeclaration(io.swagger.models.properties.Property p)
DefaultCodegen
getTypeDeclaration
in interface CodegenConfig
getTypeDeclaration
in class DefaultCodegen
p
- Swagger Property objectpublic String getSwaggerType(io.swagger.models.properties.Property p)
DefaultCodegen
getSwaggerType
in class DefaultCodegen
p
- Swagger property objectpublic String toDefaultValue(io.swagger.models.properties.Property p)
DefaultCodegen
toDefaultValue
in class DefaultCodegen
p
- Swagger property objectpublic String toInstantiationType(io.swagger.models.properties.Property p)
DefaultCodegen
toInstantiationType
in class DefaultCodegen
p
- Swagger property objectpublic CodegenProperty fromProperty(String name, io.swagger.models.properties.Property p)
DefaultCodegen
fromProperty
in class DefaultCodegen
name
- name of the propertyp
- Swagger property objectpublic String toApiName(String name)
DefaultCodegen
toApiName
in interface CodegenConfig
toApiName
in class DefaultCodegen
name
- the name of the Apipublic CodegenOperation fromOperation(String path, String httpMethod, io.swagger.models.Operation operation, Map<String,io.swagger.models.Model> definitions, io.swagger.models.Swagger swagger)
DefaultCodegen
fromOperation
in interface CodegenConfig
fromOperation
in class DefaultCodegen
path
- the path of the operationhttpMethod
- HTTP methodoperation
- Swagger operation objectdefinitions
- a map of Swagger modelsswagger
- a Swagger object representing the specpublic void setProjectName(String projectName)
public void setUnwrapRequired(boolean unwrapRequired)
public void setResponseAs(String[] responseAs)
Copyright © 2016. All rights reserved.