public abstract class AbstractPhpCodegen extends DefaultCodegenConfig
Modifier and Type | Field and Description |
---|---|
protected String |
apiDirName |
protected String |
apiDocPath |
protected String |
artifactVersion |
protected String |
docsBasePath |
protected String |
invokerPackage |
protected String |
modelDirName |
protected String |
modelDocPath |
static String |
PACKAGE_PATH |
protected String |
packagePath |
static String |
SRC_BASE_PATH |
protected String |
srcBasePath |
protected String |
testBasePath |
static String |
VARIABLE_NAMING_CONVENTION |
protected String |
variableNamingConvention |
additionalProperties, allowUnicodeIdentifiers, apiDocTemplateFiles, apiPackage, apiTemplateFiles, apiTestTemplateFiles, cliOptions, commonTemplateDir, DEFAULT_CONTENT_TYPE, DEFAULT_TEMPLATE_VERSION, defaultIncludes, embeddedTemplateDir, ensureUniqueParams, fileSuffix, gitRepoId, gitUserId, hideGenerationTimestamp, httpUserAgent, ignoreFilePathOverride, importMapping, inputSpec, instantiationTypes, languageArguments, languageSpecificPrimitives, library, modelDocTemplateFiles, modelNamePrefix, modelNameSuffix, modelPackage, modelTemplateFiles, modelTestTemplateFiles, outputFolder, releaseNote, removeOperationIdPrefix, REQUEST_BODY_NAME, reservedWords, reservedWordsMappings, skipOverwrite, sortParamsByRequiredFlag, specialCharReplacements, supportedLibraries, supportingFiles, supportsInheritance, supportsMixins, templateDir, templateVersion, testPackage, typeAliases, typeMapping, vendorExtensions
Constructor and Description |
---|
AbstractPhpCodegen() |
Modifier and Type | Method and Description |
---|---|
String |
apiDocFileFolder() |
String |
apiFileFolder() |
String |
apiTestFileFolder() |
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
|
protected String |
extractSimpleName(String phpClassName) |
String |
getPackagePath() |
String |
getSchemaType(io.swagger.v3.oas.models.media.Schema property)
returns the swagger type for the property
|
String |
getTypeDeclaration(io.swagger.v3.oas.models.media.Schema propertySchema)
Output the type declaration of the property
|
String |
getTypeDeclaration(String name)
Output the type declaration of a given name
|
String |
modelDocFileFolder() |
String |
modelFileFolder() |
String |
modelTestFileFolder() |
Map<String,Object> |
postProcessModels(Map<String,Object> objs) |
Map<String,Object> |
postProcessOperations(Map<String,Object> objs) |
void |
processOpts() |
void |
setArtifactVersion(String artifactVersion) |
void |
setInvokerPackage(String invokerPackage) |
void |
setPackagePath(String packagePath) |
void |
setParameterExampleValue(io.swagger.codegen.CodegenParameter codegenParameter)
Return the example value of the parameter.
|
void |
setParameterNamingConvention(String variableNamingConvention) |
void |
setSrcBasePath(String srcBasePath) |
String |
toApiDocFilename(String name)
Return the file name of the Api Documentation
|
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.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 |
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 |
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 |
toPackagePath(String packageName,
String basePath) |
String |
toParamName(String name)
Return the parameter name by removing invalid characters and proper escaping if
it's a reserved word.
|
String |
toSrcPath(String packageName,
String basePath) |
String |
toVarName(String name)
Return the variable name by removing invalid characters and proper escaping if
it's a reserved word.
|
addAdditionPropertiesToCodeGenModel, addConsumesInfo, addHandlebarHelpers, addImport, additionalProperties, addOperationToGroup, addProducesInfo, addProperties, addRegularExpressionDelimiter, apiDocFilename, apiDocTemplateFiles, apiFilename, apiPackage, apiTemplateFiles, apiTestFilename, apiTestTemplateFiles, buildLibraryCliOption, camelize, camelize, cliOptions, convertPropertyToBoolean, convertPropertyToBooleanAndWriteBack, dashize, defaultIncludes, detectParent, embeddedTemplateDir, escapeText, fileSuffix, findCommonPrefixOfVars, findMethodResponse, fromModel, fromModel, fromOperation, fromOperation, fromParameter, fromProperty, fromRequestBody, fromResponse, fromSecurity, generateExamplePath, getAlias, getArgumentsLocation, getCollectionFormat, getCommonTemplateDir, getConsumesInfo, getContentType, getGitRepoId, getGitUserId, getHideGenerationTimestamp, getHttpUserAgent, getIgnoreFilePathOverride, getInnerEnumAllowableValues, getInputSpec, getLanguageArguments, getLibrary, getOrGenerateOperationId, getOutputDir, getParameterFromRef, getParentName, getProducesInfo, getReleaseNote, getSchemaFromBody, getSchemaFromResponse, getSimpleRef, getSortParamsByRequiredFlag, getSymbolName, getTemplateVersion, getterAndSetterCapitalize, importMapping, initialCaps, instantiationTypes, isDataTypeBinary, isDataTypeFile, isPropertyInnerMostEnum, isRemoveOperationIdPrefix, isReservedWord, isSkipOverwrite, languageSpecificPrimitives, modelDocTemplateFiles, modelPackage, modelTemplateFiles, modelTestTemplateFiles, needToImport, outputFolder, postProcessAllModels, postProcessModelProperty, postProcessModelsEnum, postProcessOperationsWithModels, postProcessParameter, postProcessSupportingFileData, preprocessOpenAPI, processModelEnums, processOpenAPI, readLanguageArguments, removeNonNameElementToCamelCase, removeNonNameElementToCamelCase, reservedWords, reservedWordsMappings, sanitizeName, sanitizeTag, setAllowUnicodeIdentifiers, setApiPackage, setCommonTemplateDir, setEnsureUniqueParams, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLanguageArguments, setLibrary, setModelNamePrefix, setModelNameSuffix, setModelPackage, setNonArrayMapProperty, setOutputDir, setParameterBooleanFlagWithCodegenProperty, setReleaseNote, setRemoveOperationIdPrefix, setReservedWordsLowerCase, setSkipOverwrite, setSortParamsByRequiredFlag, setTemplateDir, setTemplateVersion, shouldOverwrite, snakeCase, supportedLibraries, supportingFiles, templateDir, testPackage, toApiFilename, toApiImport, toApiName, toApiTestFilename, toApiVarName, toBooleanGetter, toDefaultValueWithParam, toExamples, toExampleValue, toGetter, toInstantiationType, toModelImport, toRegularExpression, toSetter, typeMapping, underscore, updateCodegenPropertyEnum, updateDataTypeWithEnumForArray, updateDataTypeWithEnumForMap, updatePropertyForArray, updatePropertyForMap, vendorExtensions, writeOptional, writePropertyBack
public static final String VARIABLE_NAMING_CONVENTION
public static final String PACKAGE_PATH
public static final String SRC_BASE_PATH
protected String invokerPackage
protected String packagePath
protected String artifactVersion
protected String srcBasePath
protected String testBasePath
protected String docsBasePath
protected String apiDirName
protected String modelDirName
protected String variableNamingConvention
protected String apiDocPath
protected String modelDocPath
public void processOpts()
processOpts
in interface io.swagger.codegen.CodegenConfig
processOpts
in class DefaultCodegenConfig
public String getPackagePath()
public String escapeReservedWord(String name)
DefaultCodegenConfig
escapeReservedWord
in interface io.swagger.codegen.CodegenConfig
escapeReservedWord
in class DefaultCodegenConfig
name
- the name to be escapedpublic String apiFileFolder()
apiFileFolder
in interface io.swagger.codegen.CodegenConfig
apiFileFolder
in class DefaultCodegenConfig
public String modelFileFolder()
modelFileFolder
in interface io.swagger.codegen.CodegenConfig
modelFileFolder
in class DefaultCodegenConfig
public String apiTestFileFolder()
apiTestFileFolder
in interface io.swagger.codegen.CodegenConfig
apiTestFileFolder
in class DefaultCodegenConfig
public String modelTestFileFolder()
modelTestFileFolder
in interface io.swagger.codegen.CodegenConfig
modelTestFileFolder
in class DefaultCodegenConfig
public String apiDocFileFolder()
apiDocFileFolder
in interface io.swagger.codegen.CodegenConfig
apiDocFileFolder
in class DefaultCodegenConfig
public String modelDocFileFolder()
modelDocFileFolder
in interface io.swagger.codegen.CodegenConfig
modelDocFileFolder
in class DefaultCodegenConfig
public String toModelDocFilename(String name)
DefaultCodegenConfig
toModelDocFilename
in interface io.swagger.codegen.CodegenConfig
toModelDocFilename
in class DefaultCodegenConfig
name
- the model namepublic String toApiDocFilename(String name)
DefaultCodegenConfig
toApiDocFilename
in interface io.swagger.codegen.CodegenConfig
toApiDocFilename
in class DefaultCodegenConfig
name
- the file name of the Apipublic String getTypeDeclaration(io.swagger.v3.oas.models.media.Schema propertySchema)
DefaultCodegenConfig
getTypeDeclaration
in interface io.swagger.codegen.CodegenConfig
getTypeDeclaration
in class DefaultCodegenConfig
propertySchema
- Schema Property objectpublic String getTypeDeclaration(String name)
DefaultCodegenConfig
getTypeDeclaration
in interface io.swagger.codegen.CodegenConfig
getTypeDeclaration
in class DefaultCodegenConfig
name
- namepublic String getSchemaType(io.swagger.v3.oas.models.media.Schema property)
DefaultCodegenConfig
getSchemaType
in class DefaultCodegenConfig
property
- Schema property objectpublic void setInvokerPackage(String invokerPackage)
public void setArtifactVersion(String artifactVersion)
public void setPackagePath(String packagePath)
public void setSrcBasePath(String srcBasePath)
public void setParameterNamingConvention(String variableNamingConvention)
public String toVarName(String name)
DefaultCodegenConfig
toVarName
in class DefaultCodegenConfig
name
- the variable namepublic String toParamName(String name)
DefaultCodegenConfig
toParamName
in interface io.swagger.codegen.CodegenConfig
toParamName
in class DefaultCodegenConfig
name
- Codegen property objectpublic String toModelName(String name)
DefaultCodegenConfig
toModelName
in interface io.swagger.codegen.CodegenConfig
toModelName
in class DefaultCodegenConfig
name
- the name of the modelpublic String toModelFilename(String name)
DefaultCodegenConfig
toModelFilename
in interface io.swagger.codegen.CodegenConfig
toModelFilename
in class DefaultCodegenConfig
name
- the model namepublic String toModelTestFilename(String name)
DefaultCodegenConfig
toModelTestFilename
in interface io.swagger.codegen.CodegenConfig
toModelTestFilename
in class DefaultCodegenConfig
name
- the model namepublic String toOperationId(String operationId)
DefaultCodegenConfig
toOperationId
in class DefaultCodegenConfig
operationId
- operation IDpublic String toDefaultValue(io.swagger.v3.oas.models.media.Schema schema)
toDefaultValue
in class DefaultCodegenConfig
schema
- Schema property objectpublic void setParameterExampleValue(io.swagger.codegen.CodegenParameter codegenParameter)
DefaultCodegenConfig
setParameterExampleValue
in class DefaultCodegenConfig
codegenParameter
- Swagger property objectpublic String toEnumValue(String value, String datatype)
DefaultCodegenConfig
toEnumValue
in class DefaultCodegenConfig
value
- enum variable namedatatype
- data typepublic String toEnumDefaultValue(String value, String datatype)
DefaultCodegenConfig
toEnumDefaultValue
in class DefaultCodegenConfig
value
- enum variable namedatatype
- data typepublic String toEnumVarName(String name, String datatype)
DefaultCodegenConfig
toEnumVarName
in class DefaultCodegenConfig
name
- enum variable namedatatype
- data typepublic String toEnumName(io.swagger.codegen.CodegenProperty property)
DefaultCodegenConfig
toEnumName
in class DefaultCodegenConfig
property
- Codegen propertypublic Map<String,Object> postProcessModels(Map<String,Object> objs)
postProcessModels
in interface io.swagger.codegen.CodegenConfig
postProcessModels
in class DefaultCodegenConfig
public Map<String,Object> postProcessOperations(Map<String,Object> objs)
postProcessOperations
in interface io.swagger.codegen.CodegenConfig
postProcessOperations
in class DefaultCodegenConfig
public String escapeQuotationMark(String input)
DefaultCodegenConfig
escapeQuotationMark
in interface io.swagger.codegen.CodegenConfig
escapeQuotationMark
in class DefaultCodegenConfig
input
- String to be cleaned uppublic String escapeUnsafeCharacters(String input)
DefaultCodegenConfig
escapeUnsafeCharacters
in interface io.swagger.codegen.CodegenConfig
escapeUnsafeCharacters
in class DefaultCodegenConfig
input
- String to be cleaned upCopyright © 2018. All rights reserved.