Package io.micronaut.openapi.generator
Class AbstractMicronautJavaCodegen<T extends GeneratorOptionsBuilder>
java.lang.Object
org.openapitools.codegen.DefaultCodegen
org.openapitools.codegen.languages.AbstractJavaCodegen
io.micronaut.openapi.generator.AbstractMicronautJavaCodegen<T>
- Type Parameters:
T
- The generator options builder.
- All Implemented Interfaces:
MicronautCodeGenerator<T>
,org.openapitools.codegen.CodegenConfig
,org.openapitools.codegen.languages.features.BeanValidationFeatures
,org.openapitools.codegen.languages.features.DocumentationProviderFeatures
,org.openapitools.codegen.languages.features.OptionalFeatures
- Direct Known Subclasses:
JavaMicronautClientCodegen
,JavaMicronautServerCodegen
public abstract class AbstractMicronautJavaCodegen<T extends GeneratorOptionsBuilder>
extends org.openapitools.codegen.languages.AbstractJavaCodegen
implements org.openapitools.codegen.languages.features.BeanValidationFeatures, org.openapitools.codegen.languages.features.OptionalFeatures, MicronautCodeGenerator<T>
Base generator for Micronaut.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openapitools.codegen.languages.features.DocumentationProviderFeatures
org.openapitools.codegen.languages.features.DocumentationProviderFeatures.AnnotationLibrary, org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DocumentationProvider
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
static final String
static final String
static final String
static final String
protected String
protected String
protected boolean
protected boolean
protected boolean
protected boolean
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
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.AbstractJavaCodegen
ADDITIONAL_ENUM_TYPE_ANNOTATIONS, ADDITIONAL_MODEL_TYPE_ANNOTATIONS, ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS, additionalEnumTypeAnnotations, additionalModelTypeAnnotations, additionalOneOfTypeAnnotations, annotationLibrary, apiDocPath, artifactDescription, artifactId, artifactUrl, artifactVersion, BOOLEAN_GETTER_PREFIX, booleanGetterPrefix, CAMEL_CASE_DOLLAR_SIGN, camelCaseDollarSign, CONTAINER_DEFAULT_TO_NULL, containerDefaultToNull, DATE_LIBRARY, dateLibrary, DEFAULT_LIBRARY, DEFAULT_TEST_FOLDER, developerEmail, developerName, developerOrganization, developerOrganizationUrl, DISABLE_HTML_ESCAPING, disableHtmlEscaping, DISCRIMINATOR_CASE_SENSITIVE, discriminatorCaseSensitive, documentationProvider, GENERATE_BUILDERS, GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, generateBuilders, generateConstructorWithAllArgs, groupId, IGNORE_ANYOF_IN_ENUM, ignoreAnyOfInEnum, IMPLICIT_HEADERS, IMPLICIT_HEADERS_REGEX, implicitHeaders, implicitHeadersRegex, invokerPackage, jackson, JACKSON, JAVAX_PACKAGE, licenseName, licenseUrl, LOMBOK, lombokAnnotations, modelDocPath, OPENAPI_NULLABLE, openApiNullable, outputTestFolder, parentArtifactId, parentGroupId, parentOverridden, parentVersion, projectFolder, projectTestFolder, scmConnection, scmDeveloperConnection, scmUrl, serializableModel, serializeBigDecimalAsString, sourceFolder, SUPPORT_ASYNC, supportAsync, TEST_OUTPUT, testFolder, USE_JAKARTA_EE, USE_ONE_OF_INTERFACES, useBeanValidation, useJakartaEe, WITH_XML, withXml
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
Fields inherited from interface org.openapitools.codegen.languages.features.DocumentationProviderFeatures
ANNOTATION_LIBRARY, DOCUMENTATION_PROVIDER
Fields inherited from interface org.openapitools.codegen.languages.features.OptionalFeatures
USE_OPTIONAL
-
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) arrayDefaultValue
(String itemsDatatypeWithEnum, String itemsDataType, boolean itemsIsEnumOrRef, boolean isArray, boolean itemsIsString, boolean itemsIsNumeric, boolean itemsIsFloat, boolean itemsIsMap, io.swagger.v3.oas.models.media.Schema schema) protected org.openapitools.codegen.CodegenDiscriminator
createDiscriminator
(String schemaName, io.swagger.v3.oas.models.media.Schema schema) escapeTextGroovy
(String text) 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.CodegenParameter
fromRequestBody
(io.swagger.v3.oas.models.parameters.RequestBody body, Set<String> imports, String bodyParameterName) 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 groovy, boolean isProperty) protected String
getParameterExampleValue
(org.openapitools.codegen.CodegenParameter p, boolean groovy) protected String
getPropertyExampleValue
(org.openapitools.codegen.CodegenProperty p, boolean groovy) Camelize the method name of the getter and setterboolean
boolean
protected boolean
isReservedWord
(String word) 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
setApiNamePrefix
(String apiNamePrefix) void
setApiNameSuffix
(String apiNameSuffix) 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
setInvokerPackage
(String invokerPackage) void
setLombok
(boolean lombok) void
setModelNamePrefix
(String modelNamePrefix) void
setModelNameSuffix
(String modelNameSuffix) void
setModelPackage
(String modelPackage) void
setParameterExampleValue
(org.openapitools.codegen.CodegenParameter p) 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
setUseOptional
(boolean useOptional) void
setVisitable
(boolean visitable) 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 enumtoModelTestFilename
(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.AbstractJavaCodegen
addAdditionPropertiesToCodeGenModel, addImports, addImportsToOneOfInterface, apiDocFileFolder, apiFileFolder, applyJakartaPackage, applyJavaxPackage, escapeQuotationMark, escapeReservedWord, escapeUnsafeCharacters, findByName, getAdditionalModelTypeAnnotations, getAdditionalOneOfTypeAnnotations, getAnnotationLibrary, getArtifactDescription, getArtifactId, getArtifactUrl, getArtifactVersion, getBooleanGetterPrefix, getDateLibrary, getDeveloperEmail, getDeveloperName, getDeveloperOrganization, getDeveloperOrganizationUrl, getDocumentationProvider, getGroupId, getInvokerPackage, getLicenseName, getLicenseUrl, getOutputTestFolder, getSchemaType, getScmConnection, getScmDeveloperConnection, getScmUrl, getSerializableModel, getSourceFolder, getSupportedVendorExtensions, getTestFolder, getTypeDeclaration, handleImplicitHeaders, isAddNullableImports, isConstructorWithAllArgsAllowed, isGenerateBuilders, isGenerateConstructorWithAllArgs, isJackson, isOpenApiNullable, isTypeErasedGenerics, isUseBeanValidation, modelDocFileFolder, modelFileFolder, needToImport, postProcessFile, postProcessModelProperty, postProcessModels, postProcessResponseWithProperty, setAdditionalEnumTypeAnnotations, setAdditionalModelTypeAnnotations, setAdditionalOneOfTypeAnnotations, setAnnotationLibrary, setArtifactDescription, setArtifactUrl, setArtifactVersion, setBooleanGetterPrefix, setCamelCaseDollarSign, setContainerDefaultToNull, setDateLibrary, setDeveloperEmail, setDeveloperName, setDeveloperOrganization, setDeveloperOrganizationUrl, setDisableHtmlEscaping, setDiscriminatorCaseSensitive, setDocumentationProvider, setGenerateBuilders, setGenerateConstructorWithAllArgs, setGroupId, setIgnoreAnyOfInEnum, setImplicitHeaders, setImplicitHeadersRegex, setJackson, setLicenseName, setLicenseUrl, setOpenApiNullable, setOutputDir, setOutputTestFolder, setParameterExampleValue, setParameterExampleValue, setParentArtifactId, setParentGroupId, setParentOverridden, setParentVersion, setScmConnection, setScmDeveloperConnection, setScmUrl, setSerializableModel, setSerializeBigDecimalAsString, setSourceFolder, setSupportAsync, setTestFolder, setUseJakartaEe, setWithXml, toApiDocFilename, toApiFilename, toArrayDefaultValue, toBooleanGetter, toDefaultParameterValue, toEnumName, toExampleValue, toModelDocFilename, toModelFilename, toModelName, toOperationId, toParamName, toRegularExpression
Methods inherited from class org.openapitools.codegen.DefaultCodegen
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, defaultIncludes, defaultTemplatingEngine, embeddedTemplateDir, encodePath, enumNameMapping, escapeText, escapeTextInSingleQuotes, escapeTextWhileAllowingNewLines, executePostProcessor, fileSuffix, findCommonPrefixOfVars, findMethodResponse, fromCallback, fromFormProperty, fromProperty, fromProperty, fromRequestBodyToFormParameters, fromSecurity, fromServers, fromServerVariables, generateExamplePath, generateJSONSpecFile, generateYAMLSpecFile, generatorLanguage, 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, getSymbolName, getTag, getTemplatingEngine, getTypeDeclaration, getUseOneOfInterfaces, getUseOpenapiNormalizer, getVersionMetadataFilename, handleConstantParams, handleMethodResponse, handleMethodResponse, handleSpecialCharacters, hasBodyParameter, hasFormParameter, importMapping, initializeSpecialCharacterMapping, inlineSchemaNameMapping, inlineSchemaOption, instantiationTypes, isDataTypeBinary, isDataTypeFile, isDataTypeString, isEnableMinimalUpdate, isEnablePostProcessFile, isHideGenerationTimestamp, isJsonMimeType, isJsonVendorMimeType, isLibrary, isParameterNameUnique, isPropertyInnerMostEnum, isRemoveEnumValuePrefix, isRemoveOperationIdPrefix, isSkipOperationExample, isSkipOverwrite, isSkipSortingOperations, isStrictSpecBehavior, isXmlMimeType, languageSpecificPrimitives, lowerCamelCase, modelDocTemplateFiles, modelFilename, modelFilename, modelNameMapping, modelPackage, modelTemplateFiles, modelTestTemplateFiles, modifyFeatureSet, nameMapping, openapiGeneratorIgnoreList, openapiNormalizer, operationIdNameMapping, outputFolder, parameterNameMapping, postProcessEnumVars, postProcessModelsEnum, postProcessParameter, postProcessSupportingFileData, postProcessWebhooksWithModels, processCompiler, processOpenAPI, processTemplatingEngine, processTestExampleData, removeImport, removeNonNameElementToCamelCase, removeNonNameElementToCamelCase, removeOption, removeSelfReferenceImports, reservedWords, reservedWordsMappings, sanitizeName, sanitizeName, sanitizeName, schemaMapping, serverVariableOverrides, setAddProps, setAllowUnicodeIdentifiers, setAutosetConstants, setCircularReferences, setDisallowAdditionalPropertiesIfNotPresent, setDocExtension, setEnableMinimalUpdate, setEnablePostProcessFile, setEnsureUniqueParams, setEnumUnknownDefaultCase, setFilesMetadataFilename, setGitHost, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLegacyDiscriminatorBehavior, setLibrary, setNonArrayMapProperty, setOpenAPI, setParameterBooleanFlagWithCodegenProperty, setParameterEncodingValues, setParameterExamples, 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, toApiImport, toArrayModelParamName, toDefaultParameterValue, toDefaultValue, toDefaultValueWithParam, toEnumDefaultValue, toEnumDefaultValue, toExamples, toGetter, toInstantiationType, toMediaTypeSchemaName, toModelImport, toModelImportMap, toOneOfName, toSetter, toTestCaseName, typeMapping, unaliasPropertySchema, unaliasSchema, updateAllModels, updateCodegenPropertyEnum, updateDataTypeWithEnumForArray, updateDataTypeWithEnumForMap, updateModelForAnyType, updateModelForComposedSchema, updateModelForInteger, updateModelForNumber, updateModelForObject, 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, generatorLanguage, generatorLanguageVersion, getAddSuffixToDuplicateOperationNicknames, getDocExtension, getFeatureSet, getFilesMetadataFilename, getGeneratorMetadata, getGitHost, getGitRepoId, getGitUserId, getHelp, getHttpUserAgent, getIgnoreFilePathOverride, getInputSpec, getLibrary, getName, getOpenapiGeneratorIgnoreList, getOutputDir, getReleaseNote, getTag, getTemplatingEngine, getTypeDeclaration, getUseOpenapiNormalizer, getVersionMetadataFilename, importMapping, inlineSchemaNameMapping, inlineSchemaOption, instantiationTypes, isEnableMinimalUpdate, isEnablePostProcessFile, isHideGenerationTimestamp, isRemoveEnumValuePrefix, isRemoveOperationIdPrefix, isSkipOperationExample, isSkipOverwrite, isSkipSortingOperations, isStrictSpecBehavior, languageSpecificPrimitives, modelDocTemplateFiles, modelFilename, modelFilename, modelNameMapping, modelPackage, modelTemplateFiles, modelTestTemplateFiles, nameMapping, openapiGeneratorIgnoreList, openapiNormalizer, operationIdNameMapping, outputFolder, parameterNameMapping, postProcessParameter, postProcessSupportingFileData, postProcessWebhooksWithModels, processCompiler, processOpenAPI, processTemplatingEngine, reservedWords, reservedWordsMappings, sanitizeName, schemaMapping, serverVariableOverrides, setDocExtension, setEnableMinimalUpdate, setEnablePostProcessFile, setGitHost, setGitRepoId, setGitUserId, setHideGenerationTimestamp, setHttpUserAgent, setIgnoreFilePathOverride, setInputSpec, setLibrary, setOpenAPI, setReleaseNote, setRemoveEnumValuePrefix, setRemoveOperationIdPrefix, setSkipOperationExample, setSkipOverwrite, setSkipSortingOperations, setStrictSpecBehavior, setTemplatingEngine, shouldOverwrite, supportedLibraries, supportingFiles, templateDir, templateOutputDirs, testPackage, toApiImport, toGetter, toModelImport, toModelImportMap, toSetter, typeMapping, unaliasSchema, updateAllModels, vendorExtensions
Methods inherited from interface org.openapitools.codegen.languages.features.DocumentationProviderFeatures
defaultDocumentationProvider, supportedAnnotationLibraries, supportedDocumentationProvider
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_TEST_SPOCK
- See Also:
-
OPT_REQUIRED_PROPERTIES_IN_CONSTRUCTOR
- See Also:
-
OPT_USE_AUTH
- See Also:
-
OPT_USE_LOMBOK
- 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_USE_ENUM_CASE_INSENSITIVE
- 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_1
- 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_SKIP_SORTING_OPERATIONS
- 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
-
title
-
useOptional
protected boolean useOptional -
visitable
protected boolean visitable -
lombok
protected boolean lombok -
fluxForArrays
protected boolean fluxForArrays -
plural
protected boolean plural -
generatedAnnotation
protected boolean generatedAnnotation -
testTool
-
requiredPropertiesInConstructor
protected boolean requiredPropertiesInConstructor -
reactive
protected boolean reactive -
useEnumCaseInsensitive
protected boolean useEnumCaseInsensitive -
generateHttpResponseAlways
protected boolean generateHttpResponseAlways -
generateHttpResponseWhereRequired
protected boolean generateHttpResponseWhereRequired -
appName
-
dateFormat
-
dateTimeFormat
-
generateSwaggerAnnotations
-
generateOperationOnlyForFirstTag
protected boolean generateOperationOnlyForFirstTag -
serializationLibrary
-
parameterMappings
-
responseBodyMappings
-
allModels
-
-
Constructor Details
-
AbstractMicronautJavaCodegen
protected AbstractMicronautJavaCodegen()
-
-
Method Details
-
setGenerateHttpResponseAlways
public void setGenerateHttpResponseAlways(boolean generateHttpResponseAlways) -
setGenerateHttpResponseWhereRequired
public void setGenerateHttpResponseWhereRequired(boolean generateHttpResponseWhereRequired) -
setReactive
public void setReactive(boolean reactive) -
setTestTool
-
setArtifactId
- Overrides:
setArtifactId
in classorg.openapitools.codegen.languages.AbstractJavaCodegen
-
setModelPackage
- Overrides:
setModelPackage
in classDefaultCodegen
-
setApiPackage
- Overrides:
setApiPackage
in classDefaultCodegen
-
setApiNamePrefix
- Overrides:
setApiNamePrefix
in classDefaultCodegen
-
setApiNameSuffix
- Overrides:
setApiNameSuffix
in classDefaultCodegen
-
setModelNamePrefix
- Overrides:
setModelNamePrefix
in classDefaultCodegen
-
setModelNameSuffix
- Overrides:
setModelNameSuffix
in classDefaultCodegen
-
setInvokerPackage
- Overrides:
setInvokerPackage
in classorg.openapitools.codegen.languages.AbstractJavaCodegen
-
setLombok
public void setLombok(boolean lombok) -
setPlural
public void setPlural(boolean plural) -
setFluxForArrays
public void setFluxForArrays(boolean fluxForArrays) -
setGeneratedAnnotation
public void setGeneratedAnnotation(boolean generatedAnnotation) -
processOpts
public void processOpts()- Specified by:
processOpts
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
processOpts
in classorg.openapitools.codegen.languages.AbstractJavaCodegen
-
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.AbstractJavaCodegen
-
modelTestFileFolder
- Specified by:
modelTestFileFolder
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
modelTestFileFolder
in classorg.openapitools.codegen.languages.AbstractJavaCodegen
-
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 classorg.openapitools.codegen.languages.AbstractJavaCodegen
- 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 classorg.openapitools.codegen.languages.AbstractJavaCodegen
- Parameters:
name
- the model name- Returns:
- the file name of the model
-
fromRequestBody
public org.openapitools.codegen.CodegenParameter fromRequestBody(io.swagger.v3.oas.models.parameters.RequestBody body, Set<String> imports, String bodyParameterName) - Overrides:
fromRequestBody
in classDefaultCodegen
-
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
-
toEnumVarName
Description copied from class:DefaultCodegen
Return the sanitized variable name for enum- Overrides:
toEnumVarName
in classorg.openapitools.codegen.languages.AbstractJavaCodegen
- Parameters:
value
- enum variable namedatatype
- data type- Returns:
- the sanitized variable name for enum
-
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.AbstractJavaCodegen
- Parameters:
cp
- Codegen propertyschema
- Property schema- Returns:
- string presentation of the default value of the property
-
arrayDefaultValue
public org.apache.commons.lang3.tuple.Pair<String,String> arrayDefaultValue(String itemsDatatypeWithEnum, String itemsDataType, boolean itemsIsEnumOrRef, boolean isArray, boolean itemsIsString, boolean itemsIsNumeric, boolean itemsIsFloat, boolean itemsIsMap, io.swagger.v3.oas.models.media.Schema schema) -
setUseBeanValidation
public void setUseBeanValidation(boolean useBeanValidation) - Specified by:
setUseBeanValidation
in interfaceorg.openapitools.codegen.languages.features.BeanValidationFeatures
- Overrides:
setUseBeanValidation
in classorg.openapitools.codegen.languages.AbstractJavaCodegen
-
setUseOptional
public void setUseOptional(boolean useOptional) - Specified by:
setUseOptional
in interfaceorg.openapitools.codegen.languages.features.OptionalFeatures
-
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
-
isReservedWord
- Overrides:
isReservedWord
in classDefaultCodegen
-
isVisitable
public boolean isVisitable() -
sanitizeTag
Description copied from class:DefaultCodegen
Sanitize tag- Specified by:
sanitizeTag
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
sanitizeTag
in classorg.openapitools.codegen.languages.AbstractJavaCodegen
- Parameters:
tag
- Tag- Returns:
- Sanitized tag
-
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 classDefaultCodegen
- 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 classorg.openapitools.codegen.languages.AbstractJavaCodegen
-
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 classorg.openapitools.codegen.languages.AbstractJavaCodegen
-
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.AbstractJavaCodegen
- Parameters:
name
- the name of the modelschema
- OAS Model object- Returns:
- Codegen Model object
-
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.AbstractJavaCodegen
- Parameters:
value
- enum variable namedatatype
- data type- Returns:
- the sanitized value for enum
-
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 classorg.openapitools.codegen.languages.AbstractJavaCodegen
- Parameters:
path
- the path of the operationhttpMethod
- HTTP methodoperation
- OAS operation objectservers
- list of servers- Returns:
- Codegen Operation object
-
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.AbstractJavaCodegen
- Parameters:
name
- the variable name- Returns:
- the sanitized variable name
-
getterAndSetterCapitalize
Description copied from class:DefaultCodegen
Camelize the method name of the getter and setter- Overrides:
getterAndSetterCapitalize
in classorg.openapitools.codegen.languages.AbstractJavaCodegen
- Parameters:
name
- string to be camelized- Returns:
- Camelized string
-
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.AbstractJavaCodegen
-
updateEnumVarsWithExtensions
protected void updateEnumVarsWithExtensions(List<Map<String, Object>> enumVars, Map<String, Object> vendorExtensions, String dataType) - Overrides:
updateEnumVarsWithExtensions
in classDefaultCodegen
-
isGenerateHardNullable
public boolean isGenerateHardNullable() -
setParameterExampleValue
public void setParameterExampleValue(org.openapitools.codegen.CodegenParameter p) Description copied from class:DefaultCodegen
Return the example value of the parameter.- Overrides:
setParameterExampleValue
in classorg.openapitools.codegen.languages.AbstractJavaCodegen
- Parameters:
p
- Codegen parameter
-
getParameterExampleValue
protected String getParameterExampleValue(org.openapitools.codegen.CodegenParameter p, boolean groovy) -
getPropertyExampleValue
protected String getPropertyExampleValue(org.openapitools.codegen.CodegenProperty p, boolean groovy) -
getExampleValue
-
escapeTextGroovy
-
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
-
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) -
postProcess
public void postProcess()- Specified by:
postProcess
in interfaceorg.openapitools.codegen.CodegenConfig
- Overrides:
postProcess
in classDefaultCodegen
-