public class CrystalClientCodegen extends DefaultCodegen
| Modifier and Type | Field and Description |
|---|---|
protected String |
apiDocPath |
protected static int |
emptyMethodNameCounter |
protected String |
modelDocPath |
protected String |
moduleName |
static String |
SHARD_AUTHOR |
static String |
SHARD_AUTHOR_EMAIL |
static String |
SHARD_DESCRIPTION |
static String |
SHARD_HOMEPAGE |
static String |
SHARD_LICENSE |
static String |
SHARD_NAME |
static String |
SHARD_SUMMARY |
static String |
SHARD_VERSION |
protected String |
shardAuthor |
protected String |
shardAuthorEmail |
protected String |
shardDescription |
protected String |
shardHomepage |
protected String |
shardLicense |
protected String |
shardName |
protected String |
shardSummary |
protected String |
shardVersion |
protected String |
specFolder |
protected String |
srcFolder |
additionalProperties, addOneOfInterfaceImports, addOneOfInterfaces, allowUnicodeIdentifiers, apiDocTemplateFiles, apiNamePrefix, apiNameSuffix, apiPackage, apiTemplateFiles, apiTestTemplateFiles, cliOptions, DefaultFeatureSet, defaultIncludes, disallowAdditionalPropertiesIfNotPresent, docExtension, embeddedTemplateDir, enableMinimalUpdate, enablePostProcessFile, ensureUniqueParams, enumUnknownDefaultCase, enumUnknownDefaultCaseName, filesMetadataFilename, fileSuffix, generatorMetadata, gitHost, gitRepoId, gitUserId, hideGenerationTimestamp, httpUserAgent, ignoreFilePathOverride, importMapping, inputSpec, instantiationTypes, JSON_MIME_PATTERN, JSON_VENDOR_MIME_PATTERN, languageSpecificPrimitives, legacyDiscriminatorBehavior, library, modelDocTemplateFiles, modelNamePrefix, modelNameSuffix, modelPackage, modelTemplateFiles, modelTestTemplateFiles, openAPI, outputFolder, prependFormOrBodyParameters, releaseNote, removeEnumValuePrefix, removeOperationIdPrefix, removeOperationIdPrefixCount, removeOperationIdPrefixDelimiter, reservedWords, reservedWordsMappings, serverVariables, skipOperationExample, skipOverwrite, sortModelPropertiesByRequiredFlag, sortParamsByRequiredFlag, specialCharReplacements, strictSpecBehavior, supportedLibraries, supportingFiles, supportsAdditionalPropertiesWithComposedSchema, supportsInheritance, supportsMixins, supportsMultipleInheritance, templateDir, testPackage, typeAliases, typeMapping, useOneOfInterfaces, vendorExtensions, versionMetadataFilename| Constructor and Description |
|---|
CrystalClientCodegen() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel,
io.swagger.v3.oas.models.media.Schema schema)
Handle the model for the 'additionalProperties' keyword in the OAS schema.
|
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
|
String |
getHelp() |
String |
getName() |
String |
getSchemaType(io.swagger.v3.oas.models.media.Schema schema)
returns the OpenAPI type for the property.
|
CodegenType |
getTag() |
String |
getTypeDeclaration(io.swagger.v3.oas.models.media.Schema schema)
Output the language-specific type declaration of the property.
|
String |
modelDocFileFolder() |
String |
modelFileFolder() |
String |
modelTestFileFolder() |
void |
postProcessFile(File file,
String fileType)
Post-process the auto-generated file, e.g.
|
Map<String,Object> |
postProcessModels(Map<String,Object> objs) |
Map<String,Object> |
postProcessOperationsWithModels(Map<String,Object> objs,
List<Object> allModels) |
void |
processOpts() |
void |
setModuleName(String moduleName) |
void |
setShardAuthor(String shardAuthor) |
void |
setShardAuthorEmail(String shardAuthorEmail) |
void |
setShardDescription(String shardDescription) |
void |
setShardHomepage(String shardHomepage) |
void |
setShardLicense(String shardLicense) |
void |
setShardName(String shardName) |
void |
setShardSummary(String shardSummary) |
void |
setShardVersion(String shardVersion) |
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 the specified or default suffix
Return DefaultApi if name is empty
|
String |
toApiTestFilename(String name)
Return the file name of the Api Test
|
String |
toDefaultValue(io.swagger.v3.oas.models.media.Schema p)
Return the default value of the property
Return null if you do NOT want a default value.
|
String |
toEnumDefaultValue(String value,
String datatype)
Return the enum default value in the language specified format
|
String |
toEnumName(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 |
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)
Converts the OpenAPI schema name to a model name suitable for the current code generator.
|
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 |
toVarName(String name)
Return the variable name by removing invalid characters and proper escaping if
it's a reserved word.
|
addBodyModelSchema, addHeaders, addImport, addImportsForPropertyType, addImportsToOneOfInterface, additionalProperties, addMustacheLambdas, addOneOfInterfaceModel, addOneOfNameExtension, addOperationToGroup, addOption, addParentContainer, addProperties, addRegularExpressionDelimiter, addSwitch, addVars, apiDocFilename, apiDocTemplateFiles, apiFilename, apiPackage, apiTemplateFiles, apiTestFilename, apiTestTemplateFiles, buildEnumVars, buildLibraryCliOption, cliOptions, convertPropertyToBoolean, convertPropertyToBooleanAndWriteBack, createDiscriminator, defaultIncludes, embeddedTemplateDir, encodePath, escapeText, escapeTextWhileAllowingNewLines, fileSuffix, findCommonPrefixOfVars, findMethodResponse, fromCallback, fromFormProperty, fromModel, fromOperation, fromParameter, fromProperty, fromRequestBody, fromRequestBodyToFormParameters, fromResponse, fromSecurity, fromServers, fromServerVariables, generateExamplePath, generateJSONSpecFile, generateYAMLSpecFile, getAdditionalProperties, getAlias, getAllModels, getAllOfDescendants, getAllowUnicodeIdentifiers, getApiNamePrefix, getApiNameSuffix, getCollectionFormat, getCollectionFormat, getConsumesInfo, getContent, getContentType, getDisallowAdditionalPropertiesIfNotPresent, getDocExtension, getEnsureUniqueParams, getEnumDefaultValue, getEnumUnknownDefaultCase, getFeatureSet, getFilesMetadataFilename, getGeneratorMetadata, getGitHost, getGitRepoId, getGitUserId, getHttpUserAgent, getIgnoreFilePathOverride, getInnerEnumAllowableValues, getInputSpec, getLegacyDiscriminatorBehavior, getLibrary, getModelNamePrefix, getModelNameSuffix, getModelNameToSchemaCache, getMostInnerItems, getOneOfAnyOfDescendants, getOrGenerateOperationId, getOutputDir, getParameterDataType, getPrependFormOrBodyParameters, getProducesInfo, getReleaseNote, getRemoveOperationIdPrefixCount, getRemoveOperationIdPrefixDelimiter, getSchemaAdditionalProperties, getSchemaItems, getSingleSchemaType, getSortModelPropertiesByRequiredFlag, getSortParamsByRequiredFlag, getSymbolName, getTemplatingEngine, getterAndSetterCapitalize, getTypeDeclaration, getUseOneOfInterfaces, getVersionMetadataFilename, handleMethodResponse, handleMethodResponse, hasBodyParameter, hasFormParameter, importMapping, initializeSpecialCharacterMapping, instantiationTypes, isAnyTypeSchema, isDataTypeBinary, isDataTypeFile, isDataTypeString, isEnableMinimalUpdate, isEnablePostProcessFile, isFreeFormObject, isHideGenerationTimestamp, isJsonMimeType, isJsonVendorMimeType, isLibrary, isParameterNameUnique, isPropertyInnerMostEnum, isRemoveEnumValuePrefix, isRemoveOperationIdPrefix, isReservedWord, isSkipOperationExample, isSkipOverwrite, isStrictSpecBehavior, languageSpecificPrimitives, lowerCamelCase, modelDocTemplateFiles, modelFilename, modelPackage, modelTemplateFiles, modelTestTemplateFiles, modifyFeatureSet, needToImport, outputFolder, postProcess, postProcessAllModels, postProcessModelProperty, postProcessModelsEnum, postProcessParameter, postProcessSupportingFileData, preprocessOpenAPI, processCompiler, processOpenAPI, processTemplatingEngine, removeNonNameElementToCamelCase, removeNonNameElementToCamelCase, removeOption, removeSelfReferenceImports, reservedWords, reservedWordsMappings, sanitizeName, sanitizeName, sanitizeName, sanitizeTag, serverVariableOverrides, setAddProps, setAllowUnicodeIdentifiers, setApiNamePrefix, setApiNameSuffix, setApiPackage, setCircularReferences, setDisallowAdditionalPropertiesIfNotPresent, setDocExtension, setEnableMinimalUpdate, setEnablePostProcessFile, setEnsureUniqueParams, setEnumUnknownDefaultCase, setFilesMetadataFilename, setGitHost, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLegacyDiscriminatorBehavior, setLibrary, setModelNamePrefix, setModelNameSuffix, setModelPackage, setNonArrayMapProperty, setOpenAPI, setOutputDir, setParameterBooleanFlagWithCodegenProperty, setParameterContentType, setParameterExampleValue, setParameterExampleValue, setParameterExampleValue, setParameterNullable, setPrependFormOrBodyParameters, setReleaseNote, setRemoveEnumValuePrefix, setRemoveOperationIdPrefix, setRemoveOperationIdPrefixCount, setRemoveOperationIdPrefixDelimiter, setReservedWordsLowerCase, setSkipOperationExample, setSkipOverwrite, setSortModelPropertiesByRequiredFlag, setSortParamsByRequiredFlag, setStrictSpecBehavior, setTemplateDir, setTemplatingEngine, setUseOneOfInterfaces, setVersionMetadataFilename, shouldOverwrite, supportedLibraries, supportingFiles, templateDir, testPackage, toAllOfName, toAnyOfName, toApiVarName, toArrayModelParamName, toBooleanGetter, toDefaultParameterValue, toDefaultValueWithParam, toExamples, toExampleValue, toGetter, toMediaTypeSchemaName, toModelImport, toModelImportMap, toOneOfName, toSetter, typeMapping, unaliasPropertySchema, unaliasSchema, updateAllModels, updateCodegenPropertyEnum, updateDataTypeWithEnumForArray, updateDataTypeWithEnumForMap, updateEnumVarsWithExtensions, updateModelForAnyType, updateModelForComposedSchema, updateModelForObject, updateOption, updateParameterForString, updatePropertyForAnyType, updatePropertyForArray, updatePropertyForMap, updatePropertyForMap, updatePropertyForObject, updatePropertyForString, updateRequestBodyForArray, updateRequestBodyForMap, updateRequestBodyForObject, updateRequestBodyForPrimitiveType, updateRequestBodyForString, vendorExtensions, writePropertyBackprotected static int emptyMethodNameCounter
protected String shardName
protected String moduleName
protected String shardVersion
protected String specFolder
protected String srcFolder
protected String shardLicense
protected String shardHomepage
protected String shardSummary
protected String shardDescription
protected String shardAuthor
protected String shardAuthorEmail
protected String apiDocPath
protected String modelDocPath
public static final String SHARD_NAME
public static final String SHARD_VERSION
public static final String SHARD_LICENSE
public static final String SHARD_HOMEPAGE
public static final String SHARD_SUMMARY
public static final String SHARD_DESCRIPTION
public static final String SHARD_AUTHOR
public static final String SHARD_AUTHOR_EMAIL
public void processOpts()
processOpts in interface CodegenConfigprocessOpts in class DefaultCodegenpublic String getHelp()
getHelp in interface CodegenConfiggetHelp in class DefaultCodegenpublic CodegenType getTag()
getTag in interface CodegenConfiggetTag in class DefaultCodegenpublic String getName()
getName in interface CodegenConfiggetName in class DefaultCodegenpublic String apiFileFolder()
apiFileFolder in interface CodegenConfigapiFileFolder in class DefaultCodegenpublic String modelFileFolder()
modelFileFolder in interface CodegenConfigmodelFileFolder in class DefaultCodegenpublic String apiTestFileFolder()
apiTestFileFolder in interface CodegenConfigapiTestFileFolder in class DefaultCodegenpublic String modelTestFileFolder()
modelTestFileFolder in interface CodegenConfigmodelTestFileFolder in class DefaultCodegenpublic String apiDocFileFolder()
apiDocFileFolder in interface CodegenConfigapiDocFileFolder in class DefaultCodegenpublic String modelDocFileFolder()
modelDocFileFolder in interface CodegenConfigmodelDocFileFolder in class DefaultCodegenpublic String getSchemaType(io.swagger.v3.oas.models.media.Schema schema)
DefaultCodegengetSchemaType in class DefaultCodegenschema - property schemapublic String toModelName(String name)
DefaultCodegentoModelName in interface CodegenConfigtoModelName in class DefaultCodegenname - the name of the modelpublic String toModelFilename(String name)
DefaultCodegentoModelFilename in interface CodegenConfigtoModelFilename in class DefaultCodegenname - the model namepublic String toModelDocFilename(String name)
DefaultCodegentoModelDocFilename in interface CodegenConfigtoModelDocFilename in class DefaultCodegenname - the model namepublic String toApiFilename(String name)
DefaultCodegentoApiFilename in interface CodegenConfigtoApiFilename in class DefaultCodegenname - the file name of the Apipublic String toApiDocFilename(String name)
DefaultCodegentoApiDocFilename in interface CodegenConfigtoApiDocFilename in class DefaultCodegenname - the file name of the Apipublic String toApiTestFilename(String name)
DefaultCodegentoApiTestFilename in interface CodegenConfigtoApiTestFilename in class DefaultCodegenname - the file name of the Apipublic String toModelTestFilename(String name)
DefaultCodegentoModelTestFilename in interface CodegenConfigtoModelTestFilename in class DefaultCodegenname - the model namepublic String toApiName(String name)
DefaultCodegentoApiName in interface CodegenConfigtoApiName in class DefaultCodegenname - the name of the Apipublic String toEnumValue(String value, String datatype)
DefaultCodegentoEnumValue in class DefaultCodegenvalue - enum variable namedatatype - data typepublic String toEnumVarName(String name, String datatype)
DefaultCodegentoEnumVarName in class DefaultCodegenname - enum variable namedatatype - data typepublic String toEnumName(CodegenProperty property)
DefaultCodegentoEnumName in class DefaultCodegenproperty - Codegen propertypublic Map<String,Object> postProcessModels(Map<String,Object> objs)
postProcessModels in interface CodegenConfigpostProcessModels in class DefaultCodegenpublic String toOperationId(String operationId)
DefaultCodegentoOperationId in class DefaultCodegenoperationId - operation IDpublic String toApiImport(String name)
DefaultCodegentoApiImport in interface CodegenConfigtoApiImport in class DefaultCodegenname - the name of the "Api"public void setShardName(String shardName)
public void setModuleName(String moduleName)
public void setShardVersion(String shardVersion)
public void setShardDescription(String shardDescription)
public void setShardSummary(String shardSummary)
public void setShardLicense(String shardLicense)
public void setShardHomepage(String shardHomepage)
public void setShardAuthor(String shardAuthor)
public void setShardAuthorEmail(String shardAuthorEmail)
protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, io.swagger.v3.oas.models.media.Schema schema)
DefaultCodegenaddAdditionPropertiesToCodeGenModel in class DefaultCodegencodegenModel - The codegen representation of the schema.schema - The input OAS schema.public Map<String,Object> postProcessOperationsWithModels(Map<String,Object> objs, List<Object> allModels)
postProcessOperationsWithModels in interface CodegenConfigpostProcessOperationsWithModels in class DefaultCodegenpublic String escapeReservedWord(String name)
DefaultCodegenescapeReservedWord in interface CodegenConfigescapeReservedWord in class DefaultCodegenname - the name to be escapedthrows Runtime exception as reserved word is not allowed (default behavior)
public String getTypeDeclaration(io.swagger.v3.oas.models.media.Schema schema)
DefaultCodegengetTypeDeclaration in interface CodegenConfiggetTypeDeclaration in class DefaultCodegenschema - property schemapublic String toInstantiationType(io.swagger.v3.oas.models.media.Schema schema)
DefaultCodegentoInstantiationType in class DefaultCodegenschema - property schemapublic String toDefaultValue(io.swagger.v3.oas.models.media.Schema p)
DefaultCodegentoDefaultValue in class DefaultCodegenp - Property schemapublic String toEnumDefaultValue(String value, String datatype)
DefaultCodegentoEnumDefaultValue in class DefaultCodegenvalue - enum variable namedatatype - data typepublic String toVarName(String name)
DefaultCodegentoVarName in class DefaultCodegenname - the variable namepublic String toRegularExpression(String pattern)
DefaultCodegentoRegularExpression in class DefaultCodegenpattern - the pattern (regular expression)public String toParamName(String name)
DefaultCodegentoParamName in interface CodegenConfigtoParamName in class DefaultCodegenname - Codegen property objectpublic String escapeQuotationMark(String input)
DefaultCodegenescapeQuotationMark in interface CodegenConfigescapeQuotationMark in class DefaultCodegeninput - String to be cleaned uppublic String escapeUnsafeCharacters(String input)
DefaultCodegenescapeUnsafeCharacters in interface CodegenConfigescapeUnsafeCharacters in class DefaultCodegeninput - String to be cleaned uppublic void postProcessFile(File file, String fileType)
DefaultCodegenTODO: store these values in enum instead
postProcessFile in interface CodegenConfigpostProcessFile in class DefaultCodegenfile - file to be processedfileType - file typeCopyright © 2021. All rights reserved.