public abstract class AbstractSwiftCodegen extends DefaultCodegenConfig
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_POD_AUTHORS |
static String |
LENIENT_TYPE_CAST |
protected static String |
MODEL_CLASSES |
static String |
OBJC_COMPATIBLE |
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 |
static String |
RESPONSE_AS |
protected static String[] |
RESPONSE_LIBRARIES |
protected String |
sourceFolder |
static String |
SWIFT_USE_API_NAMESPACE |
static String |
UNWRAP_REQUIRED |
protected static String |
USE_MODEL_CLASSES |
additionalProperties, allowUnicodeIdentifiers, apiDocTemplateFiles, apiPackage, apiTemplateFiles, apiTestTemplateFiles, cliOptions, commonTemplateDir, copyFistAllOfProperties, customTemplateDir, DEFAULT_CONTENT_TYPE, DEFAULT_TEMPLATE_DIR, defaultIncludes, embeddedTemplateDir, ensureUniqueParams, fileSuffix, gitRepoBaseURL, gitRepoId, gitUserId, hideGenerationTimestamp, httpUserAgent, ignoreFilePathOverride, ignoreImportMapping, importMapping, inputSpec, inputURL, instantiationTypes, languageArguments, languageSpecificPrimitives, library, modelDocTemplateFiles, modelNamePrefix, modelNameSuffix, modelPackage, modelTemplateFiles, modelTestTemplateFiles, openAPI, outputFolder, releaseNote, removeOperationIdPrefix, REQUEST_BODY_NAME, reservedWords, reservedWordsMappings, skipOverwrite, sortParamsByRequiredFlag, specialCharReplacements, supportedLibraries, supportingFiles, supportsInheritance, supportsMixins, templateDir, templateEngine, templateVersion, testPackage, typeAliases, typeMapping, unflattenedOpenAPI, useOas2, vendorExtensions| Constructor and Description |
|---|
AbstractSwiftCodegen() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAdditionPropertiesToCodeGenModel(io.swagger.codegen.v3.CodegenModel codegenModel,
io.swagger.v3.oas.models.media.Schema schema) |
String |
apiFileFolder() |
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 |
escapeUnsafeCharacters(String input)
override with any special text escaping logic to handle unsafe
characters so as to avoid code injection
|
io.swagger.codegen.v3.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
|
String |
getArgumentsLocation() |
String |
getDefaultTemplateDir() |
String |
getHelp() |
String |
getSchemaType(io.swagger.v3.oas.models.media.Schema schema)
returns the swagger type for the property
|
io.swagger.codegen.v3.CodegenType |
getTag() |
String |
getTypeDeclaration(io.swagger.v3.oas.models.media.Schema propertySchema)
Output the type declaration of the property
|
boolean |
isDataTypeBinary(String dataType) |
boolean |
isDataTypeFile(String dataType) |
protected boolean |
isReservedWord(String word) |
String |
modelFileFolder() |
void |
postProcessModelProperty(io.swagger.codegen.v3.CodegenModel model,
io.swagger.codegen.v3.CodegenProperty property) |
void |
processOpts() |
void |
setLenientTypeCast(boolean lenientTypeCast) |
void |
setObjcCompatible(boolean objcCompatible) |
void |
setProjectName(String projectName) |
void |
setResponseAs(String[] responseAs) |
void |
setSwiftUseApiNamespace(boolean swiftUseApiNamespace) |
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.v3.oas.models.media.Schema schema)
Return the default value of the property
|
String |
toEnumDefaultValue(String value,
String datatype)
Return the enum default value in the language specified format
|
String |
toEnumName(io.swagger.codegen.v3.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 name,
String datatype)
Return the sanitized variable name for enum
|
String |
toInstantiationType(io.swagger.v3.oas.models.media.Schema schema)
Return the instantiation type of the property, especially for map and array
|
String |
toModelFilename(String name)
Return the capitalized file name of the model.
|
String |
toModelName(String name)
Output the proper model name (capitalized).
|
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 |
toVarName(String name)
Return the variable name by removing invalid characters and proper escaping if
it's a reserved word.
|
addCodegenContentParameters, addConsumesInfo, addHandlebarHelpers, addImport, additionalProperties, addOperationImports, addOperationToGroup, addOption, addOption, addParameters, addParentContainer, addProducesInfo, addProperties, addRegularExpressionDelimiter, addSwitch, addVars, apiDocFileFolder, apiDocFilename, apiDocTemplateFiles, apiFilename, apiPackage, apiTemplateFiles, apiTestFileFolder, apiTestFilename, apiTestTemplateFiles, buildLibraryCliOption, camelize, camelize, cliOptions, configureDataForTestTemplate, configuresParameterForMediaType, convertPropertyToBoolean, convertPropertyToBooleanAndWriteBack, customTemplateDir, dashize, defaultIgnoreImportMappingOption, defaultIncludes, detectParent, embeddedTemplateDir, ensureUniqueParameters, escapeText, fileSuffix, findCommonPrefixOfVars, findMethodResponse, fixUpParentAndInterfaces, fromModel, fromOperation, fromOperation, fromParameter, fromProperty, fromRequestBody, fromResponse, fromSecurity, generateExamplePath, getAlias, getCollectionFormat, getCommonTemplateDir, getConsumesInfo, getContentType, getGitRepoBaseURL, getGitRepoId, getGitUserId, getHideGenerationTimestamp, getHttpUserAgent, getIgnoreFilePathOverride, getIgnoreImportMapping, getInnerEnumAllowableValues, getInputSpec, getInputURL, getLanguageArguments, getLibrary, getOpenAPI, getOptionValue, getOrGenerateOperationId, getOutputDir, getParameterFromRef, getParentName, getProducesInfo, getReleaseNote, getSchemaFromBody, getSchemaFromParameter, getSchemaFromResponse, getSchemaHandler, getSortParamsByRequiredFlag, getSymbolName, getTemplateDir, getTemplateEngine, getTemplateVersion, getterAndSetterCapitalize, getTypeDeclaration, hasSchemaProperties, hasTrueAdditionalProperties, importMapping, initialCaps, instantiationTypes, isObjectSchema, isPrimivite, isPropertyInnerMostEnum, isRemoveOperationIdPrefix, isSkipOverwrite, languageSpecificPrimitives, modelDocFileFolder, modelDocTemplateFiles, modelPackage, modelTemplateFiles, modelTestFileFolder, modelTestTemplateFiles, needsUnflattenedSpec, needToImport, outputFolder, postProcessAllCodegenModels, postProcessAllModels, postProcessModels, postProcessModelsEnum, postProcessOperations, postProcessOperationsWithModels, postProcessParameter, postProcessSupportingFileData, preprocessOpenAPI, processCompiler, processMapSchema, processModelEnums, processOpenAPI, processPropertySchemaContainerTypes, processPropertySchemaTypes, readLanguageArguments, removeNonNameElementToCamelCase, removeNonNameElementToCamelCase, reservedWords, reservedWordsMappings, sanitizeName, sanitizeTag, setAllowUnicodeIdentifiers, setApiPackage, setCommonTemplateDir, setEnsureUniqueParams, setGitRepoBaseURL, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setIgnoreImportMapping, setInputSpec, setInputURL, setLanguageArguments, setLibrary, setModelNamePrefix, setModelNameSuffix, setModelPackage, setNonArrayMapProperty, setOutputDir, setParameterBooleanFlagWithCodegenProperty, setParameterExampleValue, setParameterNullable, setReleaseNote, setRemoveOperationIdPrefix, setReservedWords, setReservedWordsLowerCase, setSchemaProperties, setSkipOverwrite, setSortParamsByRequiredFlag, setTemplateDir, setTemplateEngine, setTemplateVersion, setUnflattenedOpenAPI, setUseOas2, shouldOverwrite, snakeCase, supportedLibraries, supportingFiles, templateDir, testPackage, toApiDocFilename, toApiFilename, toApiImport, toApiTestFilename, toApiVarName, toBooleanGetter, toDefaultValueWithParam, toExamples, toExampleValue, toGetter, toModelDocFilename, toModelImport, toModelTestFilename, toRegularExpression, toSetter, typeMapping, underscore, updateCodegenModelEnumVars, updateCodegenPropertyEnum, updateDataTypeWithEnumForArray, updateDataTypeWithEnumForMap, updatePropertyForArray, updatePropertyForMap, vendorExtensions, writeOptional, writePropertyBackpublic static final String PROJECT_NAME
public static final String RESPONSE_AS
public static final String UNWRAP_REQUIRED
public static final String OBJC_COMPATIBLE
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
public static final String SWIFT_USE_API_NAMESPACE
public static final String DEFAULT_POD_AUTHORS
public static final String LENIENT_TYPE_CAST
protected static final String MODEL_CLASSES
protected static final String USE_MODEL_CLASSES
protected static final String[] RESPONSE_LIBRARIES
protected String sourceFolder
public String getArgumentsLocation()
getArgumentsLocation in class DefaultCodegenConfigpublic io.swagger.codegen.v3.CodegenType getTag()
public String getHelp()
protected void addAdditionPropertiesToCodeGenModel(io.swagger.codegen.v3.CodegenModel codegenModel,
io.swagger.v3.oas.models.media.Schema schema)
addAdditionPropertiesToCodeGenModel in class DefaultCodegenConfigpublic void processOpts()
processOpts in interface io.swagger.codegen.v3.CodegenConfigprocessOpts in class DefaultCodegenConfigprotected boolean isReservedWord(String word)
isReservedWord in class DefaultCodegenConfigpublic String escapeReservedWord(String name)
DefaultCodegenConfigescapeReservedWord in interface io.swagger.codegen.v3.CodegenConfigescapeReservedWord in class DefaultCodegenConfigname - the name to be escapedpublic String modelFileFolder()
modelFileFolder in interface io.swagger.codegen.v3.CodegenConfigmodelFileFolder in class DefaultCodegenConfigpublic String apiFileFolder()
apiFileFolder in interface io.swagger.codegen.v3.CodegenConfigapiFileFolder in class DefaultCodegenConfigpublic String getTypeDeclaration(io.swagger.v3.oas.models.media.Schema propertySchema)
DefaultCodegenConfiggetTypeDeclaration in interface io.swagger.codegen.v3.CodegenConfiggetTypeDeclaration in class DefaultCodegenConfigpropertySchema - Schema Property objectpublic String getSchemaType(io.swagger.v3.oas.models.media.Schema schema)
DefaultCodegenConfiggetSchemaType in class DefaultCodegenConfigschema - Schema property objectpublic boolean isDataTypeFile(String dataType)
isDataTypeFile in class DefaultCodegenConfigpublic boolean isDataTypeBinary(String dataType)
isDataTypeBinary in class DefaultCodegenConfigpublic String toModelName(String name)
toModelName in interface io.swagger.codegen.v3.CodegenConfigtoModelName in class DefaultCodegenConfigname - the name of the modelpublic String toModelFilename(String name)
toModelFilename in interface io.swagger.codegen.v3.CodegenConfigtoModelFilename in class DefaultCodegenConfigname - the model namepublic String toDefaultValue(io.swagger.v3.oas.models.media.Schema schema)
DefaultCodegenConfigtoDefaultValue in class DefaultCodegenConfigschema - Schema property objectpublic String toInstantiationType(io.swagger.v3.oas.models.media.Schema schema)
DefaultCodegenConfigtoInstantiationType in class DefaultCodegenConfigschema - Swagger property objectpublic String toApiName(String name)
DefaultCodegenConfigtoApiName in interface io.swagger.codegen.v3.CodegenConfigtoApiName in class DefaultCodegenConfigname - the name of the Apipublic String toOperationId(String operationId)
DefaultCodegenConfigtoOperationId in class DefaultCodegenConfigoperationId - operation IDpublic String toVarName(String name)
DefaultCodegenConfigtoVarName in class DefaultCodegenConfigname - the variable namepublic String toParamName(String name)
DefaultCodegenConfigtoParamName in interface io.swagger.codegen.v3.CodegenConfigtoParamName in class DefaultCodegenConfigname - Codegen property objectpublic io.swagger.codegen.v3.CodegenModel fromModel(String name, io.swagger.v3.oas.models.media.Schema schema, Map<String,io.swagger.v3.oas.models.media.Schema> allDefinitions)
DefaultCodegenConfigfromModel in interface io.swagger.codegen.v3.CodegenConfigfromModel in class DefaultCodegenConfigname - the name of the modelschema - Swagger Model objectallDefinitions - a map of all Swagger models from the specpublic String getDefaultTemplateDir()
getDefaultTemplateDir in class DefaultCodegenConfigpublic void setProjectName(String projectName)
public void setUnwrapRequired(boolean unwrapRequired)
public void setObjcCompatible(boolean objcCompatible)
public void setLenientTypeCast(boolean lenientTypeCast)
public void setResponseAs(String[] responseAs)
public void setSwiftUseApiNamespace(boolean swiftUseApiNamespace)
public String toEnumValue(String value, String datatype)
DefaultCodegenConfigtoEnumValue in class DefaultCodegenConfigvalue - enum variable namedatatype - data typepublic String toEnumDefaultValue(String value, String datatype)
DefaultCodegenConfigtoEnumDefaultValue in class DefaultCodegenConfigvalue - enum variable namedatatype - data typepublic String toEnumVarName(String name, String datatype)
DefaultCodegenConfigtoEnumVarName in class DefaultCodegenConfigname - enum variable namedatatype - data typepublic String toEnumName(io.swagger.codegen.v3.CodegenProperty property)
DefaultCodegenConfigtoEnumName in class DefaultCodegenConfigproperty - Codegen propertypublic void postProcessModelProperty(io.swagger.codegen.v3.CodegenModel model,
io.swagger.codegen.v3.CodegenProperty property)
postProcessModelProperty in interface io.swagger.codegen.v3.CodegenConfigpostProcessModelProperty in class DefaultCodegenConfigpublic String escapeQuotationMark(String input)
DefaultCodegenConfigescapeQuotationMark in interface io.swagger.codegen.v3.CodegenConfigescapeQuotationMark in class DefaultCodegenConfiginput - String to be cleaned uppublic String escapeUnsafeCharacters(String input)
DefaultCodegenConfigescapeUnsafeCharacters in interface io.swagger.codegen.v3.CodegenConfigescapeUnsafeCharacters in class DefaultCodegenConfiginput - String to be cleaned upCopyright © 2022. All rights reserved.