Package io.micronaut.openapi.generator
Class AbstractMicronautKotlinCodegen<T extends GeneratorOptionsBuilder>
java.lang.Object
org.openapitools.codegen.DefaultCodegen
org.openapitools.codegen.languages.AbstractKotlinCodegen
io.micronaut.openapi.generator.AbstractMicronautKotlinCodegen<T>
- Type Parameters:
T
- The generator options builder.
- All Implemented Interfaces:
MicronautCodeGenerator<T>
,org.openapitools.codegen.CodegenConfig
,org.openapitools.codegen.languages.features.BeanValidationFeatures
- Direct Known Subclasses:
KotlinMicronautClientCodegen
,KotlinMicronautServerCodegen
public abstract class AbstractMicronautKotlinCodegen<T extends GeneratorOptionsBuilder>
extends org.openapitools.codegen.languages.AbstractKotlinCodegen
implements org.openapitools.codegen.languages.features.BeanValidationFeatures, MicronautCodeGenerator<T>
Base generator for Micronaut.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openapitools.codegen.languages.AbstractKotlinCodegen
org.openapitools.codegen.languages.AbstractKotlinCodegen.DataTypeAssigner
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
protected String
static final String
static final String
static final String
static final String
protected String
protected String
protected String
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected String
protected boolean
protected String
protected boolean
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
protected List<ParameterMapping>
protected boolean
protected SecureRandom
protected boolean
protected boolean
protected List<ResponseBodyMapping>
protected String
protected String
protected String
protected boolean
protected boolean
protected boolean
Fields inherited from class org.openapitools.codegen.languages.AbstractKotlinCodegen
ADDITIONAL_MODEL_TYPE_ANNOTATIONS, additionalModelTypeAnnotations, apiDocPath, apiSuffix, artifactId, artifactVersion, enumPropertyNaming, groupId, JAVAX_PACKAGE, MODEL_MUTABLE, MODEL_MUTABLE_DESC, modelDocPath, nonPublicApi, packageName, parcelizeModels, propertyAdditionalKeywords, resourcesFolder, serializableModel, sourceFolder, testFolder, USE_JAKARTA_EE, useJakartaEe
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, operationIdNameMapping, outputFolder, parameterNameMapping, prependFormOrBodyParameters, releaseNote, removeEnumValuePrefix, removeOperationIdPrefix, removeOperationIdPrefixCount, removeOperationIdPrefixDelimiter, reservedWords, reservedWordsMappings, schemaMapping, serverVariables, skipOperationExample, skipOverwrite, skipSortingOperations, sortModelPropertiesByRequiredFlag, sortParamsByRequiredFlag, specialCharReplacements, 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEnumNameMapping
(Map<String, String> enumNameMapping) void
addImportMapping
(Map<String, String> importMapping) void
addInlineSchemaNameMapping
(Map<String, String> inlineSchemaNameMapping) void
addInlineSchemaOption
(Map<String, String> inlineSchemaOption) void
addModelNameMapping
(Map<String, String> modelNameMapping) protected com.google.common.collect.ImmutableMap.Builder<String,
com.samskivert.mustache.Mustache.Lambda> Preset map builder with commonly used Mustache lambdas.void
addNameMapping
(Map<String, String> nameMapping) void
addOpenapiNormalizer
(Map<String, String> openapiNormalizer) void
addOperationToGroup
(String tag, String resourcePath, io.swagger.v3.oas.models.Operation operation, org.openapitools.codegen.CodegenOperation co, Map<String, List<org.openapitools.codegen.CodegenOperation>> operations) Add operation to groupvoid
addParameterMappings
(List<ParameterMapping> parameterMappings) void
addResponseBodyMappings
(List<ResponseBodyMapping> responseBodyMappings) void
addSchemaMapping
(Map<String, String> schemaMapping) void
addTypeMapping
(Map<String, String> typeMapping) protected org.openapitools.codegen.CodegenDiscriminator
createDiscriminator
(String schemaName, io.swagger.v3.oas.models.media.Schema schema) org.openapitools.codegen.CodegenModel
Convert OAS Model object to Codegen Model object.org.openapitools.codegen.CodegenOperation
fromOperation
(String path, String httpMethod, io.swagger.v3.oas.models.Operation operation, List<io.swagger.v3.oas.models.servers.Server> servers) Convert OAS Operation object to Codegen Operation objectorg.openapitools.codegen.CodegenParameter
fromParameter
(io.swagger.v3.oas.models.parameters.Parameter p, Set<String> imports) Convert OAS Parameter object to Codegen Parameter objectorg.openapitools.codegen.CodegenProperty
fromProperty
(String name, io.swagger.v3.oas.models.media.Schema schema, boolean required, boolean schemaIsFromAdditionalProperties) Convert OAS Property object to Codegen Property object.org.openapitools.codegen.CodegenResponse
fromResponse
(String responseCode, io.swagger.v3.oas.models.responses.ApiResponse response) Convert OAS Response object to Codegen Response objectgetExampleValue
(String defaultValue, String example, String dataType, Boolean isModel, List<Object> allowableValues, String itemsType, String itemsExample, List<org.openapitools.codegen.CodegenProperty> requiredVars, boolean isProperty) protected String
getParameterExampleValue
(org.openapitools.codegen.CodegenParameter p) protected String
getPropertyExampleValue
(org.openapitools.codegen.CodegenProperty p) getTypeDeclaration
(io.swagger.v3.oas.models.media.Schema p) Output the type declaration of the property.boolean
protected void
handleImplicitHeaders
(org.openapitools.codegen.CodegenOperation operation) This method removes all implicit header parameters from the list of parameters.static boolean
abstract boolean
isServer()
boolean
void
postProcessAllModels
(Map<String, org.openapitools.codegen.model.ModelsMap> objs) org.openapitools.codegen.model.OperationsMap
postProcessOperationsWithModels
(org.openapitools.codegen.model.OperationsMap objs, List<org.openapitools.codegen.model.ModelMap> allModels) void
preprocessOpenAPI
(io.swagger.v3.oas.models.OpenAPI openApi) void
sanitizeTag
(String tag) Sanitize tagvoid
setAdditionalEnumTypeAnnotations
(List<String> additionalEnumTypeAnnotations) void
setAdditionalOneOfTypeAnnotations
(List<String> additionalOneOfTypeAnnotations) void
setApiPackage
(String apiPackage) void
setArtifactId
(String artifactId) void
setDateFormat
(String dateFormat) void
setDateTimeFormat
(String dateTimeFormat) void
setDateTimeLibrary
(String name) void
setFluxForArrays
(boolean fluxForArrays) void
setGeneratedAnnotation
(boolean generatedAnnotation) void
setGenerateHttpResponseAlways
(boolean generateHttpResponseAlways) void
setGenerateHttpResponseWhereRequired
(boolean generateHttpResponseWhereRequired) void
setGenerateSwaggerAnnotations
(boolean generateSwaggerAnnotations) void
setImplicitHeaders
(boolean implicitHeaders) void
setImplicitHeadersRegex
(String implicitHeadersRegex) void
setKsp
(boolean ksp) void
setModelPackage
(String modelPackage) void
setPackageName
(String packageName) void
setParameterExampleValue
(org.openapitools.codegen.CodegenParameter p) Return the example value of the parameter.void
setParameterExampleValue
(org.openapitools.codegen.CodegenParameter codegenParameter, io.swagger.v3.oas.models.parameters.Parameter parameter) Return the example value of the parameter.void
setPlural
(boolean plural) void
setReactive
(boolean reactive) void
setSerializationLibrary
(String serializationLibrary) void
setTestTool
(String testTool) void
setUseBeanValidation
(boolean useBeanValidation) void
setUseEnumCaseInsensitive
(boolean useEnumCaseInsensitive) void
setUseOneOfInterfaces
(Boolean useOneOfInterfaces) void
setVisitable
(boolean visitable) superSanitizeTag
(String tag) Output the API (class) name (capitalized) ending with the specified or default suffix Return DefaultApi if name is emptytoApiTestFilename
(String name) Return the file name of the Api TesttoApiVarName
(String name) Return the variable name in the ApitoDefaultValue
(org.openapitools.codegen.CodegenProperty cp, io.swagger.v3.oas.models.media.Schema schema) Return the default value of the propertytoEnumValue
(String value, String datatype) Return the enum value in the language specified format e.g.toEnumVarName
(String value, String datatype) Return the sanitized variable name for enumtoModelName
(String name) Converts the OpenAPI schema name to a model name suitable for the current code generator.toModelTestFilename
(String name) Return the capitalized file name of the model testReturn the variable name by removing invalid characters and proper escaping if it's a reserved word.protected void
updateEnumVarsWithExtensions
(List<Map<String, Object>> enumVars, Map<String, Object> vendorExtensions, String dataType) Methods inherited from class org.openapitools.codegen.languages.AbstractKotlinCodegen
apiDocFileFolder, apiFileFolder, applyJakartaPackage, applyJavaxPackage, doDataTypeAssignment, escapeQuotationMark, escapeReservedWord, escapeUnsafeCharacters, generatorLanguage, getAdditionalModelTypeAnnotations, getEnumPropertyNaming, getParcelizeModels, getSchemaType, isDataTypeString, isModelMutable, isReservedWord, isSerializableModel, modelDocFileFolder, modelFileFolder, needToImport, nonPublicApi, postProcessFile, postProcessModels, setAdditionalModelTypeAnnotations, setApiSuffix, setArtifactVersion, setEnumPropertyNaming, setGroupId, setNonPublicApi, setParcelizeModels, setSerializableModel, setSourceFolder, setTestFolder, setUseJakartaEe, toDefaultParameterValue, toEnumName, toModelFilename, toModelImport, toOperationId, toParamName, toRegularExpression, toVariableName, updateModelForObject
Methods inherited from class org.openapitools.codegen.DefaultCodegen
addAdditionPropertiesToCodeGenModel, addBodyModelSchema, addHeaders, addImport, addImport, addImport, addImports, addImports, addImports, addImportsForPropertyType, addImportsToOneOfInterface, 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, defaultIncludes, defaultTemplatingEngine, embeddedTemplateDir, encodePath, enumNameMapping, escapeText, escapeTextWhileAllowingNewLines, executePostProcessor, fileSuffix, findCommonPrefixOfVars, findMethodResponse, fromCallback, fromFormProperty, fromProperty, fromProperty, fromRequestBody, fromRequestBodyToFormParameters, 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, getHelp, getHttpUserAgent, getIgnoreFilePathOverride, getInnerEnumAllowableValues, getInputSpec, getItemsName, getLegacyDiscriminatorBehavior, getLibrary, getModelNamePrefix, getModelNameSuffix, getModelNameToSchemaCache, getMostInnerItems, getName, getOneOfAnyOfDescendants, getOpenapiGeneratorIgnoreList, getOrGenerateOperationId, getOutputDir, getParameterDataType, getPrependFormOrBodyParameters, getProducesInfo, getReleaseNote, getRemoveOperationIdPrefixCount, getRemoveOperationIdPrefixDelimiter, getSchemaAdditionalProperties, getSchemaFromBooleanOrSchema, getSingleSchemaType, getSortModelPropertiesByRequiredFlag, getSortParamsByRequiredFlag, getSupportedVendorExtensions, getSymbolName, getTag, getTemplatingEngine, getterAndSetterCapitalize, getTypeDeclaration, 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, postProcessEnumVars, postProcessModelProperty, postProcessModelsEnum, postProcessParameter, postProcessResponseWithProperty, postProcessSupportingFileData, postProcessWebhooksWithModels, processCompiler, processOpenAPI, processTemplatingEngine, processTestExampleData, removeImport, removeNonNameElementToCamelCase, removeNonNameElementToCamelCase, removeOption, removeSelfReferenceImports, reservedWords, reservedWordsMappings, sanitizeName, sanitizeName, sanitizeName, schemaMapping, serverVariableOverrides, setAddProps, setAllowUnicodeIdentifiers, setApiNamePrefix, setApiNameSuffix, setAutosetConstants, setCircularReferences, setDisallowAdditionalPropertiesIfNotPresent, setDocExtension, setEnableMinimalUpdate, setEnablePostProcessFile, setEnsureUniqueParams, setEnumUnknownDefaultCase, setFilesMetadataFilename, setGitHost, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLegacyDiscriminatorBehavior, setLibrary, setModelNamePrefix, setModelNameSuffix, setNonArrayMapProperty, setOpenAPI, setOutputDir, setParameterBooleanFlagWithCodegenProperty, setParameterEncodingValues, setParameterExamples, setParameterExampleValue, setParameterNullable, setPrependFormOrBodyParameters, setReleaseNote, setRemoveEnumValuePrefix, setRemoveOperationIdPrefix, setRemoveOperationIdPrefixCount, setRemoveOperationIdPrefixDelimiter, setReservedWordsLowerCase, setSkipOperationExample, setSkipOverwrite, setSkipSortingOperations, setSortModelPropertiesByRequiredFlag, setSortParamsByRequiredFlag, setStrictSpecBehavior, setTemplateDir, setTemplatingEngine, setVersionMetadataFilename, shouldAddImport, shouldOverwrite, SortModelPropertiesByRequiredFlag, SortParametersByRequiredFlag, specVersionGreaterThanOrEqualTo310, supportedLibraries, supportingFiles, templateDir, templateOutputDirs, testPackage, toAllOfName, toAnyOfName, toApiDocFilename, toApiFilename, toApiImport, toArrayModelParamName, toBooleanGetter, toDefaultParameterValue, toDefaultValue, toDefaultValueWithParam, toEnumDefaultValue, toEnumDefaultValue, toExamples, toExampleValue, toGetter, toInstantiationType, toMediaTypeSchemaName, toModelDocFilename, toModelImportMap, toOneOfName, toSetter, toTestCaseName, typeMapping, unaliasPropertySchema, unaliasSchema, updateAllModels, updateCodegenPropertyEnum, updateDataTypeWithEnumForArray, updateDataTypeWithEnumForMap, 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, getHelp, getHttpUserAgent, getIgnoreFilePathOverride, getInputSpec, getLibrary, getName, getOpenapiGeneratorIgnoreList, getOutputDir, getReleaseNote, getSupportedVendorExtensions, getTag, getTemplatingEngine, getTypeDeclaration, 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, postProcessModelProperty, postProcessParameter, postProcessResponseWithProperty, postProcessSupportingFileData, postProcessWebhooksWithModels, processCompiler, processOpenAPI, processTemplatingEngine, reservedWords, reservedWordsMappings, sanitizeName, 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, toBooleanGetter, toGetter, toModelDocFilename, toModelImportMap, toSetter, typeMapping, unaliasSchema, updateAllModels, vendorExtensions
Methods inherited from interface io.micronaut.openapi.generator.MicronautCodeGenerator
optionsBuilder
-
Field Details
-
OPT_TITLE
- See Also:
-
OPT_TEST
- See Also:
-
OPT_TEST_JUNIT
- See Also:
-
OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR
- See Also:
-
OPT_USE_AUTH
- See Also:
-
OPT_USE_PLURAL
- See Also:
-
OPT_FLUX_FOR_ARRAYS
- See Also:
-
OPT_GENERATED_ANNOTATION
- See Also:
-
OPT_VISITABLE
- See Also:
-
OPT_DATE_LIBRARY_ZONED_DATETIME
- See Also:
-
OPT_DATE_LIBRARY_OFFSET_DATETIME
- See Also:
-
OPT_DATE_LIBRARY_LOCAL_DATETIME
- See Also:
-
OPT_DATE_FORMAT
- See Also:
-
OPT_DATE_TIME_FORMAT
- See Also:
-
OPT_REACTIVE
- See Also:
-
OPT_GENERATE_HTTP_RESPONSE_ALWAYS
- See Also:
-
OPT_GENERATE_HTTP_RESPONSE_WHERE_REQUIRED
- See Also:
-
OPT_APPLICATION_NAME
- See Also:
-
OPT_GENERATE_SWAGGER_ANNOTATIONS
- See Also:
-
OPT_GENERATE_SWAGGER_ANNOTATIONS_SWAGGER_2
- See Also:
-
OPT_GENERATE_SWAGGER_ANNOTATIONS_TRUE
- See Also:
-
OPT_GENERATE_SWAGGER_ANNOTATIONS_FALSE
- See Also:
-
OPT_GENERATE_OPERATION_ONLY_FOR_FIRST_TAG
- See Also:
-
OPT_IMPLICIT_HEADERS
- See Also:
-
OPT_IMPLICIT_HEADERS_REGEX
- See Also:
-
OPT_USE_ENUM_CASE_INSENSITIVE
- See Also:
-
OPT_KSP
- See Also:
-
ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS
- See Also:
-
ADDITIONAL_ENUM_TYPE_ANNOTATIONS
- See Also:
-
CONTENT_TYPE_APPLICATION_FORM_URLENCODED
- See Also:
-
CONTENT_TYPE_APPLICATION_JSON
- See Also:
-
CONTENT_TYPE_MULTIPART_FORM_DATA
- See Also:
-
CONTENT_TYPE_ANY
- See Also:
-
random
-
dateLibrary
-
title
-
useBeanValidation
protected boolean useBeanValidation -
visitable
protected boolean visitable -
plural
protected boolean plural -
fluxForArrays
protected boolean fluxForArrays -
generatedAnnotation
protected boolean generatedAnnotation -
testTool
-
requiredPropertiesInConstructor
protected boolean requiredPropertiesInConstructor -
reactive
protected boolean reactive -
generateHttpResponseAlways
protected boolean generateHttpResponseAlways -
generateHttpResponseWhereRequired
protected boolean generateHttpResponseWhereRequired -
useEnumCaseInsensitive
protected boolean useEnumCaseInsensitive -
ksp
protected boolean ksp -
implicitHeaders
protected boolean implicitHeaders -
implicitHeadersRegex
-
appName
-
dateFormat
-
dateTimeFormat
-
generateSwaggerAnnotations
-
generateOperationOnlyForFirstTag
protected boolean generateOperationOnlyForFirstTag -
serializationLibrary
-
parameterMappings
-
responseBodyMappings
-
allModels
-
additionalOneOfTypeAnnotations
-
additionalEnumTypeAnnotations
-
-
Constructor Details
-
AbstractMicronautKotlinCodegen
protected AbstractMicronautKotlinCodegen()
-
-
Method Details
-
setGenerateHttpResponseAlways
public void setGenerateHttpResponseAlways(boolean generateHttpResponseAlways) -
setGenerateHttpResponseWhereRequired
public void setGenerateHttpResponseWhereRequired(boolean generateHttpResponseWhereRequired) -
setReactive
public void setReactive(boolean reactive) -
setImplicitHeaders
public void setImplicitHeaders(boolean implicitHeaders) -
setImplicitHeadersRegex
-
setTestTool
-
setArtifactId
- Overrides:
setArtifactId
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
-
setModelPackage
- Overrides:
setModelPackage
in classDefaultCodegen
-
setApiPackage
- Overrides:
setApiPackage
in classDefaultCodegen
-
setPackageName
- Overrides:
setPackageName
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
-
setPlural
public void setPlural(boolean plural) -
setFluxForArrays
public void setFluxForArrays(boolean fluxForArrays) -
setGeneratedAnnotation
public void setGeneratedAnnotation(boolean generatedAnnotation) -
setKsp
public void setKsp(boolean ksp) -
processOpts
public void processOpts()- Specified by:
processOpts
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
processOpts
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
-
addParameterMappings
-
addResponseBodyMappings
-
addSchemaMapping
-
addImportMapping
-
addNameMapping
-
addTypeMapping
-
addEnumNameMapping
-
addModelNameMapping
-
addInlineSchemaNameMapping
-
addInlineSchemaOption
-
addOpenapiNormalizer
-
testFileFolder
-
isServer
public abstract boolean isServer() -
apiTestFileFolder
- Specified by:
apiTestFileFolder
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
apiTestFileFolder
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
-
modelTestFileFolder
- Specified by:
modelTestFileFolder
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
modelTestFileFolder
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
-
toApiTestFilename
Description copied from class:DefaultCodegen
Return the file name of the Api Test- Specified by:
toApiTestFilename
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
toApiTestFilename
in classDefaultCodegen
- Parameters:
name
- the file name of the Api- Returns:
- the file name of the Api
-
toModelTestFilename
Description copied from class:DefaultCodegen
Return the capitalized file name of the model test- Specified by:
toModelTestFilename
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
toModelTestFilename
in classDefaultCodegen
- Parameters:
name
- the model name- Returns:
- the file name of the model
-
setUseBeanValidation
public void setUseBeanValidation(boolean useBeanValidation) - Specified by:
setUseBeanValidation
in interfaceorg.openapitools.codegen.languages.features.BeanValidationFeatures
-
setVisitable
public void setVisitable(boolean visitable) -
createDiscriminator
protected org.openapitools.codegen.CodegenDiscriminator createDiscriminator(String schemaName, io.swagger.v3.oas.models.media.Schema schema) - Overrides:
createDiscriminator
in classDefaultCodegen
-
toApiVarName
Description copied from class:DefaultCodegen
Return the variable name in the Api- Specified by:
toApiVarName
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
toApiVarName
in classDefaultCodegen
- Parameters:
name
- the variable name of the Api- Returns:
- the snake-cased variable name
-
isVisitable
public boolean isVisitable() -
sanitizeTag
Description copied from class:DefaultCodegen
Sanitize tag- Specified by:
sanitizeTag
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
sanitizeTag
in classDefaultCodegen
- Parameters:
tag
- Tag- Returns:
- Sanitized tag
-
superSanitizeTag
-
toApiName
Description copied from class:DefaultCodegen
Output the API (class) name (capitalized) ending with the specified or default suffix Return DefaultApi if name is empty- Specified by:
toApiName
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
toApiName
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
- Parameters:
name
- the name of the Api- Returns:
- capitalized Api name
-
addOperationToGroup
public void addOperationToGroup(String tag, String resourcePath, io.swagger.v3.oas.models.Operation operation, org.openapitools.codegen.CodegenOperation co, Map<String, List<org.openapitools.codegen.CodegenOperation>> operations) Description copied from class:DefaultCodegen
Add operation to group- Specified by:
addOperationToGroup
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
addOperationToGroup
in classDefaultCodegen
- Parameters:
tag
- name of the tagresourcePath
- path of the resourceoperation
- OAS Operation objectco
- Codegen Operation objectoperations
- map of Codegen operations
-
preprocessOpenAPI
public void preprocessOpenAPI(io.swagger.v3.oas.models.OpenAPI openApi) - Specified by:
preprocessOpenAPI
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
preprocessOpenAPI
in classDefaultCodegen
-
postProcessOperationsWithModels
public org.openapitools.codegen.model.OperationsMap postProcessOperationsWithModels(org.openapitools.codegen.model.OperationsMap objs, List<org.openapitools.codegen.model.ModelMap> allModels) - Specified by:
postProcessOperationsWithModels
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
postProcessOperationsWithModels
in classDefaultCodegen
-
handleImplicitHeaders
protected void handleImplicitHeaders(org.openapitools.codegen.CodegenOperation operation) This method removes all implicit header parameters from the list of parameters.- Parameters:
operation
- - operation to be processed
-
toEnumValue
Description copied from class:DefaultCodegen
Return the enum value in the language specified format e.g. status becomes "status"- Overrides:
toEnumValue
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
- Parameters:
value
- enum variable namedatatype
- data type- Returns:
- the sanitized value for enum
-
fromModel
public org.openapitools.codegen.CodegenModel fromModel(String name, io.swagger.v3.oas.models.media.Schema schema) Description copied from class:DefaultCodegen
Convert OAS Model object to Codegen Model object.- Specified by:
fromModel
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
fromModel
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
- Parameters:
name
- the name of the modelschema
- OAS Model object- Returns:
- Codegen Model object
-
getTypeDeclaration
Output the type declaration of the property.- Specified by:
getTypeDeclaration
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
getTypeDeclaration
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
- Parameters:
p
- OpenAPI Property object- Returns:
- a string presentation of the property type
-
toModelName
Description copied from class:DefaultCodegen
Converts the OpenAPI schema name to a model name suitable for the current code generator. May be overridden for each programming language. In case the name belongs to the TypeSystem it won't be renamed.- Specified by:
toModelName
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
toModelName
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
- Parameters:
name
- the name of the model- Returns:
- capitalized model name
-
fromParameter
public org.openapitools.codegen.CodegenParameter fromParameter(io.swagger.v3.oas.models.parameters.Parameter p, Set<String> imports) Description copied from class:DefaultCodegen
Convert OAS Parameter object to Codegen Parameter object- Overrides:
fromParameter
in classDefaultCodegen
- Parameters:
p
- OAS parameter objectimports
- set of imports for library/package/module- Returns:
- Codegen Parameter object
-
fromResponse
public org.openapitools.codegen.CodegenResponse fromResponse(String responseCode, io.swagger.v3.oas.models.responses.ApiResponse response) Description copied from class:DefaultCodegen
Convert OAS Response object to Codegen Response object- Overrides:
fromResponse
in classDefaultCodegen
- Parameters:
responseCode
- HTTP response coderesponse
- OAS Response object- Returns:
- Codegen Response object
-
fromProperty
public org.openapitools.codegen.CodegenProperty fromProperty(String name, io.swagger.v3.oas.models.media.Schema schema, boolean required, boolean schemaIsFromAdditionalProperties) Description copied from class:DefaultCodegen
Convert OAS Property object to Codegen Property object.The return value is cached. An internal cache is looked up to determine if the CodegenProperty return value has already been instantiated for the (String name, Schema p) arguments. Any subsequent processing of the CodegenModel return value must be idempotent for a given (String name, Schema schema).
- Overrides:
fromProperty
in classDefaultCodegen
- Parameters:
name
- name of the propertyschema
- OAS property schemarequired
- true if the property is required in the next higher object schema, false otherwiseschemaIsFromAdditionalProperties
- true if the property is a required property defined by additional properties schema If this is the actual additionalProperties schema not defining a required property, then the value should be false- Returns:
- Codegen Property object
-
fromOperation
public org.openapitools.codegen.CodegenOperation fromOperation(String path, String httpMethod, io.swagger.v3.oas.models.Operation operation, List<io.swagger.v3.oas.models.servers.Server> servers) Description copied from class:DefaultCodegen
Convert OAS Operation object to Codegen Operation object- Specified by:
fromOperation
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
fromOperation
in classDefaultCodegen
- Parameters:
path
- the path of the operationhttpMethod
- HTTP methodoperation
- OAS operation objectservers
- list of servers- Returns:
- Codegen Operation object
-
toEnumVarName
Description copied from class:DefaultCodegen
Return the sanitized variable name for enum- Overrides:
toEnumVarName
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
- Parameters:
value
- enum variable namedatatype
- data type- Returns:
- the sanitized variable name for enum
-
isNumeric
-
toVarName
Description copied from class:DefaultCodegen
Return the variable name by removing invalid characters and proper escaping if it's a reserved word.- Overrides:
toVarName
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
- Parameters:
name
- the variable name- Returns:
- the sanitized variable name
-
postProcessAllModels
public Map<String,org.openapitools.codegen.model.ModelsMap> postProcessAllModels(Map<String, org.openapitools.codegen.model.ModelsMap> objs) - Specified by:
postProcessAllModels
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
postProcessAllModels
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
-
updateEnumVarsWithExtensions
protected void updateEnumVarsWithExtensions(List<Map<String, Object>> enumVars, Map<String, Object> vendorExtensions, String dataType) - Overrides:
updateEnumVarsWithExtensions
in classDefaultCodegen
-
setParameterExampleValue
public void setParameterExampleValue(org.openapitools.codegen.CodegenParameter codegenParameter, io.swagger.v3.oas.models.parameters.Parameter parameter) Description copied from class:DefaultCodegen
Return the example value of the parameter.- Overrides:
setParameterExampleValue
in classDefaultCodegen
- Parameters:
codegenParameter
- Codegen parameterparameter
- Parameter
-
setParameterExampleValue
public void setParameterExampleValue(org.openapitools.codegen.CodegenParameter p) Description copied from class:DefaultCodegen
Return the example value of the parameter.- Overrides:
setParameterExampleValue
in classDefaultCodegen
- Parameters:
p
- Codegen parameter
-
getParameterExampleValue
-
getPropertyExampleValue
-
getExampleValue
-
toDefaultValue
public String toDefaultValue(org.openapitools.codegen.CodegenProperty cp, io.swagger.v3.oas.models.media.Schema schema) Description copied from class:DefaultCodegen
Return the default value of the propertyReturn null if you do NOT want a default value. Any non-null value will cause {{#defaultValue} check to pass.
- Overrides:
toDefaultValue
in classorg.openapitools.codegen.languages.AbstractKotlinCodegen
- Parameters:
cp
- Codegen propertyschema
- Property schema- Returns:
- string presentation of the default value of the property
-
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 classorg.openapitools.codegen.languages.AbstractKotlinCodegen
- Returns:
- preinitialized map with common lambdas
-
getPackageName
-
setSerializationLibrary
-
setDateTimeLibrary
-
setUseOneOfInterfaces
- Overrides:
setUseOneOfInterfaces
in classDefaultCodegen
-
getUseInlineModelResolver
public boolean getUseInlineModelResolver()- Specified by:
getUseInlineModelResolver
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
getUseInlineModelResolver
in classDefaultCodegen
-
setGenerateSwaggerAnnotations
public void setGenerateSwaggerAnnotations(boolean generateSwaggerAnnotations) -
setDateFormat
-
setDateTimeFormat
-
setUseEnumCaseInsensitive
public void setUseEnumCaseInsensitive(boolean useEnumCaseInsensitive) -
setAdditionalOneOfTypeAnnotations
-
setAdditionalEnumTypeAnnotations
-
postProcess
public void postProcess()- Specified by:
postProcess
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
postProcess
in classDefaultCodegen
-