Class ScalaPlayFrameworkServerCodegen
- java.lang.Object
-
- org.openapitools.codegen.DefaultCodegen
-
- org.openapitools.codegen.languages.AbstractScalaCodegen
-
- org.openapitools.codegen.languages.ScalaPlayFrameworkServerCodegen
-
- All Implemented Interfaces:
CodegenConfig
public class ScalaPlayFrameworkServerCodegen extends AbstractScalaCodegen implements CodegenConfig
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openapitools.codegen.languages.AbstractScalaCodegen
AbstractScalaCodegen.CamelizeLambda, AbstractScalaCodegen.CustomLambda, AbstractScalaCodegen.DateLibraries
-
-
Field Summary
Fields Modifier and Type Field Description static String
BASE_PACKAGE
protected String
basePackage
static String
GENERATE_CUSTOM_EXCEPTIONS
protected boolean
generateCustomExceptions
static String
ROUTES_FILE_NAME
protected String
routesFileName
static String
SKIP_STUBS
protected boolean
skipStubs
static String
SUPPORT_ASYNC
protected boolean
supportAsync
static String
TITLE
static String
USE_SWAGGER_UI
protected boolean
useSwaggerUI
-
Fields inherited from class org.openapitools.codegen.languages.AbstractScalaCodegen
apiVersion, appDescription, appName, dateLibrary, infoEmail, infoUrl, invokerPackage, licenseInfo, licenseUrl, modelPropertyNaming, sourceFolder, stripPackageName
-
Fields inherited from class org.openapitools.codegen.DefaultCodegen
additionalProperties, addOneOfInterfaceImports, addOneOfInterfaces, addSuffixToDuplicateOperationNicknames, allowUnicodeIdentifiers, apiDocTemplateFiles, apiNamePrefix, apiNameSuffix, apiPackage, apiTemplateFiles, apiTestTemplateFiles, autosetConstants, cliOptions, DefaultFeatureSet, defaultIncludes, disallowAdditionalPropertiesIfNotPresent, docExtension, embeddedTemplateDir, enableMinimalUpdate, enablePostProcessFile, ensureUniqueParams, enumNameMapping, enumUnknownDefaultCase, enumUnknownDefaultCaseName, falseSchema, filesMetadataFilename, fileSuffix, generatorMetadata, gitHost, gitRepoId, gitUserId, hideGenerationTimestamp, httpUserAgent, ignoreFilePathOverride, importBaseType, importContainerType, importMapping, inlineSchemaNameMapping, inlineSchemaOption, inputSpec, instantiationTypes, JSON_MIME_PATTERN, JSON_VENDOR_MIME_PATTERN, languageSpecificPrimitives, legacyDiscriminatorBehavior, library, loadDeepObjectIntoItems, modelDocTemplateFiles, modelNameMapping, modelNamePrefix, modelNameSuffix, modelPackage, modelTemplateFiles, modelTestTemplateFiles, nameMapping, openAPI, openapiGeneratorIgnoreList, openapiNormalizer, outputFolder, parameterNameMapping, prependFormOrBodyParameters, releaseNote, removeEnumValuePrefix, removeOperationIdPrefix, removeOperationIdPrefixCount, removeOperationIdPrefixDelimiter, reservedWords, reservedWordsMappings, schemaMapping, serverVariables, skipOperationExample, skipOverwrite, sortModelPropertiesByRequiredFlag, sortParamsByRequiredFlag, specialCharReplacements, strictSpecBehavior, supportedLibraries, supportingFiles, supportsAdditionalPropertiesWithComposedSchema, supportsInheritance, supportsMixins, supportsMultipleInheritance, templateDir, templateOutputDirs, testPackage, trueSchema, typeAliases, typeMapping, useOneOfInterfaces, vendorExtensions, versionMetadataFilename, XML_MIME_PATTERN
-
-
Constructor Summary
Constructors Constructor Description ScalaPlayFrameworkServerCodegen()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.common.collect.ImmutableMap.Builder<String,com.samskivert.mustache.Mustache.Lambda>
addMustacheLambdas()
Preset map builder with commonly used Mustache lambdas.String
camelizeStripReservedEscape(String str)
String
getHelp()
String
getName()
String
getSchemaType(io.swagger.v3.oas.models.media.Schema p)
returns the OpenAPI type for the property.CodegenType
getTag()
Map<String,ModelsMap>
postProcessAllModels(Map<String,ModelsMap> objs)
OperationsMap
postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels)
Map<String,Object>
postProcessSupportingFileData(Map<String,Object> objs)
void
processOpts()
void
setBasePackage(String basePackage)
void
setGenerateCustomExceptions(boolean generateCustomExceptions)
void
setRoutesFileName(String routesFileName)
void
setSkipStubs(boolean skipStubs)
void
setSupportAsync(boolean supportAsync)
void
setUseSwaggerUI(boolean useSwaggerUI)
String
toDefaultValue(io.swagger.v3.oas.models.media.Schema p)
Return the default value of the propertyString
toEnumName(CodegenProperty property)
Return the Enum name (e.g.String
toEnumVarName(String value, String datatype)
Return the sanitized variable name for enum-
Methods inherited from class org.openapitools.codegen.languages.AbstractScalaCodegen
apiFileFolder, escapeQuotationMark, escapeReservedWord, escapeUnsafeCharacters, formatIdentifier, fromProperty, generatorLanguage, getDateLibrary, getModelPropertyNaming, getNameUsingModelPropertyNaming, getSourceFolder, getTypeDeclaration, modelFileFolder, postProcessFile, postProcessModels, processCompiler, setDateLibrary, setInvokerPackage, setModelPropertyNaming, setSourceFolder, stripPackageName, toInstantiationType, toModelFilename, toModelName, toOperationId, toVarName
-
Methods inherited from class org.openapitools.codegen.DefaultCodegen
addAdditionPropertiesToCodeGenModel, addBodyModelSchema, addHeaders, addImport, addImport, addImport, addImports, addImports, addImports, addImportsForPropertyType, addImportsToOneOfInterface, additionalProperties, addOneOfInterfaceModel, addOneOfNameExtension, addOperationToGroup, addOption, addOption, addParentContainer, addParentFromContainer, addProperties, addRegularExpressionDelimiter, addRequiredVarsMap, addSwitch, addVars, addVars, addVarsRequiredVarsAdditionalProps, apiDocFileFolder, apiDocFilename, apiDocTemplateFiles, apiFilename, apiFilename, apiPackage, apiTemplateFiles, apiTestFileFolder, apiTestFilename, apiTestTemplateFiles, buildEnumVars, buildLibraryCliOption, cliOptions, convertPropertyToBoolean, convertPropertyToBooleanAndWriteBack, createDiscriminator, defaultIncludes, defaultTemplatingEngine, embeddedTemplateDir, encodePath, enumNameMapping, escapeText, escapeTextWhileAllowingNewLines, fileSuffix, findCommonPrefixOfVars, findMethodResponse, fromCallback, fromFormProperty, fromModel, fromOperation, fromParameter, fromProperty, fromProperty, fromRequestBody, fromRequestBodyToFormParameters, fromResponse, fromSecurity, fromServers, fromServerVariables, generateExamplePath, generateJSONSpecFile, generateYAMLSpecFile, generatorLanguageVersion, getAdditionalPropertiesName, getAddSuffixToDuplicateOperationNicknames, 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, getItemsName, getLegacyDiscriminatorBehavior, getLibrary, getModelNamePrefix, getModelNameSuffix, getModelNameToSchemaCache, getMostInnerItems, getOneOfAnyOfDescendants, getOpenAPIGeneratorIgnoreList, getOrGenerateOperationId, getOutputDir, getParameterDataType, getPrependFormOrBodyParameters, getProducesInfo, getReleaseNote, getRemoveOperationIdPrefixCount, getRemoveOperationIdPrefixDelimiter, getSchemaAdditionalProperties, getSchemaFromBooleanOrSchema, getSchemaItems, getSingleSchemaType, getSortModelPropertiesByRequiredFlag, getSortParamsByRequiredFlag, getSupportedVendorExtensions, getSymbolName, getTemplatingEngine, getterAndSetterCapitalize, getTypeDeclaration, getUseInlineModelResolver, getUseOneOfInterfaces, getUseOpenAPINormalizer, getVersionMetadataFilename, handleConstantParams, handleMethodResponse, handleMethodResponse, handleSpecialCharacters, hasBodyParameter, hasFormParameter, importMapping, initializeSpecialCharacterMapping, inlineSchemaNameMapping, inlineSchemaOption, instantiationTypes, isAnyTypeSchema, isDataTypeBinary, isDataTypeFile, isDataTypeString, isEnableMinimalUpdate, isEnablePostProcessFile, isHideGenerationTimestamp, isJsonMimeType, isJsonVendorMimeType, isLibrary, isParameterNameUnique, isPropertyInnerMostEnum, isRemoveEnumValuePrefix, isRemoveOperationIdPrefix, isReservedWord, isSkipOperationExample, isSkipOverwrite, isStrictSpecBehavior, isXmlMimeType, languageSpecificPrimitives, lowerCamelCase, modelDocFileFolder, modelDocTemplateFiles, modelFilename, modelFilename, modelNameMapping, modelPackage, modelTemplateFiles, modelTestFileFolder, modelTestTemplateFiles, modifyFeatureSet, nameMapping, needToImport, openapiGeneratorIgnoreList, openapiNormalizer, outputFolder, parameterNameMapping, postProcess, postProcessEnumVars, postProcessModelProperty, postProcessModelsEnum, postProcessParameter, postProcessResponseWithProperty, postProcessWebhooksWithModels, preprocessOpenAPI, processOpenAPI, processTemplatingEngine, processTestExampleData, removeImport, removeNonNameElementToCamelCase, removeNonNameElementToCamelCase, removeOption, removeSelfReferenceImports, reservedWords, reservedWordsMappings, sanitizeName, sanitizeName, sanitizeName, sanitizeTag, schemaMapping, serverVariableOverrides, setAddProps, setAllowUnicodeIdentifiers, setApiNamePrefix, setApiNameSuffix, setApiPackage, setAutosetConstants, setCircularReferences, setDisallowAdditionalPropertiesIfNotPresent, setDocExtension, setEnableMinimalUpdate, setEnablePostProcessFile, setEnsureUniqueParams, setEnumUnknownDefaultCase, setFilesMetadataFilename, setGitHost, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLegacyDiscriminatorBehavior, setLibrary, setModelNamePrefix, setModelNameSuffix, setModelPackage, setNonArrayMapProperty, setOpenAPI, setOutputDir, setParameterBooleanFlagWithCodegenProperty, setParameterEncodingValues, setParameterExamples, setParameterExampleValue, setParameterExampleValue, setParameterExampleValue, setParameterNullable, setPrependFormOrBodyParameters, setReleaseNote, setRemoveEnumValuePrefix, setRemoveOperationIdPrefix, setRemoveOperationIdPrefixCount, setRemoveOperationIdPrefixDelimiter, setReservedWordsLowerCase, setSkipOperationExample, setSkipOverwrite, setSortModelPropertiesByRequiredFlag, setSortParamsByRequiredFlag, setStrictSpecBehavior, setTemplateDir, setTemplatingEngine, setUseOneOfInterfaces, setVersionMetadataFilename, shouldAddImport, shouldOverwrite, specVersionGreaterThanOrEqualTo310, supportedLibraries, supportingFiles, templateDir, templateOutputDirs, testPackage, toAllOfName, toAnyOfName, toApiDocFilename, toApiFilename, toApiImport, toApiName, toApiTestFilename, toApiVarName, toArrayModelParamName, toBooleanGetter, toDefaultParameterValue, toDefaultParameterValue, toDefaultValue, toDefaultValueWithParam, toEnumDefaultValue, toEnumValue, toExamples, toExampleValue, toGetter, toMediaTypeSchemaName, toModelDocFilename, toModelImport, toModelImportMap, toModelTestFilename, toOneOfName, toParamName, toRegularExpression, toSetter, toTestCaseName, typeMapping, unaliasPropertySchema, unaliasSchema, updateAllModels, updateCodegenPropertyEnum, updateDataTypeWithEnumForArray, updateDataTypeWithEnumForMap, updateEnumVarsWithExtensions, updateModelForAnyType, updateModelForComposedSchema, updateModelForInteger, updateModelForNumber, updateModelForObject, updateModelForString, updateOption, updateParameterForString, updatePropertyForAnyType, updatePropertyForArray, updatePropertyForInteger, updatePropertyForMap, updatePropertyForMap, updatePropertyForNumber, updatePropertyForObject, updatePropertyForString, updateRequestBodyForArray, updateRequestBodyForMap, updateRequestBodyForObject, updateRequestBodyForPrimitiveType, updateRequestBodyForString, vendorExtensions, writePropertyBack
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openapitools.codegen.CodegenConfig
additionalProperties, addOperationToGroup, apiDocFileFolder, apiDocFilename, apiDocTemplateFiles, apiFileFolder, apiFilename, apiFilename, apiPackage, apiTemplateFiles, apiTestFileFolder, apiTestFilename, apiTestTemplateFiles, cliOptions, defaultIncludes, defaultTemplatingEngine, embeddedTemplateDir, encodePath, enumNameMapping, escapeQuotationMark, escapeReservedWord, escapeText, escapeTextWhileAllowingNewLines, escapeUnsafeCharacters, fileSuffix, fromModel, fromOperation, fromSecurity, fromServers, fromServerVariables, generateExamplePath, generatorLanguage, generatorLanguageVersion, getAddSuffixToDuplicateOperationNicknames, getDocExtension, getFeatureSet, getFilesMetadataFilename, getGeneratorMetadata, getGitHost, getGitRepoId, getGitUserId, getHttpUserAgent, getIgnoreFilePathOverride, getInputSpec, getLibrary, getOpenAPIGeneratorIgnoreList, getOutputDir, getReleaseNote, getSupportedVendorExtensions, getTemplatingEngine, getTypeDeclaration, getTypeDeclaration, getUseInlineModelResolver, getUseOpenAPINormalizer, getVersionMetadataFilename, importMapping, inlineSchemaNameMapping, inlineSchemaOption, instantiationTypes, isEnableMinimalUpdate, isEnablePostProcessFile, isHideGenerationTimestamp, isRemoveEnumValuePrefix, isRemoveOperationIdPrefix, isSkipOperationExample, isSkipOverwrite, isStrictSpecBehavior, languageSpecificPrimitives, modelDocFileFolder, modelDocTemplateFiles, modelFileFolder, modelFilename, modelFilename, modelNameMapping, modelPackage, modelTemplateFiles, modelTestFileFolder, modelTestTemplateFiles, nameMapping, openapiGeneratorIgnoreList, openapiNormalizer, outputFolder, parameterNameMapping, postProcess, postProcessFile, postProcessModelProperty, postProcessModels, postProcessParameter, postProcessResponseWithProperty, postProcessWebhooksWithModels, preprocessOpenAPI, processCompiler, processOpenAPI, processTemplatingEngine, reservedWords, reservedWordsMappings, sanitizeName, sanitizeTag, schemaMapping, serverVariableOverrides, setDocExtension, setEnableMinimalUpdate, setEnablePostProcessFile, setGitHost, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLibrary, setOpenAPI, setOutputDir, setReleaseNote, setRemoveEnumValuePrefix, setRemoveOperationIdPrefix, setSkipOperationExample, setSkipOverwrite, setStrictSpecBehavior, setTemplatingEngine, shouldOverwrite, supportedLibraries, supportingFiles, templateDir, templateOutputDirs, testPackage, toApiDocFilename, toApiFilename, toApiImport, toApiName, toApiTestFilename, toApiVarName, toBooleanGetter, toGetter, toModelDocFilename, toModelFilename, toModelImport, toModelImportMap, toModelName, toModelTestFilename, toParamName, toSetter, typeMapping, unaliasSchema, updateAllModels, vendorExtensions
-
-
-
-
Field Detail
-
TITLE
public static final String TITLE
- See Also:
- Constant Field Values
-
SKIP_STUBS
public static final String SKIP_STUBS
- See Also:
- Constant Field Values
-
SUPPORT_ASYNC
public static final String SUPPORT_ASYNC
- See Also:
- Constant Field Values
-
GENERATE_CUSTOM_EXCEPTIONS
public static final String GENERATE_CUSTOM_EXCEPTIONS
- See Also:
- Constant Field Values
-
USE_SWAGGER_UI
public static final String USE_SWAGGER_UI
- See Also:
- Constant Field Values
-
ROUTES_FILE_NAME
public static final String ROUTES_FILE_NAME
- See Also:
- Constant Field Values
-
BASE_PACKAGE
public static final String BASE_PACKAGE
- See Also:
- Constant Field Values
-
skipStubs
protected boolean skipStubs
-
supportAsync
protected boolean supportAsync
-
generateCustomExceptions
protected boolean generateCustomExceptions
-
useSwaggerUI
protected boolean useSwaggerUI
-
routesFileName
protected String routesFileName
-
basePackage
protected String basePackage
-
-
Method Detail
-
getTag
public CodegenType getTag()
- Specified by:
getTag
in interfaceCodegenConfig
- Overrides:
getTag
in classDefaultCodegen
-
getName
public String getName()
- Specified by:
getName
in interfaceCodegenConfig
- Overrides:
getName
in classDefaultCodegen
-
getHelp
public String getHelp()
- Specified by:
getHelp
in interfaceCodegenConfig
- Overrides:
getHelp
in classDefaultCodegen
-
setSupportAsync
public void setSupportAsync(boolean supportAsync)
-
setSkipStubs
public void setSkipStubs(boolean skipStubs)
-
setGenerateCustomExceptions
public void setGenerateCustomExceptions(boolean generateCustomExceptions)
-
setRoutesFileName
public void setRoutesFileName(String routesFileName)
-
setBasePackage
public void setBasePackage(String basePackage)
-
setUseSwaggerUI
public void setUseSwaggerUI(boolean useSwaggerUI)
-
processOpts
public void processOpts()
- Specified by:
processOpts
in interfaceCodegenConfig
- Overrides:
processOpts
in classAbstractScalaCodegen
-
addMustacheLambdas
protected com.google.common.collect.ImmutableMap.Builder<String,com.samskivert.mustache.Mustache.Lambda> addMustacheLambdas()
Description copied from class:DefaultCodegen
Preset map builder with commonly used Mustache lambdas. To extend the map, override addMustacheLambdas(), call parent method first and then add additional lambdas to the returned builder. If common lambdas are not desired, override addMustacheLambdas() method and return empty builder.- Overrides:
addMustacheLambdas
in classDefaultCodegen
- Returns:
- preinitialized map with common lambdas
-
postProcessOperationsWithModels
public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels)
- Specified by:
postProcessOperationsWithModels
in interfaceCodegenConfig
- Overrides:
postProcessOperationsWithModels
in classDefaultCodegen
-
postProcessAllModels
public Map<String,ModelsMap> postProcessAllModels(Map<String,ModelsMap> objs)
- Specified by:
postProcessAllModels
in interfaceCodegenConfig
- Overrides:
postProcessAllModels
in classDefaultCodegen
-
postProcessSupportingFileData
public Map<String,Object> postProcessSupportingFileData(Map<String,Object> objs)
- Specified by:
postProcessSupportingFileData
in interfaceCodegenConfig
- Overrides:
postProcessSupportingFileData
in classDefaultCodegen
-
getSchemaType
public String getSchemaType(io.swagger.v3.oas.models.media.Schema p)
Description copied from class:DefaultCodegen
returns the OpenAPI type for the property. Use getAlias to handle $ref of primitive type- Overrides:
getSchemaType
in classAbstractScalaCodegen
- Parameters:
p
- property schema- Returns:
- string presentation of the type
-
toDefaultValue
public String toDefaultValue(io.swagger.v3.oas.models.media.Schema p)
Description copied from class:DefaultCodegen
Return the default value of the propertyThis method should be overridden in the generator to meet its requirement. Return null if you do NOT want a default value. Any non-null value will cause {{#defaultValue} check to pass.
- Overrides:
toDefaultValue
in classAbstractScalaCodegen
- Parameters:
p
- Property schema- Returns:
- string presentation of the default value of the property
-
toEnumName
public String toEnumName(CodegenProperty property)
Description copied from class:DefaultCodegen
Return the Enum name (e.g. StatusEnum given 'status')- Overrides:
toEnumName
in classDefaultCodegen
- Parameters:
property
- Codegen property- Returns:
- the Enum name
-
toEnumVarName
public String toEnumVarName(String value, String datatype)
Description copied from class:DefaultCodegen
Return the sanitized variable name for enum- Overrides:
toEnumVarName
in classDefaultCodegen
- Parameters:
value
- enum variable namedatatype
- data type- Returns:
- the sanitized variable name for enum
-
-