Class KotlinSpringServerCodegen
- java.lang.Object
-
- org.openapitools.codegen.DefaultCodegen
-
- org.openapitools.codegen.languages.AbstractKotlinCodegen
-
- org.openapitools.codegen.languages.KotlinSpringServerCodegen
-
- All Implemented Interfaces:
CodegenConfig,BeanValidationFeatures,DocumentationProviderFeatures,SwaggerUIFeatures
public class KotlinSpringServerCodegen extends AbstractKotlinCodegen implements BeanValidationFeatures, DocumentationProviderFeatures, SwaggerUIFeatures
OpenAPI Generator codegen implementation for Kotlin + Spring.Mustache templates are located in
src/main/resources/kotlin-spring/(root templates shared across all libraries) andsrc/main/resources/kotlin-spring/libraries/(library-specific overrides). A library-specific template shadows a root-level template of the same name.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classKotlinSpringServerCodegen.DeclarativeInterfaceReactiveModestatic classKotlinSpringServerCodegen.RequestMappingMode-
Nested classes/interfaces inherited from class org.openapitools.codegen.languages.AbstractKotlinCodegen
AbstractKotlinCodegen.CustomLambda, AbstractKotlinCodegen.DataTypeAssigner
-
Nested classes/interfaces inherited from interface org.openapitools.codegen.languages.features.DocumentationProviderFeatures
DocumentationProviderFeatures.AnnotationLibrary, DocumentationProviderFeatures.DocumentationProvider
-
-
Field Summary
-
Fields inherited from class org.openapitools.codegen.languages.AbstractKotlinCodegen
ADDITIONAL_MODEL_TYPE_ANNOTATIONS, additionalModelTypeAnnotations, apiDocPath, apiSuffix, artifactId, artifactVersion, enumPropertyNaming, groupId, IMPLICIT_HEADERS, implicitHeaders, JACKSON_PACKAGE, JACKSON2_PACKAGE, JACKSON3_PACKAGE, JAVAX_PACKAGE, MODEL_MUTABLE, MODEL_MUTABLE_DESC, modelDocPath, nonPublicApi, packageName, parcelizeModels, propertyAdditionalKeywords, resourcesFolder, SCHEMA_IMPLEMENTS, SCHEMA_IMPLEMENTS_FIELDS, schemaImplements, schemaImplementsFields, serializableModel, sourceFolder, testFolder, USE_JACKSON_3, USE_JAKARTA_EE, useJackson3, useJakartaEe, X_KOTLIN_IMPLEMENTS_FIELDS_SKIP, X_KOTLIN_IMPLEMENTS_SKIP, xKotlinImplementsFieldsSkip, xKotlinImplementsSkip
-
Fields inherited from class org.openapitools.codegen.DefaultCodegen
additionalProperties, addOneOfInterfaceImports, addOneOfInterfaces, addSuffixToDuplicateOperationNicknames, allowUnicodeIdentifiers, apiDocTemplateFiles, apiNamePrefix, apiNameSuffix, apiPackage, apiTemplateFiles, apiTestTemplateFiles, autosetConstants, cliOptions, DefaultFeatureSet, defaultIncludes, defaultToEmptyContainer, 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, operationIdNameMapping, outputFolder, parameterNameMapping, prependFormOrBodyParameters, releaseNote, removeEnumValuePrefix, removeOperationIdPrefix, removeOperationIdPrefixCount, removeOperationIdPrefixDelimiter, reservedWords, reservedWordsMappings, schemaMapping, serverVariables, skipOperationExample, skipOverwrite, skipSortingOperations, sortModelPropertiesByRequiredFlag, sortParamsByRequiredFlag, specialCharReplacements, SPLIT_ON_SEMICOLON_OR_NEWLINE_REGEX, strictSpecBehavior, supportedLibraries, supportingFiles, supportsAdditionalPropertiesWithComposedSchema, supportsInheritance, supportsMixins, supportsMultipleInheritance, templateDir, templateOutputDirs, testPackage, trueSchema, typeAliases, typeMapping, useOneOfInterfaces, vendorExtensions, versionMetadataFilename, XML_MIME_PATTERN
-
Fields inherited from interface org.openapitools.codegen.languages.features.BeanValidationFeatures
USE_BEANVALIDATION
-
Fields inherited from interface org.openapitools.codegen.languages.features.DocumentationProviderFeatures
ANNOTATION_LIBRARY, DOCUMENTATION_PROVIDER
-
Fields inherited from interface org.openapitools.codegen.languages.features.SwaggerUIFeatures
USE_SWAGGER_UI
-
-
Constructor Summary
Constructors Constructor Description KotlinSpringServerCodegen()
-
Method Summary
-
Methods inherited from class org.openapitools.codegen.languages.AbstractKotlinCodegen
apiDocFileFolder, apiFileFolder, apiTestFileFolder, applyJackson2Package, applyJackson3Package, applyJakartaPackage, applyJavaxPackage, doDataTypeAssignment, escapeQuotationMark, escapeReservedWord, escapeUnsafeCharacters, fromModel, generatorLanguage, getSchemaType, getTypeDeclaration, handleImplicitHeaders, isDataTypeString, isModelMutable, isReservedWord, modelDocFileFolder, modelFileFolder, modelTestFileFolder, nonPublicApi, postProcessFile, postProcessModels, setEnumPropertyNaming, toApiName, toDefaultParameterValue, toDefaultValue, toEnumName, toEnumValue, toEnumVarName, toModelFilename, toModelImport, toOperationId, toParamName, toRegularExpression, toVariableName, toVarName, updateModelForObject
-
Methods inherited from class org.openapitools.codegen.DefaultCodegen
addAdditionPropertiesToCodeGenModel, addBodyModelSchema, addHeaders, addImport, addImport, addImport, addImports, addImports, addImports, addImportsForPropertyType, additionalProperties, addOneOfInterfaceModel, addOneOfNameExtension, addOption, addOption, addParentContainer, addParentFromContainer, addProperties, addRegularExpressionDelimiter, addRequiredVarsMap, addSwitch, addVars, addVars, addVarsRequiredVarsAdditionalProps, apiDocFilename, apiDocTemplateFiles, apiFilename, apiFilename, apiPackage, apiTemplateFiles, apiTestFilename, apiTestTemplateFiles, buildEnumVars, buildLibraryCliOption, cliOptions, convertPropertyToBoolean, convertPropertyToBooleanAndWriteBack, convertPropertyToBooleanAndWriteBack, convertPropertyToStringAndWriteBack, convertPropertyToTypeAndWriteBack, createDiscriminator, defaultIncludes, defaultTemplatingEngine, embeddedTemplateDir, encodePath, enumNameMapping, escapeText, escapeTextInSingleQuotes, escapeTextWhileAllowingNewLines, executePostProcessor, fileSuffix, findCommonPrefixOfVars, findMethodResponse, fromCallback, fromFormProperty, fromParameter, fromProperty, fromProperty, fromProperty, fromRequestBody, fromRequestBodyToFormParameters, fromResponse, fromSecurity, fromServers, fromServerVariables, generateExamplePath, generateJSONSpecFile, generateYAMLSpecFile, generatorLanguageVersion, getAdditionalPropertiesName, getAddSuffixToDuplicateOperationNicknames, getAlias, getAllModels, getAllOfDescendants, getCollectionFormat, getCollectionFormat, getConsumesInfo, getContent, getContentType, getDisallowAdditionalPropertiesIfNotPresent, getDiscriminatorPropertyType, getDiscriminatorSchema, getDocExtension, getEnumDefaultValue, getEnumUnknownDefaultCase, getEnumValueForProperty, getFeatureSet, getFilesMetadataFilename, getGeneratorMetadata, getGitHost, getGitRepoId, getGitUserId, getHttpUserAgent, getIgnoreFilePathOverride, getInnerEnumAllowableValues, getInputSpec, getItemsName, getLegacyDiscriminatorBehavior, getLibrary, getModelNameToSchemaCache, getMostInnerItems, getObjectAsStringList, getObjectAsStringListMap, getObjectAsStringMap, getOneOfAnyOfDescendants, getOpenapiGeneratorIgnoreList, getOrGenerateOperationId, getOutputDir, getParameterDataType, getProducesInfo, getPropertyAsStringList, getPropertyAsStringListMap, getPropertyAsStringMap, getReleaseNote, getSchemaAdditionalProperties, getSchemaFromBooleanOrSchema, getSingleSchemaType, getSymbolName, getTemplatingEngine, getterAndSetterCapitalize, getTypeDeclaration, getUseInlineModelResolver, getUseOneOfInterfaces, getUseOpenapiNormalizer, getVersionMetadataFilename, handleConstantParams, handleMethodResponse, handleMethodResponse, handleSpecialCharacters, hasBodyParameter, hasFormParameter, importMapping, initializeSpecialCharacterMapping, inlineSchemaNameMapping, inlineSchemaOption, instantiationTypes, isDataTypeBinary, isDataTypeFile, isEnableMinimalUpdate, isEnablePostProcessFile, isHideGenerationTimestamp, isJsonMimeType, isJsonVendorMimeType, isLibrary, isParameterNameUnique, isPropertyInnerMostEnum, isRemoveEnumValuePrefix, isRemoveOperationIdPrefix, isSkipOperationExample, isSkipOverwrite, isSkipSortingOperations, isStrictSpecBehavior, isTypeErasedGenerics, isXmlMimeType, languageSpecificPrimitives, lowerCamelCase, modelDocTemplateFiles, modelFilename, modelFilename, modelNameMapping, modelPackage, modelTemplateFiles, modelTestTemplateFiles, modifyFeatureSet, nameMapping, openapiGeneratorIgnoreList, openapiNormalizer, operationIdNameMapping, outputFolder, parameterNameMapping, postProcess, postProcessEnumVars, postProcessParameter, postProcessResponseWithProperty, postProcessWebhooksWithModels, processCompiler, processOpenAPI, processTemplatingEngine, processTestExampleData, removeImport, removeNonNameElementToCamelCase, removeNonNameElementToCamelCase, removeOption, removeSelfReferenceImports, reservedWords, reservedWordsMappings, sanitizeName, sanitizeName, sanitizeName, sanitizeTag, schemaMapping, serverVariableOverrides, setAddProps, setCircularReferences, setDocExtension, setEnableMinimalUpdate, setEnablePostProcessFile, setEnumDiscriminatorDefaultValue, setGitHost, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLibrary, setNonArrayMapProperty, setOpenAPI, setOutputDir, setParameterBooleanFlagWithCodegenProperty, setParameterEncodingValues, setParameterExamples, setParameterExampleValue, setParameterExampleValue, setParameterExampleValue, setParameterNullable, setReleaseNote, setRemoveEnumValuePrefix, setRemoveOperationIdPrefix, setReservedWordsLowerCase, setSkipOperationExample, setSkipOverwrite, setSkipSortingOperations, setStrictSpecBehavior, setTemplatingEngine, setUseOneOfInterfaces, shouldAddImport, shouldOverwrite, SortModelPropertiesByRequiredFlag, SortParametersByRequiredFlag, specVersionGreaterThanOrEqualTo310, supportedLibraries, supportingFiles, templateDir, templateOutputDirs, testPackage, toAllOfName, toAnyOfName, toApiDocFilename, toApiFilename, toApiImport, toApiTestFilename, toApiVarName, toArrayModelParamName, toBooleanGetter, toDefaultParameterValue, toDefaultValue, toDefaultValueWithParam, toEnumDefaultValue, toEnumDefaultValue, toExamples, toExampleValue, toGetter, toInstantiationType, toMediaTypeSchemaName, toModelDocFilename, toModelImportMap, toModelTestFilename, toOneOfName, toSetter, toTestCaseName, typeMapping, unaliasPropertySchema, unaliasSchema, updateAllModels, updateCodegenPropertyEnum, updateDataTypeWithEnumForArray, updateDataTypeWithEnumForMap, updateEnumVarsWithExtensions, updateModelForAnyType, updateModelForComposedSchema, updateModelForInteger, updateModelForNumber, updateModelForString, updateOption, updateParameterForString, updatePropertyForAnyType, updatePropertyForArray, updatePropertyForInteger, updatePropertyForMap, updatePropertyForMap, updatePropertyForNumber, updatePropertyForObject, updatePropertyForString, updateRequestBodyForArray, updateRequestBodyForMap, updateRequestBodyForObject, updateRequestBodyForPrimitiveType, updateRequestBodyForString, useCodegenAsMustacheParentContext, 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, apiDocFilename, apiDocTemplateFiles, apiFilename, apiFilename, apiPackage, apiTemplateFiles, apiTestFilename, apiTestTemplateFiles, cliOptions, defaultIncludes, defaultTemplatingEngine, embeddedTemplateDir, encodePath, enumNameMapping, escapeText, escapeTextWhileAllowingNewLines, fileSuffix, fromSecurity, fromServers, fromServerVariables, generateExamplePath, generatorLanguageVersion, getAddSuffixToDuplicateOperationNicknames, getDocExtension, getFeatureSet, getFilesMetadataFilename, getGeneratorMetadata, getGitHost, getGitRepoId, getGitUserId, getHttpUserAgent, getIgnoreFilePathOverride, getInputSpec, getLibrary, getOpenapiGeneratorIgnoreList, getOutputDir, getReleaseNote, getTemplatingEngine, getTypeDeclaration, getUseInlineModelResolver, getUseOpenapiNormalizer, getVersionMetadataFilename, importMapping, inlineSchemaNameMapping, inlineSchemaOption, instantiationTypes, isEnableMinimalUpdate, isEnablePostProcessFile, isHideGenerationTimestamp, isRemoveEnumValuePrefix, isRemoveOperationIdPrefix, isSkipOperationExample, isSkipOverwrite, isSkipSortingOperations, isStrictSpecBehavior, isTypeErasedGenerics, languageSpecificPrimitives, modelDocTemplateFiles, modelFilename, modelFilename, modelNameMapping, modelPackage, modelTemplateFiles, modelTestTemplateFiles, nameMapping, openapiGeneratorIgnoreList, openapiNormalizer, operationIdNameMapping, outputFolder, parameterNameMapping, postProcess, postProcessParameter, postProcessResponseWithProperty, postProcessWebhooksWithModels, 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, setSkipSortingOperations, setStrictSpecBehavior, setTemplatingEngine, shouldOverwrite, supportedLibraries, supportingFiles, templateDir, templateOutputDirs, testPackage, toApiDocFilename, toApiFilename, toApiImport, toApiTestFilename, toApiVarName, toBooleanGetter, toGetter, toModelDocFilename, toModelImportMap, toModelTestFilename, toSetter, typeMapping, unaliasSchema, updateAllModels, vendorExtensions
-
-
-
-
Field Detail
-
TITLE
public static final String TITLE
- See Also:
- Constant Field Values
-
SERVER_PORT
public static final String SERVER_PORT
- See Also:
- Constant Field Values
-
CONFIG_PACKAGE
public static final String CONFIG_PACKAGE
- See Also:
- Constant Field Values
-
BASE_PACKAGE
public static final String BASE_PACKAGE
- See Also:
- Constant Field Values
-
SPRING_BOOT
public static final String SPRING_BOOT
- See Also:
- Constant Field Values
-
SPRING_CLOUD_LIBRARY
public static final String SPRING_CLOUD_LIBRARY
- See Also:
- Constant Field Values
-
SPRING_DECLARATIVE_HTTP_INTERFACE_LIBRARY
public static final String SPRING_DECLARATIVE_HTTP_INTERFACE_LIBRARY
- See Also:
- Constant Field Values
-
EXCEPTION_HANDLER
public static final String EXCEPTION_HANDLER
- See Also:
- Constant Field Values
-
GRADLE_BUILD_FILE
public static final String GRADLE_BUILD_FILE
- See Also:
- Constant Field Values
-
SERVICE_INTERFACE
public static final String SERVICE_INTERFACE
- See Also:
- Constant Field Values
-
SERVICE_IMPLEMENTATION
public static final String SERVICE_IMPLEMENTATION
- See Also:
- Constant Field Values
-
SKIP_DEFAULT_INTERFACE
public static final String SKIP_DEFAULT_INTERFACE
- See Also:
- Constant Field Values
-
SKIP_DEFAULT_API_INTERFACE
public static final String SKIP_DEFAULT_API_INTERFACE
- See Also:
- Constant Field Values
-
SKIP_DEFAULT_DELEGATE_INTERFACE
public static final String SKIP_DEFAULT_DELEGATE_INTERFACE
- See Also:
- Constant Field Values
-
REACTIVE
public static final String REACTIVE
- See Also:
- Constant Field Values
-
INTERFACE_ONLY
public static final String INTERFACE_ONLY
- See Also:
- Constant Field Values
-
USE_FEIGN_CLIENT_URL
public static final String USE_FEIGN_CLIENT_URL
- See Also:
- Constant Field Values
-
USE_FEIGN_CLIENT
public static final String USE_FEIGN_CLIENT
- See Also:
- Constant Field Values
-
DELEGATE_PATTERN
public static final String DELEGATE_PATTERN
- See Also:
- Constant Field Values
-
USE_TAGS
public static final String USE_TAGS
- See Also:
- Constant Field Values
-
BEAN_QUALIFIERS
public static final String BEAN_QUALIFIERS
- See Also:
- Constant Field Values
-
USE_RESPONSE_ENTITY
public static final String USE_RESPONSE_ENTITY
- See Also:
- Constant Field Values
-
DECLARATIVE_INTERFACE_REACTIVE_MODE
public static final String DECLARATIVE_INTERFACE_REACTIVE_MODE
- See Also:
- Constant Field Values
-
USE_SPRING_BOOT3
public static final String USE_SPRING_BOOT3
- See Also:
- Constant Field Values
-
USE_SPRING_BOOT4
public static final String USE_SPRING_BOOT4
- See Also:
- Constant Field Values
-
INCLUDE_HTTP_REQUEST_CONTEXT
public static final String INCLUDE_HTTP_REQUEST_CONTEXT
- See Also:
- Constant Field Values
-
USE_FLOW_FOR_ARRAY_RETURN_TYPE
public static final String USE_FLOW_FOR_ARRAY_RETURN_TYPE
- See Also:
- Constant Field Values
-
REQUEST_MAPPING_OPTION
public static final String REQUEST_MAPPING_OPTION
- See Also:
- Constant Field Values
-
USE_REQUEST_MAPPING_ON_CONTROLLER
public static final String USE_REQUEST_MAPPING_ON_CONTROLLER
- See Also:
- Constant Field Values
-
USE_REQUEST_MAPPING_ON_INTERFACE
public static final String USE_REQUEST_MAPPING_ON_INTERFACE
- See Also:
- Constant Field Values
-
AUTO_X_SPRING_PAGINATED
public static final String AUTO_X_SPRING_PAGINATED
- See Also:
- Constant Field Values
-
GENERATE_SORT_VALIDATION
public static final String GENERATE_SORT_VALIDATION
- See Also:
- Constant Field Values
-
GENERATE_PAGEABLE_CONSTRAINT_VALIDATION
public static final String GENERATE_PAGEABLE_CONSTRAINT_VALIDATION
- See Also:
- Constant Field Values
-
SUBSTITUTE_GENERIC_PAGED_MODEL
public static final String SUBSTITUTE_GENERIC_PAGED_MODEL
- See Also:
- Constant Field Values
-
USE_SEALED_RESPONSE_INTERFACES
public static final String USE_SEALED_RESPONSE_INTERFACES
- See Also:
- Constant Field Values
-
COMPANION_OBJECT
public static final String COMPANION_OBJECT
- See Also:
- Constant Field Values
-
configPackage
protected String configPackage
-
useFeignClientUrl
protected boolean useFeignClientUrl
-
useFeignClient
protected boolean useFeignClient
-
useTags
protected boolean useTags
-
useSpringBoot3
protected boolean useSpringBoot3
-
useSpringBoot4
protected boolean useSpringBoot4
-
requestMappingMode
protected KotlinSpringServerCodegen.RequestMappingMode requestMappingMode
-
-
Method Detail
-
getDocumentationProvider
public DocumentationProviderFeatures.DocumentationProvider getDocumentationProvider()
- Specified by:
getDocumentationProviderin interfaceDocumentationProviderFeatures
-
setDocumentationProvider
public void setDocumentationProvider(DocumentationProviderFeatures.DocumentationProvider documentationProvider)
- Specified by:
setDocumentationProviderin interfaceDocumentationProviderFeatures
-
getAnnotationLibrary
public DocumentationProviderFeatures.AnnotationLibrary getAnnotationLibrary()
- Specified by:
getAnnotationLibraryin interfaceDocumentationProviderFeatures
-
setAnnotationLibrary
public void setAnnotationLibrary(DocumentationProviderFeatures.AnnotationLibrary annotationLibrary)
- Specified by:
setAnnotationLibraryin interfaceDocumentationProviderFeatures
-
defaultDocumentationProvider
public DocumentationProviderFeatures.DocumentationProvider defaultDocumentationProvider()
Description copied from interface:DocumentationProviderFeaturesDefine the default documentation Provider for CliOpts processing. A NULL return value will disable the documentation provider support. Override in subclasses to customize.- Specified by:
defaultDocumentationProviderin interfaceDocumentationProviderFeatures- Returns:
- the default documentation provider
-
supportedDocumentationProvider
public List<DocumentationProviderFeatures.DocumentationProvider> supportedDocumentationProvider()
Description copied from interface:DocumentationProviderFeaturesDefine the List of supported documentation Provider for CliOpts processing. Override in subclasses to customize.- Specified by:
supportedDocumentationProviderin interfaceDocumentationProviderFeatures- Returns:
- the list of supported documentation provider
-
supportedAnnotationLibraries
public List<DocumentationProviderFeatures.AnnotationLibrary> supportedAnnotationLibraries()
Description copied from interface:DocumentationProviderFeaturesDefine the list of supported annotation libraries for CliOpts processing. Override in subclasses to customize.- Specified by:
supportedAnnotationLibrariesin interfaceDocumentationProviderFeatures- Returns:
- the list of supported annotation libraries
-
getExceptionHandler
public boolean getExceptionHandler()
-
getGradleBuildFile
public boolean getGradleBuildFile()
-
getUseSwaggerUI
public boolean getUseSwaggerUI()
-
setUseSwaggerUI
public void setUseSwaggerUI(boolean useSwaggerUI)
- Specified by:
setUseSwaggerUIin interfaceSwaggerUIFeatures
-
getServiceInterface
public boolean getServiceInterface()
-
getServiceImplementation
public boolean getServiceImplementation()
-
getUseBeanValidation
public boolean getUseBeanValidation()
-
setUseBeanValidation
public void setUseBeanValidation(boolean useBeanValidation)
- Specified by:
setUseBeanValidationin interfaceBeanValidationFeatures
-
getTag
public CodegenType getTag()
- Specified by:
getTagin interfaceCodegenConfig- Overrides:
getTagin classDefaultCodegen
-
getName
public String getName()
- Specified by:
getNamein interfaceCodegenConfig- Overrides:
getNamein classDefaultCodegen
-
getHelp
public String getHelp()
- Specified by:
getHelpin interfaceCodegenConfig- Overrides:
getHelpin classDefaultCodegen
-
processOpts
public void processOpts()
- Specified by:
processOptsin interfaceCodegenConfig- Overrides:
processOptsin classAbstractKotlinCodegen
-
addMustacheLambdas
protected com.google.common.collect.ImmutableMap.Builder<String,com.samskivert.mustache.Mustache.Lambda> addMustacheLambdas()
Description copied from class:DefaultCodegenPreset 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. Corresponding user documentation: docs/templating.md, section "Mustache Lambdas"- Overrides:
addMustacheLambdasin classAbstractKotlinCodegen- Returns:
- preinitialized map with common lambdas
-
addOperationToGroup
public void addOperationToGroup(String tag, String resourcePath, io.swagger.v3.oas.models.Operation operation, CodegenOperation co, Map<String,List<CodegenOperation>> operations)
Description copied from class:DefaultCodegenAdd operation to group- Specified by:
addOperationToGroupin interfaceCodegenConfig- Overrides:
addOperationToGroupin classDefaultCodegen- Parameters:
tag- name of the tagresourcePath- path of the resourceoperation- OAS Operation objectco- Codegen Operation objectoperations- map of Codegen operations
-
fromOperation
public CodegenOperation fromOperation(String path, String httpMethod, io.swagger.v3.oas.models.Operation operation, List<io.swagger.v3.oas.models.servers.Server> servers)
Processes operations to support the x-spring-paginated vendor extension. When x-spring-paginated is set to true on an operation, this method: - Adds org.springframework.data.domain.Pageable parameter to the method signature - Removes the default Spring Data Web pagination query parameters (page, size, sort) - Adds appropriate imports (Pageable, ParameterObject for springdoc) Auto-detection (when autoXSpringPaginated is enabled): - Automatically detects operations with 'page', 'size', and 'sort' query parameters (case-sensitive) - Applies x-spring-paginated behavior to these operations automatically - Respects manual x-spring-paginated: false setting (manual override takes precedence) - Only applies when library is spring-boot Note: x-spring-paginated is ONLY applied for server-side libraries (spring-boot). Client libraries (spring-cloud, spring-declarative-http-interface) need actual query parameters to send over HTTP, so the extension is ignored for them. Parameter ordering in generated methods: 1. Regular OpenAPI parameters (allParams) 2. Optional HttpServletRequest/ServerWebExchange (if includeHttpRequestContext is enabled) 3. Pageable parameter (if x-spring-paginated is true and library is spring-boot) This implementation mirrors the behavior in SpringCodegen for consistency.- Specified by:
fromOperationin interfaceCodegenConfig- Overrides:
fromOperationin classDefaultCodegen- Parameters:
path- the operation pathhttpMethod- the HTTP methodoperation- the OpenAPI operationservers- the list of servers- Returns:
- the processed CodegenOperation
-
preprocessOpenAPI
public void preprocessOpenAPI(io.swagger.v3.oas.models.OpenAPI openAPI)
- Specified by:
preprocessOpenAPIin interfaceCodegenConfig- Overrides:
preprocessOpenAPIin classDefaultCodegen
-
postProcessModelProperty
public void postProcessModelProperty(CodegenModel model, CodegenProperty property)
- Specified by:
postProcessModelPropertyin interfaceCodegenConfig- Overrides:
postProcessModelPropertyin classDefaultCodegen
-
addImportsToOneOfInterface
public void addImportsToOneOfInterface(List<Map<String,String>> imports)
- Overrides:
addImportsToOneOfInterfacein classDefaultCodegen
-
postProcessAllModels
public Map<String,ModelsMap> postProcessAllModels(Map<String,ModelsMap> objs)
- Specified by:
postProcessAllModelsin interfaceCodegenConfig- Overrides:
postProcessAllModelsin classAbstractKotlinCodegen
-
postProcessModelsEnum
public ModelsMap postProcessModelsEnum(ModelsMap objs)
Description copied from class:DefaultCodegenpost process enum defined in model's properties- Overrides:
postProcessModelsEnumin classDefaultCodegen- Parameters:
objs- Map of models- Returns:
- maps of models with better enum support
-
postProcessOperationsWithModels
public OperationsMap postProcessOperationsWithModels(OperationsMap objs, List<ModelMap> allModels)
- Specified by:
postProcessOperationsWithModelsin interfaceCodegenConfig- Overrides:
postProcessOperationsWithModelsin classAbstractKotlinCodegen
-
postProcessSupportingFileData
public Map<String,Object> postProcessSupportingFileData(Map<String,Object> objs)
- Specified by:
postProcessSupportingFileDatain interfaceCodegenConfig- Overrides:
postProcessSupportingFileDatain classDefaultCodegen
-
toModelName
public String toModelName(String name)
Output the proper model name (capitalized). In case the name belongs to the TypeSystem it won't be renamed.- Specified by:
toModelNamein interfaceCodegenConfig- Overrides:
toModelNamein classAbstractKotlinCodegen- Parameters:
name- the name of the model- Returns:
- capitalized model name
-
needToImport
protected boolean needToImport(String type)
Check the type to see if it needs import the library/module/package- Overrides:
needToImportin classAbstractKotlinCodegen- Parameters:
type- name of the type- Returns:
- true if the library/module/package of the corresponding type needs to be imported
-
getRequestMappingMode
public KotlinSpringServerCodegen.RequestMappingMode getRequestMappingMode()
-
setRequestMappingMode
public void setRequestMappingMode(KotlinSpringServerCodegen.RequestMappingMode requestMappingMode)
-
getSupportedVendorExtensions
public List<VendorExtension> getSupportedVendorExtensions()
- Specified by:
getSupportedVendorExtensionsin interfaceCodegenConfig- Overrides:
getSupportedVendorExtensionsin classDefaultCodegen
-
-