From 607427dbff3d86bc231dc11b5ba72b8627f79e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 22 Jan 2026 10:12:49 +0100 Subject: [PATCH 01/21] feature/add-skip-x-implements --- .../languages/AbstractJavaCodegen.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 9a6d64f09c96..894460bd4644 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -90,6 +90,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix"; public static final String IGNORE_ANYOF_IN_ENUM = "ignoreAnyOfInEnum"; public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations"; + public static final String SKIP_X_IMPLEMENTS = "skipXImplements"; public static final String ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS = "additionalOneOfTypeAnnotations"; public static final String ADDITIONAL_ENUM_TYPE_ANNOTATIONS = "additionalEnumTypeAnnotations"; public static final String DISCRIMINATOR_CASE_SENSITIVE = "discriminatorCaseSensitive"; @@ -178,6 +179,9 @@ protected enum ENUM_PROPERTY_NAMING_TYPE {MACRO_CASE, legacy, original} @Setter protected boolean parentOverridden = false; @Getter @Setter protected List additionalModelTypeAnnotations = new LinkedList<>(); + @Getter + @Setter + protected List skipXImplements = new LinkedList<>(); protected Map lombokAnnotations = null; @Getter @Setter protected List additionalOneOfTypeAnnotations = new LinkedList<>(); @@ -338,6 +342,7 @@ public AbstractJavaCodegen() { cliOptions.add(CliOption.newBoolean(IGNORE_ANYOF_IN_ENUM, "Ignore anyOf keyword in enum", ignoreAnyOfInEnum)); cliOptions.add(CliOption.newString(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, "Additional annotations for enum type(class level annotations)")); cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); + cliOptions.add(CliOption.newString(SKIP_X_IMPLEMENTS, "Ability to exclude interfaces that are specified using x-implements vendor extension. List separated by semicolon(;) or new line (Linux or Windows)")); cliOptions.add(CliOption.newString(ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS, "Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.", this.openApiNullable)); cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); @@ -1997,6 +2002,29 @@ public ModelsMap postProcessModels(ModelsMap objs) { } } + // skip interfaces predefined in x-implements if excluded via x-implements-skip-interfaces + if (!this.skipXImplements.isEmpty()) { + LOGGER.info("Models will be post-processed to remove any implementations of the following interfaces: {}", this.skipXImplements); + List interfacesToNotImplement = this.skipXImplements; + for (ModelMap mo : objs.getModels()) { + CodegenModel cm = mo.getModel(); + if (cm.getVendorExtensions().containsKey(X_IMPLEMENTS)) { + List originalXImplements = (ArrayList) cm.getVendorExtensions().get(X_IMPLEMENTS); + List preservedXImplements = originalXImplements + .stream() + .filter(interfaceToImplement -> !interfacesToNotImplement.contains(interfaceToImplement)) + .collect(Collectors.toCollection(ArrayList::new)); + List filteredOutXImplements = originalXImplements + .stream() + .filter(interfacesToNotImplement::contains) + .collect(Collectors.toList()); + LOGGER.info("Following interfaces will be skipped for model {}: {}", cm.classname, filteredOutXImplements); + // implement only the non-filtered-out interfaces + cm.getVendorExtensions().replace(X_IMPLEMENTS, preservedXImplements); + } + } + } + // add x-implements for serializable to all models for (ModelMap mo : objs.getModels()) { CodegenModel cm = mo.getModel(); From 42806814e12fc815ad4695fdfd5af28eab026a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 22 Jan 2026 10:31:28 +0100 Subject: [PATCH 02/21] feature/add-skip-x-implements --- .../src/main/java/org/openapitools/codegen/DefaultCodegen.java | 2 ++ .../openapitools/codegen/languages/AbstractJavaCodegen.java | 3 +++ .../openapitools/codegen/languages/AbstractKotlinCodegen.java | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 35beeba016f8..dec9a85f0f43 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -96,6 +96,8 @@ public class DefaultCodegen implements CodegenConfig { private final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegen.class); + public static final Pattern SPLIT_ON_SEMICOLON_OR_NEWLINE_REGEX = Pattern.compile("\\s*(;|\\r?\\n)\\s*"); // Splits on semicolon or new line, ignoring surrounding whitespace + public static FeatureSet DefaultFeatureSet; // A cache of sanitized words. The sanitizeName() method is invoked many times with the same diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 894460bd4644..769e708c6d6d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -453,6 +453,9 @@ public void processOpts() { convertPropertyToTypeAndWriteBack(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, annotations -> Arrays.asList(annotations.split(";")), this::setAdditionalEnumTypeAnnotations); + convertPropertyToTypeAndWriteBack(SKIP_X_IMPLEMENTS, + interfacesToSkipImplementing -> Arrays.asList(SPLIT_ON_SEMICOLON_OR_NEWLINE_REGEX.split(interfacesToSkipImplementing.trim())), + this::setSkipXImplements); if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index 09b03e1a1f95..4e9d489c7444 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -513,7 +513,7 @@ public void processOpts() { if (additionalProperties.containsKey(ADDITIONAL_MODEL_TYPE_ANNOTATIONS)) { String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_MODEL_TYPE_ANNOTATIONS).toString(); - this.setAdditionalModelTypeAnnotations(Arrays.asList(additionalAnnotationsList.trim().split("\\s*(;|\\r?\\n)\\s*"))); + this.setAdditionalModelTypeAnnotations(Arrays.asList(SPLIT_ON_SEMICOLON_OR_NEWLINE_REGEX.split(additionalAnnotationsList.trim()))); } additionalProperties.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, getSortParamsByRequiredFlag()); From 221f05af5a81c8cc842c634cfef6965ecdd4f732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Wed, 28 Jan 2026 00:33:54 +0100 Subject: [PATCH 03/21] feature/add-x-implements-overrides support in tooling --- .../spring-boot-skip-x-implements.yaml | 14 + .../openapitools/codegen/DefaultCodegen.java | 255 +- .../languages/AbstractJavaCodegen.java | 58 +- ...oints-models-for-testing-x-implements.yaml | 2068 +++++++++++++++++ 4 files changed, 2267 insertions(+), 128 deletions(-) create mode 100644 bin/configs/spring-boot-skip-x-implements.yaml create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml diff --git a/bin/configs/spring-boot-skip-x-implements.yaml b/bin/configs/spring-boot-skip-x-implements.yaml new file mode 100644 index 000000000000..bb655bc9bec7 --- /dev/null +++ b/bin/configs/spring-boot-skip-x-implements.yaml @@ -0,0 +1,14 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-skip-x-implements +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + documentationProvider: springfox + artifactId: springboot + snapshotVersion: "true" + hideGenerationTimestamp: "true" + camelCaseDollarSign: "true" + modelNameSuffix: 'Dto' + xImplementsOverrides: + com.custompackage.InterfaceToSubstitute: com.custompackage.SubstitutedInterface + com.custompackage.InterfaceToSkip: skip diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index dec9a85f0f43..c522a6739862 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -94,6 +94,7 @@ import static org.openapitools.codegen.utils.StringUtils.*; public class DefaultCodegen implements CodegenConfig { + private final Logger LOGGER = LoggerFactory.getLogger(DefaultCodegen.class); public static final Pattern SPLIT_ON_SEMICOLON_OR_NEWLINE_REGEX = Pattern.compile("\\s*(;|\\r?\\n)\\s*"); // Splits on semicolon or new line, ignoring surrounding whitespace @@ -192,15 +193,20 @@ public class DefaultCodegen implements CodegenConfig { protected Map operationIdNameMapping = new HashMap<>(); // a map to store the rules in OpenAPI Normalizer protected Map openapiNormalizer = new HashMap<>(); - @Setter protected String modelPackage = "", apiPackage = ""; + @Setter + protected String modelPackage = "", apiPackage = ""; protected String fileSuffix; - @Getter @Setter + @Getter + @Setter protected String modelNamePrefix = "", modelNameSuffix = ""; - @Getter @Setter + @Getter + @Setter protected String apiNamePrefix = "", apiNameSuffix = "Api"; protected String testPackage = ""; - @Setter protected String filesMetadataFilename = "FILES"; - @Setter protected String versionMetadataFilename = "VERSION"; + @Setter + protected String filesMetadataFilename = "FILES"; + @Setter + protected String versionMetadataFilename = "VERSION"; /* apiTemplateFiles are for API outputs only (controllers/handlers). API templates may be written multiple times; APIs are grouped by tag and the file is written once per tag group. @@ -212,7 +218,8 @@ apiTemplateFiles are for API outputs only (controllers/handlers). protected Map apiDocTemplateFiles = new HashMap<>(); protected Map modelDocTemplateFiles = new HashMap<>(); protected Map reservedWordsMappings = new HashMap<>(); - @Setter protected String templateDir; + @Setter + protected String templateDir; protected String embeddedTemplateDir; protected Map additionalProperties = new HashMap<>(); protected Map serverVariables = new HashMap<>(); @@ -227,9 +234,11 @@ apiTemplateFiles are for API outputs only (controllers/handlers). protected List cliOptions = new ArrayList<>(); protected boolean skipOverwrite; protected boolean removeOperationIdPrefix; - @Getter @Setter + @Getter + @Setter protected String removeOperationIdPrefixDelimiter = "_"; - @Getter @Setter + @Getter + @Setter protected int removeOperationIdPrefixCount = 1; protected boolean skipOperationExample; // sort operations by default @@ -264,13 +273,17 @@ apiTemplateFiles are for API outputs only (controllers/handlers). protected boolean supportsMixins; protected Map supportedLibraries = new LinkedHashMap<>(); protected String library; - @Getter @Setter + @Getter + @Setter protected Boolean sortParamsByRequiredFlag = true; - @Getter @Setter + @Getter + @Setter protected Boolean sortModelPropertiesByRequiredFlag = false; - @Getter @Setter + @Getter + @Setter protected Boolean ensureUniqueParams = true; - @Getter @Setter + @Getter + @Setter protected Boolean allowUnicodeIdentifiers = false; protected String gitHost, gitUserId, gitRepoId, releaseNote; protected String httpUserAgent; @@ -281,7 +294,8 @@ apiTemplateFiles are for API outputs only (controllers/handlers). protected Map specialCharReplacements = new LinkedHashMap<>(); // When a model is an alias for a simple type protected Map typeAliases = Collections.emptyMap(); - @Getter @Setter + @Getter + @Setter protected Boolean prependFormOrBodyParameters = false; // The extension of the generated documentation files (defaults to markdown .md) protected String docExtension; @@ -304,15 +318,18 @@ apiTemplateFiles are for API outputs only (controllers/handlers). protected boolean removeEnumValuePrefix = false; // Support legacy logic for evaluating discriminators - @Setter protected boolean legacyDiscriminatorBehavior = true; + @Setter + protected boolean legacyDiscriminatorBehavior = true; // Specify what to do if the 'additionalProperties' keyword is not present in a schema. // See CodegenConstants.java for more details. - @Setter protected boolean disallowAdditionalPropertiesIfNotPresent = true; + @Setter + protected boolean disallowAdditionalPropertiesIfNotPresent = true; // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. - @Setter protected boolean enumUnknownDefaultCase = false; + @Setter + protected boolean enumUnknownDefaultCase = false; protected String enumUnknownDefaultCaseName = "unknown_default_open_api"; // make openapi available to all methods @@ -335,11 +352,18 @@ apiTemplateFiles are for API outputs only (controllers/handlers). protected boolean addSuffixToDuplicateOperationNicknames = true; // Whether to automatically hardcode params that are considered Constants by OpenAPI Spec - @Setter protected boolean autosetConstants = false; + @Setter + protected boolean autosetConstants = false; - @Setter @Getter boolean arrayDefaultToEmpty, arrayNullableDefaultToEmpty, arrayOptionalNullableDefaultToEmpty, arrayOptionalDefaultToEmpty; - @Setter @Getter boolean mapDefaultToEmpty, mapNullableDefaultToEmpty, mapOptionalNullableDefaultToEmpty, mapOptionalDefaultToEmpty; - @Setter @Getter protected boolean defaultToEmptyContainer; + @Setter + @Getter + boolean arrayDefaultToEmpty, arrayNullableDefaultToEmpty, arrayOptionalNullableDefaultToEmpty, arrayOptionalDefaultToEmpty; + @Setter + @Getter + boolean mapDefaultToEmpty, mapNullableDefaultToEmpty, mapOptionalNullableDefaultToEmpty, mapOptionalDefaultToEmpty; + @Setter + @Getter + protected boolean defaultToEmptyContainer; final List EMPTY_LIST = new ArrayList(); @@ -574,7 +598,7 @@ private boolean codegenPropertyIsNew(CodegenModel model, CodegenProperty propert ? false : model.parentModel.allVars.stream().anyMatch(p -> p.name.equals(property.name) && - (p.dataType.equals(property.dataType) == false || p.datatypeWithEnum.equals(property.datatypeWithEnum) == false)); + (p.dataType.equals(property.dataType) == false || p.datatypeWithEnum.equals(property.datatypeWithEnum) == false)); } /** @@ -718,7 +742,7 @@ protected void removeSelfReferenceImports(CodegenModel model) { for (CodegenProperty cp : model.allVars) { // detect self import if (cp.dataType.equalsIgnoreCase(model.classname) || - (cp.isContainer && cp.items != null && cp.items.dataType.equalsIgnoreCase(model.classname))) { + (cp.isContainer && cp.items != null && cp.items.dataType.equalsIgnoreCase(model.classname))) { model.imports.remove(model.classname); // remove self import cp.isSelfReference = true; } @@ -760,7 +784,7 @@ private List getModelDependencies(List vars) { } private void setCircularReferencesOnProperties(final String root, - final Map> dependencyMap) { + final Map> dependencyMap) { dependencyMap.getOrDefault(root, new ArrayList<>()) .forEach(prop -> { final List unvisited = @@ -773,9 +797,9 @@ private void setCircularReferencesOnProperties(final String root, } private boolean isCircularReference(final String root, - final Set visited, - final List unvisited, - final Map> dependencyMap) { + final Set visited, + final List unvisited, + final Map> dependencyMap) { for (int i = 0; i < unvisited.size(); i++) { final String next = unvisited.get(i); if (!visited.contains(next)) { @@ -1164,7 +1188,6 @@ public String escapeTextInSingleQuotes(String input) { return escapeText(input).replace("'", "\\'"); } - /** * Escape characters while allowing new lines * @@ -1208,7 +1231,7 @@ public String encodePath(String input) { @Override public String escapeUnsafeCharacters(String input) { LOGGER.warn("escapeUnsafeCharacters should be overridden in the code generator with proper logic to escape " + - "unsafe characters"); + "unsafe characters"); // doing nothing by default and code generator should implement // the logic to prevent code injection // later we'll make this method abstract to make sure @@ -1225,7 +1248,7 @@ public String escapeUnsafeCharacters(String input) { @Override public String escapeQuotationMark(String input) { LOGGER.warn("escapeQuotationMark should be overridden in the code generator with proper logic to escape " + - "single/double quote"); + "single/double quote"); return input.replace("\"", "\\\""); } @@ -1803,7 +1826,8 @@ public DefaultCodegen() { CliOption legacyDiscriminatorBehaviorOpt = CliOption.newBoolean(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR_DESC).defaultValue(Boolean.TRUE.toString()); Map legacyDiscriminatorBehaviorOpts = new HashMap<>(); legacyDiscriminatorBehaviorOpts.put("true", "The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document."); - legacyDiscriminatorBehaviorOpts.put("false", "The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing."); + legacyDiscriminatorBehaviorOpts.put("false", + "The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing."); legacyDiscriminatorBehaviorOpt.setEnum(legacyDiscriminatorBehaviorOpts); cliOptions.add(legacyDiscriminatorBehaviorOpt); @@ -2287,7 +2311,6 @@ public String getSchemaType(Schema schema) { } - protected Schema getSchemaAdditionalProperties(Schema schema) { Schema inner = ModelUtils.getAdditionalProperties(schema); if (inner == null) { @@ -2361,7 +2384,7 @@ public Schema unaliasSchema(Schema schema) { return ModelUtils.unaliasSchema(this.openAPI, schema, schemaMapping); } - private List> unaliasExamples(Map examples){ + private List> unaliasExamples(Map examples) { return ExamplesUtils.unaliasExamples(this.openAPI, examples); } @@ -2633,6 +2656,7 @@ public String toModelName(final String name) { } private static class NamedSchema { + private NamedSchema(String name, Schema s, boolean required, boolean schemaIsFromAdditionalProperties) { this.name = name; this.schema = s; @@ -2647,13 +2671,15 @@ private NamedSchema(String name, Schema s, boolean required, boolean schemaIsFro @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; NamedSchema that = (NamedSchema) o; return Objects.equals(required, that.required) && - Objects.equals(name, that.name) && - Objects.equals(schema, that.schema) && - Objects.equals(schemaIsFromAdditionalProperties, that.schemaIsFromAdditionalProperties); + Objects.equals(name, that.name) && + Objects.equals(schema, that.schema) && + Objects.equals(schemaIsFromAdditionalProperties, that.schemaIsFromAdditionalProperties); } @Override @@ -2675,7 +2701,7 @@ protected void updateModelForComposedSchema(CodegenModel m, Schema schema, Map vis } if (discriminatorsPropNames.size() > 1) { once(LOGGER).warn("The oneOf schemas have conflicting discriminator property names. " + - "oneOf schemas must have the same property name, but found " + String.join(", ", discriminatorsPropNames)); + "oneOf schemas must have the same property name, but found " + String.join(", ", discriminatorsPropNames)); } if (foundDisc != null && (hasDiscriminatorCnt + hasNullTypeCnt) == composedSchema.getOneOf().size() && discriminatorsPropNames.size() == 1) { disc.setPropertyName(foundDisc.getPropertyName()); @@ -3470,7 +3496,7 @@ private Discriminator recursiveGetDiscriminator(Schema sc, ArrayList vis } if (discriminatorsPropNames.size() > 1) { once(LOGGER).warn("The anyOf schemas have conflicting discriminator property names. " + - "anyOf schemas must have the same property name, but found " + String.join(", ", discriminatorsPropNames)); + "anyOf schemas must have the same property name, but found " + String.join(", ", discriminatorsPropNames)); } if (foundDisc != null && (hasDiscriminatorCnt + hasNullTypeCnt) == composedSchema.getAnyOf().size() && discriminatorsPropNames.size() == 1) { disc.setPropertyName(foundDisc.getPropertyName()); @@ -3669,7 +3695,7 @@ protected CodegenDiscriminator createDiscriminator(String schemaName, Schema sch boolean matched = false; for (MappedModel uniqueDescendant : uniqueDescendants) { if (uniqueDescendant.getMappingName().equals(otherDescendant.getMappingName()) - || (uniqueDescendant.getModelName().equals(otherDescendant.getModelName()))) { + || (uniqueDescendant.getModelName().equals(otherDescendant.getModelName()))) { matched = true; break; } @@ -3867,9 +3893,9 @@ protected void updatePropertyForAnyType(CodegenProperty property, Schema p) { } property.isNullable = property.isNullable || - !(ModelUtils.isComposedSchema(p)) || - p.getAllOf() == null || - p.getAllOf().size() == 0; + !(ModelUtils.isComposedSchema(p)) || + p.getAllOf() == null || + p.getAllOf().size() == 0; if (languageSpecificPrimitives.contains(property.dataType)) { property.isPrimitiveType = true; } @@ -3945,7 +3971,6 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required) { return fromProperty(name, p, required, false); } - /** * TODO remove this in 7.0.0 as a breaking change * This method was kept when required was added to the fromProperty signature @@ -4126,7 +4151,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo if (referencedSchema.getNullable() != null) { property.isNullable = referencedSchema.getNullable(); } else if (referencedSchema.getExtensions() != null && - referencedSchema.getExtensions().containsKey(X_NULLABLE)) { + referencedSchema.getExtensions().containsKey(X_NULLABLE)) { property.isNullable = (Boolean) referencedSchema.getExtensions().get(X_NULLABLE); } @@ -4210,9 +4235,9 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo } boolean isAnyTypeWithNothingElseSet = (ModelUtils.isAnyType(p) && - (p.getProperties() == null || p.getProperties().isEmpty()) && - !ModelUtils.isComposedSchema(p) && - p.getAdditionalProperties() == null && p.getNot() == null && p.getEnum() == null); + (p.getProperties() == null || p.getProperties().isEmpty()) && + !ModelUtils.isComposedSchema(p) && + p.getAdditionalProperties() == null && p.getNot() == null && p.getEnum() == null); if (!ModelUtils.isArraySchema(p) && !ModelUtils.isMapSchema(p) && !ModelUtils.isFreeFormObject(p, openAPI) && !isAnyTypeWithNothingElseSet) { /* schemas that are not Array, not ModelUtils.isMapSchema, not isFreeFormObject, not AnyType with nothing else set @@ -4291,7 +4316,7 @@ public CodegenProperty fromProperty(String name, Schema p, boolean required, boo * update container's default to empty container according rules provided by the user. * * @param cp codegen property - * @param p schema + * @param p schema */ void updateDefaultToEmptyContainer(CodegenProperty cp, Schema p) { if (cp.isArray) { @@ -4333,7 +4358,7 @@ void updateDefaultToEmptyContainer(CodegenProperty cp, Schema p) { void parseDefaultToEmptyContainer(String input) { String[] inputs = ((String) input).split("[|]"); String containerType; - for (String rule: inputs) { + for (String rule : inputs) { if (StringUtils.isEmpty(rule)) { LOGGER.error("updateDefaultToEmptyContainer: Skipped empty input in `{}`.", input); continue; @@ -4358,7 +4383,7 @@ void parseDefaultToEmptyContainer(String input) { LOGGER.error("Skipped invalid container type `{}` in `{}`.", containerType, input); } } else if (rule.endsWith("?")) { // optional - containerType = rule.substring(0, rule.length()-1); + containerType = rule.substring(0, rule.length() - 1); if ("array".equalsIgnoreCase(containerType)) { arrayOptionalDefaultToEmpty = true; } else if ("map".equalsIgnoreCase(containerType)) { @@ -4468,7 +4493,7 @@ protected Boolean isPropertyInnerMostEnum(CodegenProperty property) { protected CodegenProperty getMostInnerItems(CodegenProperty property) { CodegenProperty currentProperty = property; while (currentProperty != null && (Boolean.TRUE.equals(currentProperty.isMap) - || Boolean.TRUE.equals(currentProperty.isArray)) && currentProperty.items != null) { + || Boolean.TRUE.equals(currentProperty.isArray)) && currentProperty.items != null) { currentProperty = currentProperty.items; } return currentProperty; @@ -4488,7 +4513,7 @@ protected Map getInnerEnumAllowableValues(CodegenProperty proper protected void updateDataTypeWithEnumForArray(CodegenProperty property) { CodegenProperty baseItem = property.items; while (baseItem != null && (Boolean.TRUE.equals(baseItem.isMap) - || Boolean.TRUE.equals(baseItem.isArray))) { + || Boolean.TRUE.equals(baseItem.isArray))) { baseItem = baseItem.items; } if (baseItem != null) { @@ -4516,7 +4541,7 @@ protected void updateDataTypeWithEnumForArray(CodegenProperty property) { protected void updateDataTypeWithEnumForMap(CodegenProperty property) { CodegenProperty baseItem = property.items; while (baseItem != null && (Boolean.TRUE.equals(baseItem.isMap) - || Boolean.TRUE.equals(baseItem.isArray))) { + || Boolean.TRUE.equals(baseItem.isArray))) { baseItem = baseItem.items; } @@ -4577,9 +4602,9 @@ protected ApiResponse findMethodResponse(ApiResponses responses) { * @param methodResponse the default ApiResponse for the endpoint */ protected void handleMethodResponse(Operation operation, - Map schemas, - CodegenOperation op, - ApiResponse methodResponse) { + Map schemas, + CodegenOperation op, + ApiResponse methodResponse) { handleMethodResponse(operation, schemas, op, methodResponse, Collections.emptyMap()); } @@ -4593,10 +4618,10 @@ protected void handleMethodResponse(Operation operation, * @param schemaMappings mappings of external types to be omitted by unaliasing */ protected void handleMethodResponse(Operation operation, - Map schemas, - CodegenOperation op, - ApiResponse methodResponse, - Map schemaMappings) { + Map schemas, + CodegenOperation op, + ApiResponse methodResponse, + Map schemaMappings) { ApiResponse response = ModelUtils.getReferencedApiResponse(openAPI, methodResponse); Schema responseSchema = unaliasSchema(ModelUtils.getSchemaFromResponse(openAPI, response)); @@ -4665,9 +4690,9 @@ protected void handleMethodResponse(Operation operation, */ @Override public CodegenOperation fromOperation(String path, - String httpMethod, - Operation operation, - List servers) { + String httpMethod, + Operation operation, + List servers) { LOGGER.debug("fromOperation => operation: {}", operation); if (operation == null) throw new RuntimeException("operation cannot be null in fromOperation"); @@ -4735,8 +4760,8 @@ public CodegenOperation fromOperation(String path, r.setContent(getContent(response.getContent(), imports, mediaTypeSchemaSuffix)); if (r.baseType != null && - !defaultIncludes.contains(r.baseType) && - !languageSpecificPrimitives.contains(r.baseType)) { + !defaultIncludes.contains(r.baseType) && + !languageSpecificPrimitives.contains(r.baseType)) { imports.add(r.baseType); } @@ -4758,14 +4783,14 @@ public CodegenOperation fromOperation(String path, // check if any 4xx or 5xx response has an error response object defined if ((Boolean.TRUE.equals(r.is4xx) || Boolean.TRUE.equals(r.is5xx)) && - Boolean.FALSE.equals(r.primitiveType) && Boolean.FALSE.equals(r.simpleType)) { + Boolean.FALSE.equals(r.primitiveType) && Boolean.FALSE.equals(r.simpleType)) { op.hasErrorResponseObject = Boolean.TRUE; } } // check if the operation can both return a 2xx response with a body and without if (op.responses.stream().anyMatch(response -> response.is2xx && response.dataType != null) && - op.responses.stream().anyMatch(response -> response.is2xx && response.dataType == null)) { + op.responses.stream().anyMatch(response -> response.is2xx && response.dataType == null)) { op.isResponseOptional = Boolean.TRUE; } @@ -4838,8 +4863,8 @@ public CodegenOperation fromOperation(String path, contentType = contentType.toLowerCase(Locale.ROOT); } if (contentType != null && - ((!(this instanceof RustAxumServerCodegen) && contentType.startsWith("application/x-www-form-urlencoded")) || - contentType.startsWith("multipart"))) { + ((!(this instanceof RustAxumServerCodegen) && contentType.startsWith("application/x-www-form-urlencoded")) || + contentType.startsWith("multipart"))) { // process form parameters formParams = fromRequestBodyToFormParameters(requestBody, imports); op.isMultipart = contentType.startsWith("multipart"); @@ -5029,23 +5054,23 @@ public CodegenResponse fromResponse(String responseCode, ApiResponse response) { r.code = responseCode; switch (r.code.charAt(0)) { - case '1': - r.is1xx = true; - break; - case '2': - r.is2xx = true; - break; - case '3': - r.is3xx = true; - break; - case '4': - r.is4xx = true; - break; - case '5': - r.is5xx = true; - break; - default: - throw new RuntimeException("Invalid response code " + responseCode); + case '1': + r.is1xx = true; + break; + case '2': + r.is2xx = true; + break; + case '3': + r.is3xx = true; + break; + case '4': + r.is4xx = true; + break; + case '5': + r.is5xx = true; + break; + default: + throw new RuntimeException("Invalid response code " + responseCode); } } @@ -5275,7 +5300,6 @@ private void finishUpdatingParameter(CodegenParameter codegenParameter, Paramete LOGGER.debug("debugging codegenParameter return: {}", codegenParameter); } - private void updateParameterForMap(CodegenParameter codegenParameter, Schema parameterSchema, Set imports) { CodegenProperty codegenProperty = fromProperty("inner", ModelUtils.getAdditionalProperties(parameterSchema), false); codegenParameter.items = codegenProperty; @@ -5855,7 +5879,7 @@ protected String getOrGenerateOperationId(Operation operation, String path, Stri */ protected boolean needToImport(String type) { return StringUtils.isNotBlank(type) && !defaultIncludes.contains(type) - && !languageSpecificPrimitives.contains(type); + && !languageSpecificPrimitives.contains(type); } @SuppressWarnings("static-method") @@ -6064,7 +6088,7 @@ protected Map unaliasPropertySchema(Map properti } protected void addVars(CodegenModel m, Map properties, List required, - Map allProperties, List allRequired) { + Map allProperties, List allRequired) { m.hasRequired = false; m.hasReadOnly = false; @@ -6267,7 +6291,7 @@ private Boolean isAliasOfSimpleTypes(Schema schema) { // allOf with a single item if (schema.getAllOf() != null && schema.getAllOf().size() == 1 - && schema.getAllOf().get(0) instanceof Schema) { + && schema.getAllOf().get(0) instanceof Schema) { schema = unaliasSchema((Schema) schema.getAllOf().get(0)); schema = ModelUtils.getReferencedSchema(this.openAPI, schema); } @@ -7042,7 +7066,6 @@ public boolean convertPropertyToBooleanAndWriteBack(String propertyKey) { return result; } - /** * reads propertyKey from additionalProperties, converts it to a boolean and * writes it back to additionalProperties to be usable as a boolean in @@ -7117,6 +7140,20 @@ public void setIgnoreFilePathOverride(final String ignoreFileOverride) { this.ignoreFilePathOverride = ignoreFileOverride; } + public Map getPropertyAsStringMap(String propertyKey) { + final Object value = additionalProperties.get(propertyKey); + if (value instanceof Map) { + Map rawMap = (Map) value; + Map stringMap = new HashMap<>(); + for (Map.Entry entry : rawMap.entrySet()) { + stringMap.put(String.valueOf(entry.getKey()), String.valueOf(entry.getValue())); + } + return stringMap; + } + return Collections.emptyMap(); + } + + public boolean convertPropertyToBoolean(String propertyKey) { final Object booleanValue = additionalProperties.get(propertyKey); boolean result = Boolean.FALSE; @@ -7220,8 +7257,8 @@ public boolean hasFormParameter(Operation operation) { for (String consume : consumesInfo) { if (consume != null && - (consume.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") || - consume.toLowerCase(Locale.ROOT).startsWith("multipart"))) { + (consume.toLowerCase(Locale.ROOT).startsWith("application/x-www-form-urlencoded") || + consume.toLowerCase(Locale.ROOT).startsWith("multipart"))) { return true; } } @@ -7340,7 +7377,7 @@ public List fromRequestBodyToFormParameters(RequestBody body, Schema original = null; // check if it's allOf (only 1 sub schema) with or without default/nullable/etc set in the top level if (ModelUtils.isAllOf(schema) && schema.getAllOf().size() == 1 && - (ModelUtils.getType(schema) == null || "object".equals(ModelUtils.getType(schema)))) { + (ModelUtils.getType(schema) == null || "object".equals(ModelUtils.getType(schema)))) { if (schema.getAllOf().get(0) instanceof Schema) { original = schema; schema = (Schema) schema.getAllOf().get(0); @@ -7632,9 +7669,9 @@ protected void addBodyModelSchema(CodegenParameter codegenParameter, String name codegenModelDescription = codegenModel.description; } else { LOGGER.warn("The following schema has undefined (null) baseType. " + - "It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " + - "A correct 'consumes' for form parameters should be " + - "'application/x-www-form-urlencoded' or 'multipart/?'"); + "It could be due to form parameter defined in OpenAPI v2 spec with incorrect consumes. " + + "A correct 'consumes' for form parameters should be " + + "'application/x-www-form-urlencoded' or 'multipart/?'"); LOGGER.warn("schema: {}", schema); LOGGER.warn("codegenModel is null. Default to UNKNOWN_BASE_TYPE"); codegenModelName = "UNKNOWN_BASE_TYPE"; @@ -7698,7 +7735,6 @@ protected void updateRequestBodyForMap(CodegenParameter codegenParameter, Schema innerCp = innerCp.items; } - if (StringUtils.isEmpty(bodyParameterName)) { codegenParameter.baseName = "request_body"; } else { @@ -7993,7 +8029,7 @@ public CodegenParameter fromRequestBody(RequestBody body, Set imports, S Schema original = null; // check if it's allOf (only 1 sub schema) with or without default/nullable/etc set in the top level if (ModelUtils.isAllOf(schema) && schema.getAllOf().size() == 1 && - (ModelUtils.getType(schema) == null || "object".equals(ModelUtils.getType(schema)))) { + (ModelUtils.getType(schema) == null || "object".equals(ModelUtils.getType(schema)))) { if (schema.getAllOf().get(0) instanceof Schema) { original = schema; schema = (Schema) schema.getAllOf().get(0); @@ -8381,7 +8417,7 @@ protected boolean executePostProcessor(String[] commandArr) { int exitValue = p.exitValue(); if (exitValue != 0) { try (InputStreamReader inputStreamReader = new InputStreamReader(p.getErrorStream(), StandardCharsets.UTF_8); - BufferedReader br = new BufferedReader(inputStreamReader)) { + BufferedReader br = new BufferedReader(inputStreamReader)) { StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()) != null) { @@ -8550,6 +8586,7 @@ protected void modifyFeatureSet(Consumer processor) { */ @Getter private static class SanitizeNameOptions { + public SanitizeNameOptions(String name, String removeCharRegEx, List exceptions) { this.name = name; this.removeCharRegEx = removeCharRegEx; @@ -8566,12 +8603,14 @@ public SanitizeNameOptions(String name, String removeCharRegEx, List exc @Override public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; + if (this == o) + return true; + if (o == null || getClass() != o.getClass()) + return false; SanitizeNameOptions that = (SanitizeNameOptions) o; return Objects.equals(getName(), that.getName()) && - Objects.equals(getRemoveCharRegEx(), that.getRemoveCharRegEx()) && - Objects.equals(getExceptions(), that.getExceptions()); + Objects.equals(getRemoveCharRegEx(), that.getRemoveCharRegEx()) && + Objects.equals(getExceptions(), that.getExceptions()); } @Override @@ -8677,7 +8716,7 @@ private List getComposedProperties(List xOfCollection, i += 1; if (dataTypeSet.contains(cp.dataType) - || (isTypeErasedGenerics() && dataTypeSet.contains(cp.baseType))) { + || (isTypeErasedGenerics() && dataTypeSet.contains(cp.baseType))) { // add "x-duplicated-data-type" to indicate if the (base) dataType already occurs before // in other sub-schemas of allOf/anyOf/oneOf cp.vendorExtensions.putIfAbsent("x-duplicated-data-type", true); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 769e708c6d6d..8832add51213 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -56,6 +56,7 @@ import org.slf4j.LoggerFactory; import javax.lang.model.SourceVersion; + import java.io.File; import java.time.LocalDate; import java.time.ZoneId; @@ -63,6 +64,7 @@ import java.time.format.DateTimeFormatter; import java.util.*; import java.util.concurrent.ConcurrentSkipListSet; +import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Collectors; @@ -90,7 +92,8 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix"; public static final String IGNORE_ANYOF_IN_ENUM = "ignoreAnyOfInEnum"; public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations"; - public static final String SKIP_X_IMPLEMENTS = "skipXImplements"; + public static final String X_IMPLEMENTS_OVERRIDES = "xImplementsOverrides"; + private static final String X_IMPLEMENTS_OVERRIDES_SKIP = "skip"; public static final String ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS = "additionalOneOfTypeAnnotations"; public static final String ADDITIONAL_ENUM_TYPE_ANNOTATIONS = "additionalEnumTypeAnnotations"; public static final String DISCRIMINATOR_CASE_SENSITIVE = "discriminatorCaseSensitive"; @@ -181,7 +184,7 @@ protected enum ENUM_PROPERTY_NAMING_TYPE {MACRO_CASE, legacy, original} protected List additionalModelTypeAnnotations = new LinkedList<>(); @Getter @Setter - protected List skipXImplements = new LinkedList<>(); + protected Map xImplementsOverrides = new HashMap<>(); protected Map lombokAnnotations = null; @Getter @Setter protected List additionalOneOfTypeAnnotations = new LinkedList<>(); @@ -342,7 +345,7 @@ public AbstractJavaCodegen() { cliOptions.add(CliOption.newBoolean(IGNORE_ANYOF_IN_ENUM, "Ignore anyOf keyword in enum", ignoreAnyOfInEnum)); cliOptions.add(CliOption.newString(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, "Additional annotations for enum type(class level annotations)")); cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); - cliOptions.add(CliOption.newString(SKIP_X_IMPLEMENTS, "Ability to exclude interfaces that are specified using x-implements vendor extension. List separated by semicolon(;) or new line (Linux or Windows)")); + cliOptions.add(CliOption.newString(X_IMPLEMENTS_OVERRIDES, "Ability to exclude or replace interfaces that are specified using x-implements vendor extension. TODO:::")); cliOptions.add(CliOption.newString(ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS, "Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.", this.openApiNullable)); cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); @@ -453,9 +456,9 @@ public void processOpts() { convertPropertyToTypeAndWriteBack(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, annotations -> Arrays.asList(annotations.split(";")), this::setAdditionalEnumTypeAnnotations); - convertPropertyToTypeAndWriteBack(SKIP_X_IMPLEMENTS, - interfacesToSkipImplementing -> Arrays.asList(SPLIT_ON_SEMICOLON_OR_NEWLINE_REGEX.split(interfacesToSkipImplementing.trim())), - this::setSkipXImplements); + if (additionalProperties.containsKey(X_IMPLEMENTS_OVERRIDES)) { + this.setXImplementsOverrides(getPropertyAsStringMap(X_IMPLEMENTS_OVERRIDES)); + } if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); @@ -2005,25 +2008,40 @@ public ModelsMap postProcessModels(ModelsMap objs) { } } - // skip interfaces predefined in x-implements if excluded via x-implements-skip-interfaces - if (!this.skipXImplements.isEmpty()) { - LOGGER.info("Models will be post-processed to remove any implementations of the following interfaces: {}", this.skipXImplements); - List interfacesToNotImplement = this.skipXImplements; + // skip or substitute interfaces predefined in x-implements via xImplementsOverrides + if (!this.xImplementsOverrides.isEmpty()) { + List interfacesToSkip = this.xImplementsOverrides.entrySet().stream() + .filter(entry -> entry.getValue().equals(X_IMPLEMENTS_OVERRIDES_SKIP)) + .map(Map.Entry::getKey) + .collect(Collectors.toList()); + Map interfacesSubstituteFromTo = this.xImplementsOverrides.entrySet().stream() + .filter(entry -> !entry.getValue().equals(X_IMPLEMENTS_OVERRIDES_SKIP)) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); for (ModelMap mo : objs.getModels()) { CodegenModel cm = mo.getModel(); if (cm.getVendorExtensions().containsKey(X_IMPLEMENTS)) { - List originalXImplements = (ArrayList) cm.getVendorExtensions().get(X_IMPLEMENTS); - List preservedXImplements = originalXImplements - .stream() - .filter(interfaceToImplement -> !interfacesToNotImplement.contains(interfaceToImplement)) - .collect(Collectors.toCollection(ArrayList::new)); - List filteredOutXImplements = originalXImplements + List xImplementsInModelOriginal = (List) cm.getVendorExtensions().get(X_IMPLEMENTS); + List xImplementsInModelSkipped = xImplementsInModelOriginal .stream() - .filter(interfacesToNotImplement::contains) + .filter(interfacesToSkip::contains) + .collect(Collectors.toList()); + Map xImplementsInModelSubstituteFromTo = interfacesSubstituteFromTo.entrySet().stream() + .filter(entry -> xImplementsInModelOriginal.contains(entry.getKey())) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + if (!xImplementsInModelSkipped.isEmpty()) { + LOGGER.info("Following interfaces will be skipped for model {}: {}", cm.classname, xImplementsInModelSkipped); + } + if (!xImplementsInModelSubstituteFromTo.isEmpty()) { + LOGGER.info("Following interfaces will be replaced for model {}: {}", cm.classname, xImplementsInModelSubstituteFromTo.entrySet().stream() + .map(entry -> " from [" + entry.getKey() + "] to [" + entry.getValue() + "]") + .collect(Collectors.joining(","))); + } + List xImplementsInModelProcessed = xImplementsInModelOriginal.stream() + .filter(Predicate.not(xImplementsInModelSkipped::contains)) + .map(item -> xImplementsInModelSubstituteFromTo.getOrDefault(item, item)) .collect(Collectors.toList()); - LOGGER.info("Following interfaces will be skipped for model {}: {}", cm.classname, filteredOutXImplements); - // implement only the non-filtered-out interfaces - cm.getVendorExtensions().replace(X_IMPLEMENTS, preservedXImplements); + // implement only the non-filtered-out interfaces and replaced interfaces + cm.getVendorExtensions().replace(X_IMPLEMENTS, xImplementsInModelProcessed); } } } diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml new file mode 100644 index 000000000000..1772f4975380 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml @@ -0,0 +1,2068 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + - url: 'http://{server}.swagger.io:{port}/v2' + description: test server with variables + variables: + server: + description: target server + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: Successful operation + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + x-webclient-blocking: true + responses: + '200': + description: Successful operation + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + x-webclient-blocking: true + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + x-webclient-blocking: true + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + uniqueItems: true + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + uniqueItems: true + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + uniqueItems: true + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + x-webclient-blocking: true + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: Successful operation + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: Successful operation + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + x-webclient-blocking: false + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + - name: enum_query_model_array + in: query + schema: + type: array + items: + $ref: '#/components/schemas/EnumClass' + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Something wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/property/enum-int: + post: + tags: + - fake + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + responses: + '200': + description: Output enum (int) + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/BigDecimalMap: + get: + tags: + - fake + description: for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + operationId: fakeBigDecimalMap + responses: + '200': + description: successful operation + content: + '*/*': + schema: + type: object + properties: + someId: + type: number + someMap: + type: object + additionalProperties: + type: number + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/additionalProperties-reference: + post: + tags: + - fake + summary: test referenced additionalProperties + description: '' + operationId: testAdditionalPropertiesReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true + /fake/nullable: + post: + tags: + - fake + summary: test nullable parent property + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request must reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/body-with-binary: + put: + tags: + - fake + description: >- + For this test, the body has to be a binary file. + operationId: testBodyWithBinary + responses: + '200': + description: Success + requestBody: + content: + image/png: + schema: + type: string + nullable: true + format: binary + description: image to upload + required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + style: pipeDelimited + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + - name: language + in: query + required: false + schema: + type: object + additionalProperties: + type: string + format: string + - name: allowEmpty + in: query + required: true + allowEmptyValue: true + schema: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/http-signature-test: + get: + tags: + - fake + summary: test http signature authentication + operationId: fake-http-signature-test + parameters: + - name: query_1 + in: query + description: query parameter + required: optional + schema: + type: string + - name: header_1 + in: header + description: header parameter + required: optional + schema: + type: string + security: + - http_signature_test: [] + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 200: + description: The instance started successfully +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_varaible + description: The local server without variables +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + wrapped: true + items: + type: string + xml: + name: photoUrl + uniqueItems: true + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Animal: + type: object + x-implements: + - com.custompackage.InterfaceToSubstitute + - com.custompackage.InterfaceToSkip + - com.custompackage.InterfaceToKeep + discriminator: + propertyName: className + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + minItems: 0 + maxItems: 3 + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + FreeFormObject: + type: object + description: A schema consisting only of additional properties + additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + example: 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + type: object + discriminator: + propertyName: type + properties: + type: + type: string + enum: + - ChildWithNullable + nullableProperty: + type: string + nullable: true + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - type: object + properties: + otherProperty: + type: string + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + OuterObjectWithEnumProperty: + type: object + example: + value: 2 + required: + - value + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + AllOfWithSingleRef: + type: object + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + SingleRefType: + type: string + title: SingleRefType + enum: + - admin + - user From 681aabfe5086810276536b6732f3097f00ab3320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Wed, 28 Jan 2026 01:12:05 +0100 Subject: [PATCH 04/21] add basic unit test for x-implements and x-implements-overrides --- .../java/assertions/JavaFileAssert.java | 33 ++ .../java/spring/SpringCodegenTest.java | 283 +++++++++--------- 2 files changed, 176 insertions(+), 140 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java index d6c9d229ea2f..db79fecc3128 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/JavaFileAssert.java @@ -5,6 +5,7 @@ import com.github.javaparser.ast.body.*; import com.github.javaparser.ast.nodeTypes.NodeWithName; import com.github.javaparser.ast.nodeTypes.modifiers.NodeWithAbstractModifier; +import com.github.javaparser.ast.type.ClassOrInterfaceType; import org.assertj.core.api.AbstractAssert; import org.assertj.core.api.Assertions; import org.assertj.core.util.CanIgnoreReturnValue; @@ -15,7 +16,9 @@ import java.util.Arrays; import java.util.List; import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; +import java.util.stream.Stream; @CanIgnoreReturnValue public class JavaFileAssert extends AbstractAssert { @@ -56,6 +59,36 @@ public JavaFileAssert isNormalClass() { return this; } + public JavaFileAssert implementsInterfaces(String... implementedInterfaces) { + Set expectedInterfaces = Stream.of(implementedInterfaces) + .collect(Collectors.toSet()); + + Set actualInterfaces = actual.getType(0) + .asClassOrInterfaceDeclaration() + .getImplementedTypes().stream() + .map(ClassOrInterfaceType::getNameWithScope) + .collect(Collectors.toSet()); + + Assertions.assertThat(actualInterfaces) + .withFailMessage("Expected type %s to implement interfaces %s, but found %s", + actual.getType(0).getName().asString(), expectedInterfaces, actualInterfaces) + .isEqualTo(expectedInterfaces); + return this; + } + + public JavaFileAssert doesNotImplementInterfaces(String... interfaces) { + Set forbiddenInterfaces = Stream.of(interfaces).collect(Collectors.toSet()); + Set implemented = actual.getType(0).asClassOrInterfaceDeclaration() + .getImplementedTypes().stream() + .map(ClassOrInterfaceType::getNameWithScope) + .collect(Collectors.toSet()); + Assertions.assertThat(implemented) + .withFailMessage("Expected type %s to not implement interfaces %s, but found %s", + actual.getType(0).getName().asString(), forbiddenInterfaces, implemented) + .doesNotContainAnyElementsOf(forbiddenInterfaces); + return this; + } + public JavaFileAssert isAbstractClass() { Assertions.assertThat(actual.getType(0).asClassOrInterfaceDeclaration()) .withFailMessage("Expected type %s to be an abstract class", actual.getType(0).getName().asString()) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 11ca74f3e534..dca275971040 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -64,9 +64,7 @@ import static org.openapitools.codegen.languages.SpringCodegen.*; import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY; import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.fail; +import static org.testng.Assert.*; public class SpringCodegenTest { @@ -648,31 +646,31 @@ public void testInitialConfigValues() throws Exception { openAPI.setInfo(new Info()); codegen.preprocessOpenAPI(openAPI); -// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); -// Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); + // Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); + // Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); -// configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); -// Assert.assertEquals(codegen.modelPackage(), "org.openapitools.model"); -// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model"); + // configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); + // Assert.assertEquals(codegen.modelPackage(), "org.openapitools.model"); + // Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model"); configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); -// Assert.assertEquals(codegen.apiPackage(), "org.openapitools.api"); -// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); + // Assert.assertEquals(codegen.apiPackage(), "org.openapitools.api"); + // Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.api"); -// Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); -// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); + // Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); + // Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.api"); -// Assert.assertEquals(codegen.getBasePackage(), "org.openapitools"); -// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.BASE_PACKAGE), "org.openapitools"); + // Assert.assertEquals(codegen.getBasePackage(), "org.openapitools"); + // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.BASE_PACKAGE), "org.openapitools"); configAssert.assertValue(SpringCodegen.BASE_PACKAGE, "org.openapitools"); -// Assert.assertEquals(codegen.getConfigPackage(), "org.openapitools.configuration"); -// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.CONFIG_PACKAGE), "org.openapitools.configuration"); + // Assert.assertEquals(codegen.getConfigPackage(), "org.openapitools.configuration"); + // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.CONFIG_PACKAGE), "org.openapitools.configuration"); configAssert.assertValue(SpringCodegen.CONFIG_PACKAGE, "org.openapitools.configuration"); -// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.SERVER_PORT), "8082"); + // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.SERVER_PORT), "8082"); configAssert.assertValue(SpringCodegen.SERVER_PORT, "8082"); -// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING), false); + // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING), false); configAssert.assertValue(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING, false); configAssert.assertValue(SpringCodegen.USE_RESPONSE_ENTITY, true); -// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.USE_RESPONSE_ENTITY), true); + // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.USE_RESPONSE_ENTITY), true); } @Test @@ -746,16 +744,16 @@ public void testReactiveMultipartBoot() throws IOException { // Check that the delegate handles the array JavaFileAssert.assertThat(files.get("MultipartArrayApiDelegate.java")) - .assertMethod("multipartArray", "Flux", "ServerWebExchange") - .assertParameter("files").hasType("Flux"); + .assertMethod("multipartArray", "Flux", "ServerWebExchange") + .assertParameter("files").hasType("Flux"); // Check that the api handles the array JavaFileAssert.assertThat(files.get("MultipartArrayApi.java")) - .assertMethod("multipartArray", "Flux", "ServerWebExchange") - .assertParameter("files").hasType("Flux") - .assertParameterAnnotations() - .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"Many files\"")) - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"files\"", "required", "false")); + .assertMethod("multipartArray", "Flux", "ServerWebExchange") + .assertParameter("files").hasType("Flux") + .assertParameterAnnotations() + .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"Many files\"")) + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"files\"", "required", "false")); // UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ // We will contact the contributor of the following test to see if the fix will break their use cases and @@ -766,32 +764,32 @@ public void testReactiveMultipartBoot() throws IOException { // Check that the api handles the single file JavaFileAssert.assertThat(files.get("MultipartSingleApi.java")) - .assertMethod("multipartSingle", "Part", "ServerWebExchange") - .assertParameter("file").hasType("Part") - .assertParameterAnnotations() - .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"One file\"")) - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "false")); + .assertMethod("multipartSingle", "Part", "ServerWebExchange") + .assertParameter("file").hasType("Part") + .assertParameterAnnotations() + .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"One file\"")) + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "false")); // Check that api validates mixed multipart request JavaFileAssert.assertThat(files.get("MultipartMixedApi.java")) - .assertMethod("multipartMixed", "MultipartMixedStatus", "Part", "MultipartMixedRequestMarker", "List", "ServerWebExchange") - .assertParameter("status").hasType("MultipartMixedStatus") - .assertParameterAnnotations() - .containsWithName("Valid") - .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"\"")) - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"status\"", "required", "true")) - .toParameter().toMethod() - .assertParameter("file").hasType("Part") - .assertParameterAnnotations() - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "true")) - .toParameter().toMethod() - .assertParameter("marker").hasType("MultipartMixedRequestMarker") - .assertParameterAnnotations() - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"marker\"", "required", "false")) - .toParameter().toMethod() - .assertParameter("statusArray").hasType("List") - .assertParameterAnnotations() - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"statusArray\"", "required", "false")); + .assertMethod("multipartMixed", "MultipartMixedStatus", "Part", "MultipartMixedRequestMarker", "List", "ServerWebExchange") + .assertParameter("status").hasType("MultipartMixedStatus") + .assertParameterAnnotations() + .containsWithName("Valid") + .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"\"")) + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"status\"", "required", "true")) + .toParameter().toMethod() + .assertParameter("file").hasType("Part") + .assertParameterAnnotations() + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "true")) + .toParameter().toMethod() + .assertParameter("marker").hasType("MultipartMixedRequestMarker") + .assertParameterAnnotations() + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"marker\"", "required", "false")) + .toParameter().toMethod() + .assertParameter("statusArray").hasType("List") + .assertParameterAnnotations() + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"statusArray\"", "required", "false")); } @Test @@ -822,6 +820,28 @@ public void testAdditionalProperties_issue1466() throws IOException { .assertMethod("getAdditionalProperty", "String").hasReturnType("Integer"); } + @Test + public void testXImplements() throws IOException { + final SpringCodegen codegen = new SpringCodegen(); + + final Map files = generateFiles(codegen, "src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml"); + JavaFileAssert.assertThat(files.get("Animal.java")) + .implementsInterfaces("com.custompackage.InterfaceToKeep", "com.custompackage.InterfaceToSkip", "com.custompackage.InterfaceToSubstitute") + .doesNotImplementInterfaces("com.custompackage.SubstitutedInterface"); + } + + @Test + public void testXImplementsOverrides() throws IOException { + final SpringCodegen codegen = new SpringCodegen(); + + codegen.additionalProperties().put(X_IMPLEMENTS_OVERRIDES, Map.of("com.custompackage.InterfaceToSubstitute", "com.custompackage.SubstitutedInterface", "com.custompackage.InterfaceToSkip", "skip")); + + final Map files = generateFiles(codegen, "src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml"); + JavaFileAssert.assertThat(files.get("Animal.java")) + .implementsInterfaces("com.custompackage.InterfaceToKeep", "com.custompackage.SubstitutedInterface") + .doesNotImplementInterfaces("com.custompackage.InterfaceToSubstitute", "com.custompackage.InterfaceToSkip"); + } + @Test public void shouldAddParameterWithInHeaderWhenImplicitHeadersIsTrue_issue14418() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -875,7 +895,6 @@ public void shouldApiNameSuffixForApiClassname() throws IOException { codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); - ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -908,7 +927,6 @@ public void shouldUseTagsForClassname() throws IOException { codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); - ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -942,7 +960,6 @@ public void shouldNotUseTagsForClassname() throws IOException { codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); - ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -1263,7 +1280,6 @@ public void testGenerationOfClientPropertiesConfigurationForOAuth() throws Excep Path filePath = Paths.get(output.getAbsolutePath(), "src/main/java/org/openapitools/configuration/ClientPropertiesConfiguration.java"); - assertFileContains(filePath, "oAuth2AccessCode.put(\"spring.security.oauth2.client.registration.oAuth2AccessCode.redirect-uri\", \"set-oAuth2AccessCode-redirect-uri\" );", "oAuth2AccessCode.put(\"spring.security.oauth2.client.registration.oAuth2AccessCode.authorization-grant-type\", \"authorization_code\" );", @@ -1272,7 +1288,6 @@ public void testGenerationOfClientPropertiesConfigurationForOAuth() throws Excep "oAuth2AccessCode.put(\"spring.security.oauth2.client.provider.oAuth2AccessCode.token-uri\", \"${tokenUrl}\" );", "oAuth2AccessCode.put(\"spring.security.oauth2.client.provider.oAuth2AccessCode.authorization-uri\", \"${authorizationUrl}\" );", - "oAuth2Application.put(\"spring.security.oauth2.client.registration.oAuth2Application.client-id\", \"set-oAuth2Application-client-id\" );", "oAuth2Application.put(\"spring.security.oauth2.client.registration.oAuth2Application.authorization-grant-type\", \"client_credentials\" );", "oAuth2Application.put(\"spring.security.oauth2.client.provider.oAuth2Application.token-uri\", \"/openid-connect/token\" );" @@ -1332,7 +1347,8 @@ private void beanValidationForFormatEmail(boolean useBeanValidation, boolean per JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("PersonWithEmail.java")); if (useBeanValidation) javaFileAssert.hasImports((useJakarta ? "jakarta" : "javax") + ".validation.constraints"); - if (performBeanValidation) javaFileAssert.hasImports("org.hibernate.validator.constraints"); + if (performBeanValidation) + javaFileAssert.hasImports("org.hibernate.validator.constraints"); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PersonWithEmail.java")) .fileContains(contains) .fileDoesNotContain(notContains); @@ -1807,7 +1823,6 @@ public void testDiscriminatorWithMappingIssue14731() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); - codegen.setUseOneOfInterfaces(true); codegen.setLegacyDiscriminatorBehavior(false); codegen.setUseSpringBoot3(true); @@ -1844,7 +1859,6 @@ public void testDiscriminatorWithoutMappingIssue14731() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); - codegen.setUseOneOfInterfaces(true); codegen.setLegacyDiscriminatorBehavior(false); codegen.setUseSpringBoot3(true); @@ -1852,7 +1866,6 @@ public void testDiscriminatorWithoutMappingIssue14731() throws IOException { generator.opts(input).generate(); - assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/ChildWithoutMappingADTO.java"), "@JsonTypeName"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/ChildWithoutMappingBDTO.java"), "@JsonTypeName"); } @@ -1949,23 +1962,23 @@ public void shouldGenerateOneTagAttributeForMultipleTags_Regression11464(String @DataProvider public Object[][] issue11464TestCases() { - return new Object[][]{ - {DocumentationProviderFeatures.DocumentationProvider.SPRINGDOC.name(), (Consumer) outputPath -> { + return new Object[][] { + { DocumentationProviderFeatures.DocumentationProvider.SPRINGDOC.name(), (Consumer) outputPath -> { assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/NoneApi.java"), "@Operation( operationId = \"getNone\", summary = \"No Tag\", responses = {"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SingleApi.java"), "@Operation( operationId = \"getSingleTag\", summary = \"Single Tag\", tags = { \"tag1\" }, responses = {"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/MultipleApi.java"), "@Operation( operationId = \"getMultipleTags\", summary = \"Multiple Tags\", tags = { \"tag1\", \"tag2\" }, responses = {"); - }}, - {DocumentationProviderFeatures.DocumentationProvider.SPRINGFOX.name(), (Consumer) outputPath -> { + } }, + { DocumentationProviderFeatures.DocumentationProvider.SPRINGFOX.name(), (Consumer) outputPath -> { assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/NoneApi.java"), "@ApiOperation( value = \"No Tag\", nickname = \"getNone\", notes = \"\", response = "); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SingleApi.java"), "@ApiOperation( tags = { \"tag1\" }, value = \"Single Tag\", nickname = \"getSingleTag\", notes = \"\", response = "); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/MultipleApi.java"), "@ApiOperation( tags = { \"tag1\", \"tag2\" }, value = \"Multiple Tags\", nickname = \"getMultipleTags\", notes = \"\", response = "); - }}, + } }, }; } @@ -2295,7 +2308,6 @@ public void paramObjectImportForDifferentSpringBootVersions_issue14077() throws .assertParameterAnnotations() .containsWithName("ParameterObject"); - // different import for SB3 additionalProperties.put(USE_SPRING_BOOT3, "true"); files = generateFromContract("src/test/resources/2_0/petstore-with-spring-pageable.yaml", SPRING_BOOT, additionalProperties); @@ -2328,43 +2340,43 @@ public void paramPageableIsNotSpringPaginated_issue13052() throws Exception { @DataProvider(name = "sealedScenarios") public static Object[][] sealedScenarios() { - return new Object[][]{ - {"oneof_polymorphism_and_inheritance.yaml", Map.of( + return new Object[][] { + { "oneof_polymorphism_and_inheritance.yaml", Map.of( "Foo.java", "public final class Foo extends Entity implements FooRefOrValue", "FooRef.java", "public final class FooRef extends EntityRef implements FooRefOrValue", "FooRefOrValue.java", "public sealed interface FooRefOrValue permits Foo, FooRef ", - "Entity.java", "public sealed class Entity extends RepresentationModel permits Bar, BarCreate, Foo, Pasta, Pizza {")}, - {"oneOf_additionalProperties.yaml", Map.of( + "Entity.java", "public sealed class Entity extends RepresentationModel permits Bar, BarCreate, Foo, Pasta, Pizza {") }, + { "oneOf_additionalProperties.yaml", Map.of( "SchemaA.java", "public final class SchemaA extends RepresentationModel implements PostRequest {", - "PostRequest.java", "public sealed interface PostRequest permits SchemaA {")}, - {"oneOf_array.yaml", Map.of( - "MyExampleGet200Response.java", "public sealed interface MyExampleGet200Response")}, - {"oneOf_duplicateArray.yaml", Map.of( - "Example.java", "public interface Example {")}, - {"oneOf_nonPrimitive.yaml", Map.of( - "Example.java", "public interface Example {")}, - {"oneOf_primitive.yaml", Map.of( + "PostRequest.java", "public sealed interface PostRequest permits SchemaA {") }, + { "oneOf_array.yaml", Map.of( + "MyExampleGet200Response.java", "public sealed interface MyExampleGet200Response") }, + { "oneOf_duplicateArray.yaml", Map.of( + "Example.java", "public interface Example {") }, + { "oneOf_nonPrimitive.yaml", Map.of( + "Example.java", "public interface Example {") }, + { "oneOf_primitive.yaml", Map.of( "Child.java", "public final class Child extends RepresentationModel implements Example {", - "Example.java", "public sealed interface Example permits Child {")}, - {"oneOf_primitiveAndArray.yaml", Map.of( - "Example.java", "public interface Example {")}, - {"oneOf_reuseRef.yaml", Map.of( + "Example.java", "public sealed interface Example permits Child {") }, + { "oneOf_primitiveAndArray.yaml", Map.of( + "Example.java", "public interface Example {") }, + { "oneOf_reuseRef.yaml", Map.of( "Fruit.java", "public sealed interface Fruit permits Apple, Banana {", "Banana.java", "public final class Banana extends RepresentationModel implements Fruit {", - "Apple.java", "public final class Apple extends RepresentationModel implements Fruit {")}, - {"oneOf_twoPrimitives.yaml", Map.of( - "MyExamplePostRequest.java", "public interface MyExamplePostRequest {")}, - {"oneOfArrayMapImport.yaml", Map.of( + "Apple.java", "public final class Apple extends RepresentationModel implements Fruit {") }, + { "oneOf_twoPrimitives.yaml", Map.of( + "MyExamplePostRequest.java", "public interface MyExamplePostRequest {") }, + { "oneOfArrayMapImport.yaml", Map.of( "Fruit.java", "public interface Fruit {", "Grape.java", "public final class Grape extends RepresentationModel {", - "Apple.java", "public final class Apple extends RepresentationModel {")}, - {"oneOfDiscriminator.yaml", Map.of( + "Apple.java", "public final class Apple extends RepresentationModel {") }, + { "oneOfDiscriminator.yaml", Map.of( "FruitAllOfDisc.java", "public sealed interface FruitAllOfDisc permits AppleAllOfDisc, BananaAllOfDisc {", "AppleAllOfDisc.java", "public final class AppleAllOfDisc extends RepresentationModel implements FruitAllOfDisc {", "BananaAllOfDisc.java", "public final class BananaAllOfDisc extends RepresentationModel implements FruitAllOfDisc {", "FruitReqDisc.java", "public sealed interface FruitReqDisc permits AppleReqDisc, BananaReqDisc {", "AppleReqDisc.java", "public final class AppleReqDisc extends RepresentationModel implements FruitReqDisc {", - "BananaReqDisc.java", "public final class BananaReqDisc extends RepresentationModel implements FruitReqDisc {")} + "BananaReqDisc.java", "public final class BananaReqDisc extends RepresentationModel implements FruitReqDisc {") } }; } @@ -2476,8 +2488,8 @@ public void shouldGenerateDiscriminatorFromAllOfWhenUsingLegacyDiscriminatorBeha String jsonTypeInfo = "@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = \"type\", visible = true)"; String jsonSubType = "@JsonSubTypes({\n" + - " @JsonSubTypes.Type(value = Cat.class, name = \"cat\")" + - "})"; + " @JsonSubTypes.Type(value = Cat.class, name = \"cat\")" + + "})"; assertFileContains(output.get("Pet.java").toPath(), jsonTypeInfo, jsonSubType); } @@ -2549,9 +2561,9 @@ public void requiredFieldShouldIncludeNotNullAnnotation_issue13365() throws IOEx javaFileAssert.assertMethod("getName").assertMethodAnnotations() .containsWithName("NotNull").anyMatch(annotation -> !annotation.getNameAsString().equals("Valid") || - !annotation.getNameAsString().equals("Pattern") || - !annotation.getNameAsString().equals("Email") || - !annotation.getNameAsString().equals("Size")); + !annotation.getNameAsString().equals("Pattern") || + !annotation.getNameAsString().equals("Email") || + !annotation.getNameAsString().equals("Size")); javaFileAssert.hasImports("javax.validation.constraints.NotNull"); } @@ -2578,9 +2590,9 @@ public void requiredFieldShouldIncludeNotNullAnnotationJakarta_issue13365_issue1 javaFileAssert.assertMethod("getName").assertMethodAnnotations() .containsWithName("NotNull").anyMatch(annotation -> !annotation.getNameAsString().equals("Valid") || - !annotation.getNameAsString().equals("Pattern") || - !annotation.getNameAsString().equals("Email") || - !annotation.getNameAsString().equals("Size")); + !annotation.getNameAsString().equals("Pattern") || + !annotation.getNameAsString().equals("Email") || + !annotation.getNameAsString().equals("Size")); javaFileAssert.hasImports("jakarta.validation.constraints.NotNull"); } @@ -2914,7 +2926,7 @@ private Map generateFromContract(String url, String library, Map generateFromContract(String url, String library, Map additionalProperties, - Consumer consumer) throws IOException { + Consumer consumer) throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); output.deleteOnExit(); @@ -2968,8 +2980,8 @@ public void testMappingSubtypesIssue13150() throws IOException { generator.opts(input).generate(); String jsonSubType = "@JsonSubTypes({\n" + - " @JsonSubTypes.Type(value = Foo.class, name = \"foo\")\n" + - "})"; + " @JsonSubTypes.Type(value = Foo.class, name = \"foo\")\n" + + "})"; assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Parent.java"), jsonSubType); } @@ -3659,7 +3671,6 @@ public void doCallFluentParentSettersFromChildModel() throws IOException { generator.setGenerateMetadata(false); // skip metadata generation generator.opts(input).generate(); - JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) // Fluent method assertions .assertMethod("alias") @@ -3716,7 +3727,6 @@ public void testModelsWithNoneOptionalAndJsonNullable() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.opts(input).generate(); - JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") @@ -3932,7 +3942,6 @@ public void testModelsWithOptionalAndJsonNullable() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.opts(input).generate(); - JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") @@ -4148,7 +4157,6 @@ public void testModelsWithOptionalAndNoneJsonNullable() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.opts(input).generate(); - JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") @@ -4383,7 +4391,6 @@ public void testModelsWithNoneOptionalAndNoneOpenApiNullable() throws IOExceptio generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.opts(input).generate(); - JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") @@ -4659,7 +4666,6 @@ private void assertMethod(JavaFileAssert javaFileAssert, Class type, String e assertMethod(javaFileAssert, type.getSimpleName(), expectedName); } - @Test public void multiLineOperationDescription() throws IOException { Map additionalProperties = new HashMap<>(); @@ -5060,7 +5066,6 @@ public void optionalListShouldBeEmpty() throws IOException { codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); - ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -5094,7 +5099,6 @@ public void testCollectionTypesWithDefaults_issue_18102() throws IOException { codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); codegen.setContainerDefaultToNull(true); - ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -5353,14 +5357,14 @@ public void shouldAnnotateNonRequiredFieldsAsNullable() throws IOException { JavaFileAssert.assertThat(file) .fileContains( "public Item(" + - "String mandatoryName," + - " @Nullable String optionalDescription," + - " String optionalOneWithDefault," + - " String nullableStr," + - " List mandatoryContainer," + - " List optionalContainer," + - " List optionalContainerWithDefault," + - " List nullableContainer)" + "String mandatoryName," + + " @Nullable String optionalDescription," + + " String optionalOneWithDefault," + + " String nullableStr," + + " List mandatoryContainer," + + " List optionalContainer," + + " List optionalContainerWithDefault," + + " List nullableContainer)" ); } @@ -5389,9 +5393,9 @@ public void shouldAnnotateNonRequiredFieldsAsNullableWhenSetContainerDefaultToNu JavaFileAssert.assertThat(file) .fileContains( ", List mandatoryContainer," + - " @Nullable List optionalContainer," + - " List optionalContainerWithDefault," + - " List nullableContainer)" + " @Nullable List optionalContainer," + + " List optionalContainerWithDefault," + + " List nullableContainer)" ); } @@ -5420,7 +5424,7 @@ public void shouldNotAnnotateNonRequiredFieldsAsNullableWhileUseOptional() throw JavaFileAssert.assertThat(file) .fileContains( "public Item(String mandatoryName, String optionalDescription," + - " String optionalOneWithDefault, String nullableStr" + " String optionalOneWithDefault, String nullableStr" ); } @@ -5463,9 +5467,9 @@ public void shouldAnnotateNonRequiredFieldsAsNullableWhileNotUsingOpenApiNullabl JavaFileAssert.assertThat(file) .fileContains( " List mandatoryContainer," + - " @Nullable List optionalContainer," + - " List optionalContainerWithDefault," + - " @Nullable List nullableContainer)" + " @Nullable List optionalContainer," + + " List optionalContainerWithDefault," + + " @Nullable List nullableContainer)" ); } @@ -5541,7 +5545,6 @@ public void givenMultipartForm_whenGenerateUsingOptional_thenParameterAreCreated input.openAPI(openAPI); input.config(codegen); - DefaultGenerator generator = new DefaultGenerator(); generator.setGenerateMetadata(false); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); @@ -6058,11 +6061,11 @@ public void testXMinimumMessageAndXMaximumMessage_long() throws IOException { .assertParameter("number") .assertParameterAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of( - "value", "1L", + "value", "1L", "message", "\"Must be positive\"" )) .containsWithNameAndAttributes("Max", ImmutableMap.of( - "value", "99L", + "value", "99L", "message", "\"Must be less than 100\"" )) .toParameter() @@ -6070,11 +6073,11 @@ public void testXMinimumMessageAndXMaximumMessage_long() throws IOException { .assertParameter("token") .assertParameterAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of( - "value", "1L", + "value", "1L", "message", "\"Must be positive\"" )) .containsWithNameAndAttributes("Max", ImmutableMap.of( - "value", "99L", + "value", "99L", "message", "\"Must be less than 100\"" )) .toParameter() @@ -6082,22 +6085,22 @@ public void testXMinimumMessageAndXMaximumMessage_long() throws IOException { .assertParameter("clientNumber") .assertParameterAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of( - "value", "1L", + "value", "1L", "message", "\"Must be positive\"" )) .containsWithNameAndAttributes("Max", ImmutableMap.of( - "value", "99L", + "value", "99L", "message", "\"Must be less than 100\"" )); JavaFileAssert.assertThat(files.get("LongTest.java")) .assertMethod("getField1") .assertMethodAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of( - "value", "1L", + "value", "1L", "message", "\"Must be positive\"" )) .containsWithNameAndAttributes("Max", ImmutableMap.of( - "value", "99L", + "value", "99L", "message", "\"Must be less than 100\"" )) .toMethod() @@ -6126,19 +6129,19 @@ public void annotationLibraryDoesNotCauseImportConflictsInSpring() throws IOExce codegen.additionalProperties().putAll(properties); ClientOptInput input = new ClientOptInput() - .openAPI(openAPI) - .config(codegen); + .openAPI(openAPI) + .config(codegen); DefaultGenerator generator = new DefaultGenerator(); Map files = generator.opts(input).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + .collect(Collectors.toMap(File::getName, Function.identity())); File apiFile = files.get("Schema.java"); assertNotNull(apiFile); JavaFileAssert.assertThat(apiFile).fileDoesNotContain( - "import io.swagger.v3.oas.annotations.media.Schema;" + "import io.swagger.v3.oas.annotations.media.Schema;" ); } @@ -6160,19 +6163,19 @@ public void annotationLibraryDoesNotCauseImportConflictsInSpringWithAnnotationLi codegen.additionalProperties().putAll(properties); ClientOptInput input = new ClientOptInput() - .openAPI(openAPI) - .config(codegen); + .openAPI(openAPI) + .config(codegen); DefaultGenerator generator = new DefaultGenerator(); Map files = generator.opts(input).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + .collect(Collectors.toMap(File::getName, Function.identity())); File apiFile = files.get("Schema.java"); assertNotNull(apiFile); JavaFileAssert.assertThat(apiFile).fileContains( - "import io.swagger.v3.oas.annotations.media.Schema;" + "import io.swagger.v3.oas.annotations.media.Schema;" ); } @@ -6212,7 +6215,7 @@ public void testExtensionsOnSchema_issue9183() throws IOException { .containsWithNameAndAttributes("Pattern", ImmutableMap.of( "regexp", "\"[a-zA-Z]\"", "message", "\"Only letters\"" - )) + )) .toParameter() .toMethod() .assertParameter("token") @@ -6220,7 +6223,7 @@ public void testExtensionsOnSchema_issue9183() throws IOException { .containsWithNameAndAttributes("Pattern", ImmutableMap.of( "regexp", "\"[0-9a-fA-F]\"", "message", "\"Only numbers and letters a-f\"" - )); + )); } } From f17b647670a2fa13305a5ecb1478974b44c707eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Wed, 28 Jan 2026 10:54:19 +0100 Subject: [PATCH 05/21] add implementation and unit test for schemaImplements --- .../openapitools/codegen/DefaultCodegen.java | 20 ++++++++++++ .../languages/AbstractJavaCodegen.java | 27 ++++++++++++++-- .../java/spring/SpringCodegenTest.java | 32 ++++++++++++++++--- 3 files changed, 73 insertions(+), 6 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index c522a6739862..461ae2033030 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -7153,6 +7153,26 @@ public Map getPropertyAsStringMap(String propertyKey) { return Collections.emptyMap(); } + public Map> getPropertyAsStringListMap(String propertyKey) { + final Object value = additionalProperties.get(propertyKey); + if (value instanceof Map) { + Map rawMap = (Map) value; + Map> stringMap = new HashMap<>(); + for (Map.Entry entry : rawMap.entrySet()) { + Object entryValue = entry.getValue(); + if (entryValue instanceof List) { + List stringList = ((List) entryValue).stream() + .map(String::valueOf) + .collect(Collectors.toList()); + stringMap.put(String.valueOf(entry.getKey()), stringList); + } else { + stringMap.put(String.valueOf(entry.getKey()), Collections.singletonList(String.valueOf(entryValue))); + } + } + return stringMap; + } + return Collections.emptyMap(); + } public boolean convertPropertyToBoolean(String propertyKey) { final Object booleanValue = additionalProperties.get(propertyKey); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 8832add51213..10956f0fa2fa 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -94,6 +94,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations"; public static final String X_IMPLEMENTS_OVERRIDES = "xImplementsOverrides"; private static final String X_IMPLEMENTS_OVERRIDES_SKIP = "skip"; + public static final String SCHEMA_IMPLEMENTS = "schemaImplements"; public static final String ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS = "additionalOneOfTypeAnnotations"; public static final String ADDITIONAL_ENUM_TYPE_ANNOTATIONS = "additionalEnumTypeAnnotations"; public static final String DISCRIMINATOR_CASE_SENSITIVE = "discriminatorCaseSensitive"; @@ -185,6 +186,9 @@ protected enum ENUM_PROPERTY_NAMING_TYPE {MACRO_CASE, legacy, original} @Getter @Setter protected Map xImplementsOverrides = new HashMap<>(); + @Getter + @Setter + protected Map> schemaImplements = new HashMap<>(); protected Map lombokAnnotations = null; @Getter @Setter protected List additionalOneOfTypeAnnotations = new LinkedList<>(); @@ -459,6 +463,9 @@ public void processOpts() { if (additionalProperties.containsKey(X_IMPLEMENTS_OVERRIDES)) { this.setXImplementsOverrides(getPropertyAsStringMap(X_IMPLEMENTS_OVERRIDES)); } + if (additionalProperties.containsKey(SCHEMA_IMPLEMENTS)) { + this.setSchemaImplements(getPropertyAsStringListMap(SCHEMA_IMPLEMENTS)); + } if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); @@ -2029,10 +2036,10 @@ public ModelsMap postProcessModels(ModelsMap objs) { .filter(entry -> xImplementsInModelOriginal.contains(entry.getKey())) .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); if (!xImplementsInModelSkipped.isEmpty()) { - LOGGER.info("Following interfaces will be skipped for model {}: {}", cm.classname, xImplementsInModelSkipped); + LOGGER.info("Following interfaces configured via additional property '{}' will be skipped for model {}: {}", cm.classname, X_IMPLEMENTS_OVERRIDES, xImplementsInModelSkipped); } if (!xImplementsInModelSubstituteFromTo.isEmpty()) { - LOGGER.info("Following interfaces will be replaced for model {}: {}", cm.classname, xImplementsInModelSubstituteFromTo.entrySet().stream() + LOGGER.info("Following interfaces configured via additional property '{}' will be replaced for model {}: {}", cm.classname, X_IMPLEMENTS_OVERRIDES, xImplementsInModelSubstituteFromTo.entrySet().stream() .map(entry -> " from [" + entry.getKey() + "] to [" + entry.getValue() + "]") .collect(Collectors.joining(","))); } @@ -2045,6 +2052,22 @@ public ModelsMap postProcessModels(ModelsMap objs) { } } } + // add interfaces defined outside of open api spec + if (!this.schemaImplements.isEmpty()) { + for (ModelMap mo : objs.getModels()) { + CodegenModel cm = mo.getModel(); + if (this.schemaImplements.containsKey(cm.getSchemaName())) { + LOGGER.info("Adding interface(s) {} configured via additional property '{}' to model {}", this.schemaImplements.get(cm.getSchemaName()), SCHEMA_IMPLEMENTS, cm.classname); + cm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList()); + List xImplementsInModel = (List) cm.getVendorExtensions().get(X_IMPLEMENTS); + List schemaImplements = this.schemaImplements.get(cm.getSchemaName()); + List combinedSchemaImplements = Stream.concat(xImplementsInModel.stream(), schemaImplements.stream()) + .collect(Collectors.toList()); + // Add all the interfaces combined + cm.getVendorExtensions().replace(X_IMPLEMENTS, combinedSchemaImplements); + } + } + } // add x-implements for serializable to all models for (ModelMap mo : objs.getModels()) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index dca275971040..79a1f4409806 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -834,12 +834,36 @@ public void testXImplements() throws IOException { public void testXImplementsOverrides() throws IOException { final SpringCodegen codegen = new SpringCodegen(); - codegen.additionalProperties().put(X_IMPLEMENTS_OVERRIDES, Map.of("com.custompackage.InterfaceToSubstitute", "com.custompackage.SubstitutedInterface", "com.custompackage.InterfaceToSkip", "skip")); + String interfaceToSubstitute = "com.custompackage.InterfaceToSubstitute"; + String substitutedInterface = "com.custompackage.SubstitutedInterface"; + String interfaceToSkip = "com.custompackage.InterfaceToSkip"; + String skipKeyword = "skip"; + codegen.additionalProperties().put(X_IMPLEMENTS_OVERRIDES, Map.of(interfaceToSubstitute, substitutedInterface, interfaceToSkip, skipKeyword)); final Map files = generateFiles(codegen, "src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml"); JavaFileAssert.assertThat(files.get("Animal.java")) - .implementsInterfaces("com.custompackage.InterfaceToKeep", "com.custompackage.SubstitutedInterface") - .doesNotImplementInterfaces("com.custompackage.InterfaceToSubstitute", "com.custompackage.InterfaceToSkip"); + .implementsInterfaces("com.custompackage.InterfaceToKeep", substitutedInterface) + .doesNotImplementInterfaces(interfaceToSubstitute, interfaceToSkip); + } + + @Test + public void testSchemaImplements() throws IOException { + final SpringCodegen codegen = new SpringCodegen(); + + String fooInterface = "com.custompackage.FooInterface"; + String fooAnotherInterface = "com.custompackage.FooAnotherInterface"; + String anotherInterface = "com.custompackage.AnimalAnotherInterface"; + codegen.additionalProperties().put(SCHEMA_IMPLEMENTS, Map.of( + "Foo", List.of(fooInterface, fooAnotherInterface), /* add multiple interfaces (as list) */ + "Animal", anotherInterface)); /* add just one interface */ + + final Map files = generateFiles(codegen, "src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml"); + JavaFileAssert.assertThat(files.get("Animal.java")) + .implementsInterfaces(anotherInterface, "com.custompackage.InterfaceToSubstitute", "com.custompackage.InterfaceToKeep", "com.custompackage.InterfaceToSkip") + .doesNotImplementInterfaces("com.custompackage.SubstitutedInterface"); + + JavaFileAssert.assertThat(files.get("Foo.java")) + .implementsInterfaces(fooInterface, fooAnotherInterface); } @Test @@ -1147,7 +1171,7 @@ private Map generateFiles(SpringCodegen codegen, String filePath) generator.setGenerateMetadata(false); // skip metadata generation List files = generator.opts(input).generate(); - return files.stream().collect(Collectors.toMap(e -> e.getName().replace(outputPath, ""), i -> i)); + return files.stream().sorted().collect(Collectors.toMap(e -> e.getName().replace(outputPath, ""), i -> i)); } /* From d45c29328670356534cfcf291dda085ec14e8ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Wed, 28 Jan 2026 14:08:02 +0100 Subject: [PATCH 06/21] add "java.io.Serializable" directly via x-kotlin-implements --- .../languages/AbstractKotlinCodegen.java | 8 ++++++++ .../kotlin-spring/dataClass.mustache | 20 +------------------ .../resources/kotlin-spring/model.mustache | 3 --- .../spring/KotlinSpringServerCodegenTest.java | 6 ++---- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../main/kotlin/org/openapitools/model/Cat.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../kotlin/org/openapitools/model/Color.kt | 3 +-- .../main/kotlin/org/openapitools/model/Dog.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../main/kotlin/org/openapitools/model/Cat.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../kotlin/org/openapitools/model/Color.kt | 3 +-- .../main/kotlin/org/openapitools/model/Dog.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- .../kotlin/org/openapitools/model/Category.kt | 3 +-- .../openapitools/model/ModelApiResponse.kt | 3 +-- .../kotlin/org/openapitools/model/Order.kt | 3 +-- .../main/kotlin/org/openapitools/model/Pet.kt | 3 +-- .../main/kotlin/org/openapitools/model/Tag.kt | 3 +-- .../kotlin/org/openapitools/model/User.kt | 3 +-- 112 files changed, 119 insertions(+), 242 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index 4e9d489c7444..a3fd01b12421 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -839,6 +839,7 @@ protected boolean needToImport(String type) { @Override public CodegenModel fromModel(String name, Schema schema) { CodegenModel m = super.fromModel(name, schema); + m.getVendorExtensions().putIfAbsent(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), List.of()); List implementedInterfacesClasses = (List) m.getVendorExtensions().getOrDefault(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), List.of()); List implementedInterfacesFields = Optional.ofNullable((List) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName())) .map(xKotlinImplementsFields -> { @@ -849,6 +850,13 @@ public CodegenModel fromModel(String name, Schema schema) { } return xKotlinImplementsFields; }).orElse(List.of()); + if (serializableModel) { + if (!implementedInterfacesClasses.contains("java.io.Serializable")) { + var implementedInterfacesClassesWithSerializable = new ArrayList<>(implementedInterfacesClasses); + implementedInterfacesClassesWithSerializable.add("java.io.Serializable"); + m.getVendorExtensions().put(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), implementedInterfacesClassesWithSerializable); + } + } m.optionalVars = m.optionalVars.stream().distinct().collect(Collectors.toList()); // Update allVars/requiredVars/optionalVars with isInherited // Each of these lists contains elements that are similar, but they are all cloned diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache index 5f597f12a591..43a446bdfed4 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/dataClass.mustache @@ -19,31 +19,13 @@ {{/-last}}{{/optionalVars}} ){{/discriminator}}{{! no newline }}{{#parent}} : {{{.}}}{{#isMap}}(){{/isMap}}{{! no newline - }}{{#serializableModel}}{{! no newline - }}{{^vendorExtensions.x-kotlin-implements}}, Serializable{{/vendorExtensions.x-kotlin-implements}}{{! no newline - }}{{#vendorExtensions.x-kotlin-implements}}, Serializable, {{! no newline - }}{{#-first}} {{{.}}}{{/-first}}{{! no newline - }}{{^-first}}, {{{.}}}{{/-first}}{{! no newline - }}{{/vendorExtensions.x-kotlin-implements}}{{! no newline - }}{{/serializableModel}}{{! no newline - }}{{^serializableModel}}{{! no newline - }}{{#vendorExtensions.x-kotlin-implements}}, {{{.}}}{{/vendorExtensions.x-kotlin-implements}}{{! no newline - }}{{/serializableModel}}{{! no newline + }}{{#vendorExtensions.x-kotlin-implements}}, {{{.}}}{{/vendorExtensions.x-kotlin-implements}}{{! <- serializableModel is also handled via x-kotlin-implements }}{{/parent}}{{! no newline }}{{^parent}}{{! no newline - }}{{#serializableModel}}{{! no newline - }}{{^vendorExtensions.x-kotlin-implements}} : Serializable{{/vendorExtensions.x-kotlin-implements}}{{! no newline - }}{{#vendorExtensions.x-kotlin-implements}}{{! no newline - }}{{#-first}} : Serializable, {{{.}}}{{/-first}}{{! no newline - }}{{^-first}}, {{{.}}}{{/-first}}{{! no newline - }}{{/vendorExtensions.x-kotlin-implements}}{{! no newline - }}{{/serializableModel}}{{! no newline - }}{{^serializableModel}}{{! no newline }}{{#vendorExtensions.x-kotlin-implements}}{{! no newline }}{{#-first}} : {{{.}}}{{/-first}}{{! no newline }}{{^-first}}, {{{.}}}{{/-first}}{{! no newline }}{{/vendorExtensions.x-kotlin-implements}}{{! no newline - }}{{/serializableModel}}{{! no newline }}{{/parent}} { {{#discriminator}} {{#requiredVars}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache index 75aa97afd0de..f6005b5340f6 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/model.mustache @@ -3,9 +3,6 @@ package {{package}} import java.util.Objects {{#imports}}import {{import}} {{/imports}} -{{#serializableModel}} -import java.io.Serializable -{{/serializableModel}} {{#useBeanValidation}} import {{javaxPackage}}.validation.constraints.DecimalMax import {{javaxPackage}}.validation.constraints.DecimalMin diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index e8101f0d53b5..12f56787d565 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -1003,8 +1003,7 @@ public void generateSerializableModel() throws Exception { Path path = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Pet.kt"); assertFileContains( path, - "import java.io.Serializable", - ") : Serializable {", + ") : java.io.Serializable {", "private const val serialVersionUID: kotlin.Long = 1" ); } @@ -1035,9 +1034,8 @@ public void generateSerializableModelWithXimplements() throws Exception { Path path = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Dog.kt"); assertFileContains( path, - "import java.io.Serializable", "@get:JsonProperty(\"likesFetch\", required = true) override val likesFetch: kotlin.Boolean,", - ") : Pet, Serializable, com.some.pack.Fetchable {", + ") : Pet, com.some.pack.Fetchable, java.io.Serializable {", "private const val serialVersionUID: kotlin.Long = 1" ); } diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Category.kt index 184e7b8c704a..be44647ad001 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -24,7 +23,7 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index a4571ad77d82..8e01881b9571 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt index b9e493090aca..6b034dcbd95c 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -37,7 +36,7 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt index 307a66ec0024..58d842d18ba4 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -42,7 +41,7 @@ data class Pet( @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Tag.kt index 900247827997..5f31c1eea428 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -23,7 +22,7 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/User.kt index bb1ea3ac3a04..07f4aa9cf2c1 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -41,7 +40,7 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Category.kt index 48ce22b8eec3..b7b5e059c976 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -27,7 +26,7 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 616798c86331..394c0098f8f0 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @Schema(example = "null", description = "") @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Order.kt index e7a435ddf443..5b7c406fbc7d 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @Schema(example = "null", description = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt index 1619691b9c3c..cb4f41ddff01 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -49,7 +48,7 @@ data class Pet( @Schema(example = "null", description = "pet status in the store") @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Tag.kt index 1e5390bacdb8..fbcd6bc6890a 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/User.kt index 83e59045601c..2ab37ba8ae92 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @Schema(example = "null", description = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Category.kt index 48ce22b8eec3..b7b5e059c976 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -27,7 +26,7 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 616798c86331..394c0098f8f0 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @Schema(example = "null", description = "") @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Order.kt index e7a435ddf443..5b7c406fbc7d 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @Schema(example = "null", description = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt index 1619691b9c3c..cb4f41ddff01 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -49,7 +48,7 @@ data class Pet( @Schema(example = "null", description = "pet status in the store") @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Tag.kt index 1e5390bacdb8..fbcd6bc6890a 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/User.kt index 83e59045601c..2ab37ba8ae92 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @Schema(example = "null", description = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Category.kt index 48ce22b8eec3..b7b5e059c976 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -27,7 +26,7 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 616798c86331..394c0098f8f0 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @Schema(example = "null", description = "") @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Order.kt index e7a435ddf443..5b7c406fbc7d 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @Schema(example = "null", description = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt index 1619691b9c3c..cb4f41ddff01 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -49,7 +48,7 @@ data class Pet( @Schema(example = "null", description = "pet status in the store") @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Tag.kt index 1e5390bacdb8..fbcd6bc6890a 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/User.kt index 83e59045601c..2ab37ba8ae92 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @Schema(example = "null", description = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Category.kt index 48ce22b8eec3..b7b5e059c976 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -27,7 +26,7 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 616798c86331..394c0098f8f0 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @Schema(example = "null", description = "") @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Order.kt index e7a435ddf443..5b7c406fbc7d 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @Schema(example = "null", description = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt index 1619691b9c3c..cb4f41ddff01 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -49,7 +48,7 @@ data class Pet( @Schema(example = "null", description = "pet status in the store") @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Tag.kt index 1e5390bacdb8..fbcd6bc6890a 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/User.kt index 83e59045601c..2ab37ba8ae92 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @Schema(example = "null", description = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Category.kt index ba0ed3b8c2ea..8dd57ffa6660 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -24,7 +23,7 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 77aa2298dd7a..fdf1b18bd73a 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -26,7 +25,7 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt index 2a0f0386dbc7..0f0b3bee85d1 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -37,7 +36,7 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt index b6b68838d202..2e5bc0d19d69 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -42,7 +41,7 @@ data class Pet( @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Tag.kt index 42d6977703a7..371a5b122269 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -23,7 +22,7 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/User.kt index 5131e4ae3556..2172272f1c0c 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -41,7 +40,7 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt index ba0ed3b8c2ea..8dd57ffa6660 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -24,7 +23,7 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 77aa2298dd7a..fdf1b18bd73a 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -26,7 +25,7 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt index 2a0f0386dbc7..0f0b3bee85d1 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -37,7 +36,7 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt index b6b68838d202..2e5bc0d19d69 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -42,7 +41,7 @@ data class Pet( @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt index 42d6977703a7..371a5b122269 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -23,7 +22,7 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt index 5131e4ae3556..2172272f1c0c 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -41,7 +40,7 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Category.kt index ba0ed3b8c2ea..8dd57ffa6660 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -24,7 +23,7 @@ data class Category( @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 77aa2298dd7a..fdf1b18bd73a 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -26,7 +25,7 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Order.kt index 2a0f0386dbc7..0f0b3bee85d1 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -37,7 +36,7 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt index 9c1d96f53738..eacd4bb4972d 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -42,7 +41,7 @@ data class Pet( @Deprecated(message = "") @get:JsonProperty("status") val status: Pet.Status? = null -) : kotlin.collections.HashMap(), Serializable { +) : kotlin.collections.HashMap(), java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Tag.kt index 42d6977703a7..371a5b122269 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -23,7 +22,7 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/User.kt index 5131e4ae3556..2172272f1c0c 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import jakarta.validation.constraints.DecimalMax import jakarta.validation.constraints.DecimalMin import jakarta.validation.constraints.Email @@ -41,7 +40,7 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt index fbf0f5d0e7c5..8bdc14b3f5a0 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Cat.kt @@ -8,7 +8,6 @@ import org.openapitools.model.Category import org.openapitools.model.Color import org.openapitools.model.Pet import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -56,7 +55,7 @@ data class Cat( @field:Valid @ApiModelProperty(example = "null", value = "") @get:JsonProperty("color") override val color: Color? = null -) : Pet, Serializable { +) : Pet, java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Category.kt index 12900262c2c6..88ad6599859e 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Category( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Color.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Color.kt index b9db254a9abe..13da2b5afecf 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Color.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Color.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonValue import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -20,7 +19,7 @@ import io.swagger.annotations.ApiModelProperty * * Values: black,white,brown,yellow,violet */ -enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDefaultMethods { +enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDefaultMethods , java.io.Serializable { black("black"), white("white"), diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt index 74f02097c6d0..b7e3769d4f7f 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Dog.kt @@ -8,7 +8,6 @@ import org.openapitools.model.Category import org.openapitools.model.Color import org.openapitools.model.Pet import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -60,7 +59,7 @@ data class Dog( @field:Valid @ApiModelProperty(example = "null", value = "") @get:JsonProperty("color") override val color: Color? = null -) : Pet, Serializable, com.some.pack.Fetchable { +) : Pet, com.some.pack.Fetchable, java.io.Serializable { /** * diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 927a8381a5a9..7cfb2ea3091b 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Order.kt index a1db4cfc70d6..4bcfa0d4f201 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index 4899e234a04f..3f436436591e 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Color import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -42,7 +41,7 @@ import io.swagger.annotations.ApiModelProperty JsonSubTypes.Type(value = Dog::class, name = "Dog") ) -interface Pet : Serializable, com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods { +interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods, java.io.Serializable { @get:ApiModelProperty(example = "null", required = true, value = "") override val name: kotlin.String diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Tag.kt index 9523c84659bf..94ca9b340ad4 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/User.kt index 3cf7fc317349..0012d176ce14 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt index e2ca5c5a5ca4..564ad968bb2e 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Category( @Schema(example = "null", description = "") @get:JsonProperty("name") var name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 8adca8bf5bdf..d9b7e8098583 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @Schema(example = "null", description = "") @get:JsonProperty("message") var message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt index c94866f6a49f..8a674d72ff31 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @Schema(example = "null", description = "") @get:JsonProperty("complete") var complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt index fb4209d42c05..24755152a4ba 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -48,7 +47,7 @@ data class Pet( @Schema(example = "null", description = "pet status in the store") @get:JsonProperty("status") var status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt index c5369457cfad..90aec37872e8 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @Schema(example = "null", description = "") @get:JsonProperty("name") var name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt index dcd476f4c7e7..b157be763a0c 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @Schema(example = "null", description = "User Status") @get:JsonProperty("userStatus") var userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Category.kt index 908e5caaa4eb..936b664977b3 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -23,7 +22,7 @@ data class Category( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index a4571ad77d82..8e01881b9571 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Order.kt index b9e493090aca..6b034dcbd95c 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -37,7 +36,7 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index e8f8c4554038..23ee20b45ad8 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -41,7 +40,7 @@ data class Pet( @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Tag.kt index 900247827997..5f31c1eea428 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -23,7 +22,7 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/User.kt index bb1ea3ac3a04..07f4aa9cf2c1 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -41,7 +40,7 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Category.kt index 908e5caaa4eb..936b664977b3 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -23,7 +22,7 @@ data class Category( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index a4571ad77d82..8e01881b9571 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt index b9e493090aca..6b034dcbd95c 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -37,7 +36,7 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt index e8f8c4554038..23ee20b45ad8 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -41,7 +40,7 @@ data class Pet( @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Tag.kt index 900247827997..5f31c1eea428 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -23,7 +22,7 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/User.kt index bb1ea3ac3a04..07f4aa9cf2c1 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -41,7 +40,7 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt index fdee6a74422d..072095d92ad6 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Category( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 8c65203ef7c5..9a75259a855f 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt index 19b646975911..070d17372ab1 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt index 8e099bffc30c..d2d474e56026 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -48,7 +47,7 @@ data class Pet( @ApiModelProperty(example = "null", value = "pet status in the store") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt index cbf75bae9d37..b9d3297258e1 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt index 2884cd2d3a17..f33aedc5b388 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @ApiModelProperty(example = "null", value = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt index d504d73ba63c..fbee84d837b1 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Category( @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index d60644070cc9..b6ac6b461e59 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @Schema(example = "null", description = "") @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt index ad0922579a18..90133d570186 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @Schema(example = "null", description = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt index eb8ea59af44f..f32079718483 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -48,7 +47,7 @@ data class Pet( @Schema(example = "null", description = "pet status in the store") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt index 76ffb42ea0b9..3a4f18f560d2 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @Schema(example = "null", description = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt index e66aedc0d7de..7da797736dbd 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @Schema(example = "null", description = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt index fdee6a74422d..072095d92ad6 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Category( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 8c65203ef7c5..9a75259a855f 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt index 19b646975911..070d17372ab1 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt index 8e099bffc30c..d2d474e56026 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -48,7 +47,7 @@ data class Pet( @ApiModelProperty(example = "null", value = "pet status in the store") @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt index cbf75bae9d37..b9d3297258e1 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt index 2884cd2d3a17..f33aedc5b388 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @ApiModelProperty(example = "null", value = "User Status") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt index fbf0f5d0e7c5..8bdc14b3f5a0 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Cat.kt @@ -8,7 +8,6 @@ import org.openapitools.model.Category import org.openapitools.model.Color import org.openapitools.model.Pet import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -56,7 +55,7 @@ data class Cat( @field:Valid @ApiModelProperty(example = "null", value = "") @get:JsonProperty("color") override val color: Color? = null -) : Pet, Serializable { +) : Pet, java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Category.kt index 12900262c2c6..88ad6599859e 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Category( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Color.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Color.kt index b9db254a9abe..13da2b5afecf 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Color.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Color.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonValue import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -20,7 +19,7 @@ import io.swagger.annotations.ApiModelProperty * * Values: black,white,brown,yellow,violet */ -enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDefaultMethods { +enum class Color(@get:JsonValue val value: kotlin.String) : com.some.pack.WithDefaultMethods , java.io.Serializable { black("black"), white("white"), diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt index 74f02097c6d0..b7e3769d4f7f 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt @@ -8,7 +8,6 @@ import org.openapitools.model.Category import org.openapitools.model.Color import org.openapitools.model.Pet import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -60,7 +59,7 @@ data class Dog( @field:Valid @ApiModelProperty(example = "null", value = "") @get:JsonProperty("color") override val color: Color? = null -) : Pet, Serializable, com.some.pack.Fetchable { +) : Pet, com.some.pack.Fetchable, java.io.Serializable { /** * diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 927a8381a5a9..7cfb2ea3091b 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -30,7 +29,7 @@ data class ModelApiResponse( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Order.kt index a1db4cfc70d6..4bcfa0d4f201 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -44,7 +43,7 @@ data class Order( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Pet.kt index 4899e234a04f..3f436436591e 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Pet.kt @@ -10,7 +10,6 @@ import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Color import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -42,7 +41,7 @@ import io.swagger.annotations.ApiModelProperty JsonSubTypes.Type(value = Dog::class, name = "Dog") ) -interface Pet : Serializable, com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods { +interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods, java.io.Serializable { @get:ApiModelProperty(example = "null", required = true, value = "") override val name: kotlin.String diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Tag.kt index 9523c84659bf..94ca9b340ad4 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class Tag( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/User.kt index 3cf7fc317349..0012d176ce14 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -50,7 +49,7 @@ data class User( @ApiModelProperty(example = "null", value = "") @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt index 908e5caaa4eb..936b664977b3 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Category.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -23,7 +22,7 @@ data class Category( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index a4571ad77d82..8e01881b9571 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -26,7 +25,7 @@ data class ModelApiResponse( @get:JsonProperty("type") val type: kotlin.String? = null, @get:JsonProperty("message") val message: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt index b9e493090aca..6b034dcbd95c 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Order.kt @@ -4,7 +4,6 @@ import java.util.Objects import com.fasterxml.jackson.annotation.JsonCreator import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -37,7 +36,7 @@ data class Order( @get:JsonProperty("status") val status: Order.Status? = null, @get:JsonProperty("complete") val complete: kotlin.Boolean? = false -) : Serializable { +) : java.io.Serializable { /** * Order Status diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt index e8f8c4554038..23ee20b45ad8 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Pet.kt @@ -6,7 +6,6 @@ import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonValue import org.openapitools.model.Category import org.openapitools.model.Tag -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -41,7 +40,7 @@ data class Pet( @get:JsonProperty("tags") val tags: kotlin.collections.List? = null, @get:JsonProperty("status") val status: Pet.Status? = null -) : Serializable { +) : java.io.Serializable { /** * pet status in the store diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt index 900247827997..5f31c1eea428 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/Tag.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -23,7 +22,7 @@ data class Tag( @get:JsonProperty("id") val id: kotlin.Long? = null, @get:JsonProperty("name") val name: kotlin.String? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt index bb1ea3ac3a04..07f4aa9cf2c1 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/model/User.kt @@ -2,7 +2,6 @@ package org.openapitools.model import java.util.Objects import com.fasterxml.jackson.annotation.JsonProperty -import java.io.Serializable import javax.validation.constraints.DecimalMax import javax.validation.constraints.DecimalMin import javax.validation.constraints.Email @@ -41,7 +40,7 @@ data class User( @get:JsonProperty("phone") val phone: kotlin.String? = null, @get:JsonProperty("userStatus") val userStatus: kotlin.Int? = null -) : Serializable { +) : java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 From 039606dcfb69f7ce6da705ebb6d40c733e3904c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Wed, 28 Jan 2026 15:10:22 +0100 Subject: [PATCH 07/21] add schemaImplements and schemaImplementsFields support to kotlin-spring --- ...otlin-spring-boot-x-kotlin-implements.yaml | 8 ++ .../spring-boot-skip-x-implements.yaml | 3 + .../languages/AbstractKotlinCodegen.java | 43 +++++++--- .../spring/KotlinSpringServerCodegenTest.java | 81 ++++++++++++++++++- .../src/main/kotlin/com/some/pack/Canine.kt | 10 +++ .../kotlin/com/some/pack/CategoryInterface.kt | 6 ++ .../src/main/kotlin/com/some/pack/WithId.kt | 6 ++ .../kotlin/org/openapitools/model/Category.kt | 6 +- .../main/kotlin/org/openapitools/model/Dog.kt | 6 +- .../main/kotlin/org/openapitools/model/Pet.kt | 4 +- 10 files changed, 151 insertions(+), 22 deletions(-) create mode 100644 samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/Canine.kt create mode 100644 samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/CategoryInterface.kt create mode 100644 samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/WithId.kt diff --git a/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml b/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml index 1d1218b58452..f40ec19ea242 100644 --- a/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml +++ b/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml @@ -13,3 +13,11 @@ additionalProperties: serializableModel: true beanValidations: true includeHttpRequestContext: true + schemaImplements: + Pet: com.some.pack.WithId + Category: [ com.some.pack.CategoryInterface ] + Dog: [ com.some.pack.Canine ] + schemaImplementsFields: + Pet: id + Category: [ name, id ] + Dog: [ bark, breed ] diff --git a/bin/configs/spring-boot-skip-x-implements.yaml b/bin/configs/spring-boot-skip-x-implements.yaml index bb655bc9bec7..ff407887b0dc 100644 --- a/bin/configs/spring-boot-skip-x-implements.yaml +++ b/bin/configs/spring-boot-skip-x-implements.yaml @@ -12,3 +12,6 @@ additionalProperties: xImplementsOverrides: com.custompackage.InterfaceToSubstitute: com.custompackage.SubstitutedInterface com.custompackage.InterfaceToSkip: skip + schemaImplements: + Foo: [ com.custompackage.FooInterface, com.custompackage.FooIntergace ] + Animal: [ com.custompackage.AnimalInterfaceImplleeements ] diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index a3fd01b12421..5450161e846c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -56,6 +56,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co public static final String JAVAX_PACKAGE = "javaxPackage"; public static final String USE_JAKARTA_EE = "useJakartaEe"; + public static final String SCHEMA_IMPLEMENTS = "schemaImplements"; + public static final String SCHEMA_IMPLEMENTS_FIELDS = "schemaImplementsFields"; private final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class); @@ -88,6 +90,12 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co private final Map schemaKeyToModelNameCache = new HashMap<>(); @Getter @Setter protected List additionalModelTypeAnnotations = new LinkedList<>(); + @Getter + @Setter + protected Map> schemaImplements = new HashMap<>(); + @Getter + @Setter + protected Map> schemaImplementsFields = new HashMap<>(); public AbstractKotlinCodegen() { super(); @@ -515,6 +523,12 @@ public void processOpts() { String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_MODEL_TYPE_ANNOTATIONS).toString(); this.setAdditionalModelTypeAnnotations(Arrays.asList(SPLIT_ON_SEMICOLON_OR_NEWLINE_REGEX.split(additionalAnnotationsList.trim()))); } + if (additionalProperties.containsKey(SCHEMA_IMPLEMENTS)) { + this.setSchemaImplements(getPropertyAsStringListMap(SCHEMA_IMPLEMENTS)); + } + if (additionalProperties.containsKey(SCHEMA_IMPLEMENTS_FIELDS)) { + this.setSchemaImplementsFields(getPropertyAsStringListMap(SCHEMA_IMPLEMENTS_FIELDS)); + } additionalProperties.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, getSortParamsByRequiredFlag()); additionalProperties.put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, getSortModelPropertiesByRequiredFlag()); @@ -840,23 +854,30 @@ protected boolean needToImport(String type) { public CodegenModel fromModel(String name, Schema schema) { CodegenModel m = super.fromModel(name, schema); m.getVendorExtensions().putIfAbsent(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), List.of()); - List implementedInterfacesClasses = (List) m.getVendorExtensions().getOrDefault(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), List.of()); - List implementedInterfacesFields = Optional.ofNullable((List) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName())) + List schemaImplementedInterfacesClasses = this.getSchemaImplements().getOrDefault(m.getSchemaName(), List.of()); + List schemaImplementedInterfacesFields = this.getSchemaImplementsFields().getOrDefault(m.getSchemaName(), List.of()); + List vendorExtensionImplementedInterfacesClasses = (List) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS.getName()); + List vendorExtensionImplementedInterfacesFields = Optional.ofNullable((List) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName())) .map(xKotlinImplementsFields -> { - if (implementedInterfacesClasses.isEmpty() && !xKotlinImplementsFields.isEmpty()) { + if (vendorExtensionImplementedInterfacesClasses.isEmpty() && !xKotlinImplementsFields.isEmpty()) { LOGGER.warn("Annotating {} with {} without {} is not supported. {} will be ignored.", name, VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName(), VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName()); } return xKotlinImplementsFields; }).orElse(List.of()); - if (serializableModel) { - if (!implementedInterfacesClasses.contains("java.io.Serializable")) { - var implementedInterfacesClassesWithSerializable = new ArrayList<>(implementedInterfacesClasses); - implementedInterfacesClassesWithSerializable.add("java.io.Serializable"); - m.getVendorExtensions().put(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), implementedInterfacesClassesWithSerializable); - } - } + List combinedImplementedInterfacesClasses = Stream.concat(vendorExtensionImplementedInterfacesClasses.stream(), schemaImplementedInterfacesClasses.stream()) + .distinct() + .sorted() + .collect(Collectors.toList()); + List combinedImplementedInterfacesFields = Stream.concat(vendorExtensionImplementedInterfacesFields.stream(), schemaImplementedInterfacesFields.stream()) + .distinct() + .collect(Collectors.toList()); + if (serializableModel && !combinedImplementedInterfacesClasses.contains("java.io.Serializable")) { + combinedImplementedInterfacesClasses.add("java.io.Serializable"); + } + m.getVendorExtensions().replace(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), combinedImplementedInterfacesClasses); + LOGGER.info("Model {} implements interfaces: {}", name, combinedImplementedInterfacesClasses); m.optionalVars = m.optionalVars.stream().distinct().collect(Collectors.toList()); // Update allVars/requiredVars/optionalVars with isInherited // Each of these lists contains elements that are similar, but they are all cloned @@ -873,7 +894,7 @@ public CodegenModel fromModel(String name, Schema schema) { Stream.of(m.requiredVars, m.optionalVars) .flatMap(List::stream) .filter(p -> allVarsMap.containsKey(p.baseName) - || implementedInterfacesFields.contains(p.baseName) + || combinedImplementedInterfacesFields.contains(p.baseName) ) .forEach(p -> p.isInherited = true); return m; diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index 12f56787d565..8310d4698143 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -1040,6 +1040,80 @@ public void generateSerializableModelWithXimplements() throws Exception { ); } + @Test + public void generateSerializableModelWithSchemaImplements() throws Exception { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, true); + codegen.additionalProperties().put(KotlinSpringServerCodegen.SCHEMA_IMPLEMENTS, Map.of( + "Pet", "com.some.pack.WithId", + "Category", List.of("com.some.pack.CategoryInterface"), + "Dog", List.of("com.some.pack.Canine") + )); + codegen.additionalProperties().put(KotlinSpringServerCodegen.SCHEMA_IMPLEMENTS_FIELDS, Map.of( + "Pet", List.of("id"), + "Category", List.of("name", "id"), + "Dog", List.of("bark", "breed") + )); + + ClientOptInput input = new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml")) + .config(codegen); + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + Path dog = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Dog.kt"); + assertFileContains( + dog, + "@get:JsonProperty(\"bark\", required = true) override val bark: kotlin.Boolean,", + "@get:JsonProperty(\"breed\", required = true) override val breed: Dog.Breed,", + "@get:JsonProperty(\"likesFetch\", required = true) override val likesFetch: kotlin.Boolean,", + "@get:JsonProperty(\"name\", required = true) override val name: kotlin.String,", + "@get:JsonProperty(\"photoUrls\", required = true) override val photoUrls: kotlin.collections.List,", + "@get:JsonProperty(\"petType\", required = true) override val petType: kotlin.String,", + "@get:JsonProperty(\"id\") override val id: kotlin.Long? = null,", + "@get:JsonProperty(\"category\") override val category: Category? = null,", + "@get:JsonProperty(\"tags\") override val tags: kotlin.collections.List? = null,", + "@get:JsonProperty(\"color\") override val color: Color? = null", + ") : Pet, com.some.pack.Canine, com.some.pack.Fetchable, java.io.Serializable {", + "private const val serialVersionUID: kotlin.Long = 1" + ); + + Path pet = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Pet.kt"); + assertFileContains( + pet, + "interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods, com.some.pack.WithId, java.io.Serializable {", + "override val name: kotlin.String", + "val photoUrls: kotlin.collections.List", + "val petType: kotlin.String", + "override val id: kotlin.Long?", + "override val category: Category?", + "val tags: kotlin.collections.List?", + "val color: Color?", + "private const val serialVersionUID: kotlin.Long = 1" + ); + + Path category = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Category.kt"); + assertFileContains( + category, + "@get:JsonProperty(\"id\") override val id: kotlin.Long? = null,", + "@get:JsonProperty(\"name\") override val name: kotlin.String? = null", + ") : com.some.pack.CategoryInterface, java.io.Serializable {", + "private const val serialVersionUID: kotlin.Long = 1" + ); + } + @Test public void generateHttpInterfaceReactiveWithReactorResponseEntity() throws Exception { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -1363,8 +1437,9 @@ public void generateNonSerializableModelWithXimplements() throws Exception { assertFileNotContains( path, "import java.io.Serializable", - ") : Pet, Serializable, com.some.pack.Fetchable {", - ") : Pet, Serializable {", + "Serializable", + ") : Pet, java.io.Serializable, com.some.pack.Fetchable {", + ") : Pet, java.io.Serializable {", "private const val serialVersionUID: kotlin.Long = 1" ); } @@ -2792,7 +2867,7 @@ public void nonReactiveWithResponseEntity() throws Exception { + " @PathVariable(\"petId\") petId: kotlin.Long" + " ): ResponseEntity"), root.resolve("src/main/kotlin/org/openapitools/api/UserApi.kt"), List.of( - "fun logoutUser(): ResponseEntity" + "fun logoutUser(): ResponseEntity" ), root.resolve("src/main/kotlin/org/openapitools/api/StoreApi.kt"), List.of( "fun getInventory(): ResponseEntity>") diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/Canine.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/Canine.kt new file mode 100644 index 000000000000..bc355ce4d218 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/Canine.kt @@ -0,0 +1,10 @@ +package com.some.pack + +import org.openapitools.model.Dog + +interface Canine { + + val breed: Dog.Breed + val bark: kotlin.Boolean + +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/CategoryInterface.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/CategoryInterface.kt new file mode 100644 index 000000000000..ecb8c7d3f3ea --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/CategoryInterface.kt @@ -0,0 +1,6 @@ +package com.some.pack + +interface CategoryInterface { + val id: kotlin.Long? + val name: kotlin.String? +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/WithId.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/WithId.kt new file mode 100644 index 000000000000..d7c6bad18be0 --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/com/some/pack/WithId.kt @@ -0,0 +1,6 @@ +package com.some.pack + +interface WithId { + + val id: Long? +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Category.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Category.kt index 88ad6599859e..67d3adb1cd75 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Category.kt @@ -21,11 +21,11 @@ import io.swagger.annotations.ApiModelProperty data class Category( @ApiModelProperty(example = "null", value = "") - @get:JsonProperty("id") val id: kotlin.Long? = null, + @get:JsonProperty("id") override val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @get:JsonProperty("name") val name: kotlin.String? = null -) : java.io.Serializable { + @get:JsonProperty("name") override val name: kotlin.String? = null +) : com.some.pack.CategoryInterface, java.io.Serializable { companion object { private const val serialVersionUID: kotlin.Long = 1 diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt index b7e3769d4f7f..53df2c21f79b 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Dog.kt @@ -28,10 +28,10 @@ import io.swagger.annotations.ApiModelProperty data class Dog( @ApiModelProperty(example = "null", required = true, value = "") - @get:JsonProperty("bark", required = true) val bark: kotlin.Boolean, + @get:JsonProperty("bark", required = true) override val bark: kotlin.Boolean, @ApiModelProperty(example = "null", required = true, value = "") - @get:JsonProperty("breed", required = true) val breed: Dog.Breed, + @get:JsonProperty("breed", required = true) override val breed: Dog.Breed, @ApiModelProperty(example = "null", required = true, value = "Whether the dog enjoys fetching") @get:JsonProperty("likesFetch", required = true) override val likesFetch: kotlin.Boolean, @@ -59,7 +59,7 @@ data class Dog( @field:Valid @ApiModelProperty(example = "null", value = "") @get:JsonProperty("color") override val color: Color? = null -) : Pet, com.some.pack.Fetchable, java.io.Serializable { +) : Pet, com.some.pack.Canine, com.some.pack.Fetchable, java.io.Serializable { /** * diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Pet.kt index 3f436436591e..9b03d46e323b 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/model/Pet.kt @@ -41,7 +41,7 @@ import io.swagger.annotations.ApiModelProperty JsonSubTypes.Type(value = Dog::class, name = "Dog") ) -interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods, java.io.Serializable { +interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods, com.some.pack.WithId, java.io.Serializable { @get:ApiModelProperty(example = "null", required = true, value = "") override val name: kotlin.String @@ -56,7 +56,7 @@ interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.W @get:ApiModelProperty(example = "null", value = "") - val id: kotlin.Long? + override val id: kotlin.Long? @get:ApiModelProperty(example = "null", value = "") From 05808ea429d842d86581bcb1bd7c08a1422d8bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Wed, 28 Jan 2026 23:56:46 +0100 Subject: [PATCH 08/21] add xImplementsSkip additional property --- ...aml => spring-boot-x-implements-skip.yaml} | 10 +- .../openapitools/codegen/DefaultCodegen.java | 17 + .../languages/AbstractJavaCodegen.java | 37 +- .../java/spring/SpringCodegenTest.java | 16 +- ...oints-models-for-testing-x-implements.yaml | 1 - .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 69 + .../.openapi-generator/VERSION | 1 + .../springboot-x-implements-skip/README.md | 27 + .../springboot-x-implements-skip/pom.xml | 91 + .../com/custompackage/InterfaceToKeep.java | 30 + .../main/java/com/custompackage/WithBar.java | 35 + .../java/com/custompackage/WithColor.java | 35 + .../com/custompackage/WithDefaultMethod.java | 34 + .../OpenApiGeneratorApplication.java | 30 + .../org/openapitools/RFC3339DateFormat.java | 38 + .../org/openapitools/api/AnotherFakeApi.java | 74 + .../api/AnotherFakeApiController.java | 46 + .../java/org/openapitools/api/ApiUtil.java | 21 + .../java/org/openapitools/api/FakeApi.java | 898 ++++++ .../openapitools/api/FakeApiController.java | 63 + .../api/FakeClassnameTestApi.java | 77 + .../api/FakeClassnameTestApiController.java | 46 + .../java/org/openapitools/api/FooApi.java | 70 + .../openapitools/api/FooApiController.java | 46 + .../java/org/openapitools/api/PetApi.java | 410 +++ .../openapitools/api/PetApiController.java | 49 + .../java/org/openapitools/api/StoreApi.java | 196 ++ .../openapitools/api/StoreApiController.java | 47 + .../java/org/openapitools/api/UserApi.java | 301 ++ .../openapitools/api/UserApiController.java | 47 + .../EnumConverterConfiguration.java | 79 + .../configuration/HomeController.java | 28 + .../configuration/SpringFoxConfiguration.java | 71 + .../model/AdditionalPropertiesClassDto.java | 131 + .../model/AllOfWithSingleRefDto.java | 113 + .../org/openapitools/model/AnimalDto.java | 134 + .../openapitools/model/ApiResponseDto.java | 135 + .../model/ArrayOfArrayOfNumberOnlyDto.java | 100 + .../model/ArrayOfNumberOnlyDto.java | 100 + .../org/openapitools/model/ArrayTestDto.java | 166 ++ .../openapitools/model/CapitalizationDto.java | 207 ++ .../java/org/openapitools/model/CatDto.java | 114 + .../org/openapitools/model/CategoryDto.java | 122 + .../model/ChildWithNullableDto.java | 118 + .../org/openapitools/model/ClassModelDto.java | 88 + .../org/openapitools/model/ClientDto.java | 87 + .../model/DeprecatedObjectDto.java | 89 + .../java/org/openapitools/model/DogDto.java | 114 + .../org/openapitools/model/EnumArraysDto.java | 194 ++ .../org/openapitools/model/EnumClassDto.java | 57 + .../org/openapitools/model/EnumTestDto.java | 429 +++ .../FakeBigDecimalMap200ResponseDto.java | 123 + .../java/org/openapitools/model/FileDto.java | 88 + .../model/FileSchemaTestClassDto.java | 124 + .../java/org/openapitools/model/FooDto.java | 87 + .../model/FooGetDefaultResponseDto.java | 88 + .../org/openapitools/model/FormatTestDto.java | 479 ++++ .../model/HasOnlyReadOnlyDto.java | 111 + .../model/HealthCheckResultDto.java | 102 + .../java/org/openapitools/model/ListDto.java | 87 + .../org/openapitools/model/MapTestDto.java | 233 ++ ...ertiesAndAdditionalPropertiesClassDto.java | 151 + .../model/Model200ResponseDto.java | 112 + .../java/org/openapitools/model/NameDto.java | 171 ++ .../openapitools/model/NullableClassDto.java | 473 ++++ .../org/openapitools/model/NumberOnlyDto.java | 88 + .../model/ObjectWithDeprecatedFieldsDto.java | 194 ++ .../java/org/openapitools/model/OrderDto.java | 248 ++ .../openapitools/model/OuterCompositeDto.java | 136 + .../model/OuterEnumDefaultValueDto.java | 57 + .../org/openapitools/model/OuterEnumDto.java | 57 + .../OuterEnumIntegerDefaultValueDto.java | 57 + .../model/OuterEnumIntegerDto.java | 57 + .../model/OuterObjectWithEnumPropertyDto.java | 100 + .../model/ParentWithNullableDto.java | 170 ++ .../java/org/openapitools/model/PetDto.java | 284 ++ .../openapitools/model/ReadOnlyFirstDto.java | 111 + .../org/openapitools/model/ReturnDto.java | 88 + .../openapitools/model/SingleRefTypeDto.java | 55 + .../model/SpecialModelNameDto.java | 87 + .../java/org/openapitools/model/TagDto.java | 111 + ...reeformAdditionalPropertiesRequestDto.java | 131 + .../java/org/openapitools/model/UserDto.java | 255 ++ .../src/main/resources/application.properties | 3 + .../src/main/resources/openapi.yaml | 2443 +++++++++++++++++ .../src/main/resources/static/swagger-ui.html | 60 + .../OpenApiGeneratorApplicationTests.java | 13 + 88 files changed, 12751 insertions(+), 44 deletions(-) rename bin/configs/{spring-boot-skip-x-implements.yaml => spring-boot-x-implements-skip.yaml} (55%) create mode 100644 samples/server/petstore/springboot-x-implements-skip/.openapi-generator-ignore create mode 100644 samples/server/petstore/springboot-x-implements-skip/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-x-implements-skip/.openapi-generator/VERSION create mode 100644 samples/server/petstore/springboot-x-implements-skip/README.md create mode 100644 samples/server/petstore/springboot-x-implements-skip/pom.xml create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/InterfaceToKeep.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithBar.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithColor.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithDefaultMethod.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/RFC3339DateFormat.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApiController.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/ApiUtil.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApiController.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApiController.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApiController.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApiController.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApiController.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/HomeController.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ApiResponseDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayTestDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CapitalizationDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CatDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ChildWithNullableDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClassModelDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClientDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DeprecatedObjectDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DogDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumArraysDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumClassDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FakeBigDecimalMap200ResponseDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooGetDefaultResponseDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ListDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MapTestDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/Model200ResponseDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NumberOnlyDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OrderDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterCompositeDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDefaultValueDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDefaultValueDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReturnDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SingleRefTypeDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SpecialModelNameDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TagDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequestDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/UserDto.java create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/resources/application.properties create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/main/resources/static/swagger-ui.html create mode 100644 samples/server/petstore/springboot-x-implements-skip/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/bin/configs/spring-boot-skip-x-implements.yaml b/bin/configs/spring-boot-x-implements-skip.yaml similarity index 55% rename from bin/configs/spring-boot-skip-x-implements.yaml rename to bin/configs/spring-boot-x-implements-skip.yaml index ff407887b0dc..517a74bd9959 100644 --- a/bin/configs/spring-boot-skip-x-implements.yaml +++ b/bin/configs/spring-boot-x-implements-skip.yaml @@ -1,5 +1,5 @@ generatorName: spring -outputDir: samples/server/petstore/springboot-skip-x-implements +outputDir: samples/server/petstore/springboot-x-implements-skip inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: @@ -9,9 +9,7 @@ additionalProperties: hideGenerationTimestamp: "true" camelCaseDollarSign: "true" modelNameSuffix: 'Dto' - xImplementsOverrides: - com.custompackage.InterfaceToSubstitute: com.custompackage.SubstitutedInterface - com.custompackage.InterfaceToSkip: skip + xImplementsSkip: [ com.custompackage.InterfaceToSkip ] schemaImplements: - Foo: [ com.custompackage.FooInterface, com.custompackage.FooIntergace ] - Animal: [ com.custompackage.AnimalInterfaceImplleeements ] + Foo: [ com.custompackage.WithBar, com.custompackage.WithDefaultMethod ] + Animal: com.custompackage.WithColor diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 461ae2033030..dec9e566da15 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -7140,6 +7140,23 @@ public void setIgnoreFilePathOverride(final String ignoreFileOverride) { this.ignoreFilePathOverride = ignoreFileOverride; } + public List getPropertyAsStringList(String propertyKey) { + final Object value = additionalProperties.get(propertyKey); + if (value instanceof List) { + List list = (List) value; + List stringList = new ArrayList<>(); + for (Object item : list) { + if (item != null) { + stringList.add(item.toString()); + } + } + return stringList; + } else if (value instanceof String) { + return Collections.singletonList((String) value); + } + return Collections.emptyList(); + } + public Map getPropertyAsStringMap(String propertyKey) { final Object value = additionalProperties.get(propertyKey); if (value instanceof Map) { diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 10956f0fa2fa..8a5c35f297f3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -92,8 +92,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String BOOLEAN_GETTER_PREFIX = "booleanGetterPrefix"; public static final String IGNORE_ANYOF_IN_ENUM = "ignoreAnyOfInEnum"; public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations"; - public static final String X_IMPLEMENTS_OVERRIDES = "xImplementsOverrides"; - private static final String X_IMPLEMENTS_OVERRIDES_SKIP = "skip"; + public static final String X_IMPLEMENTS_SKIP = "xImplementsSkip"; public static final String SCHEMA_IMPLEMENTS = "schemaImplements"; public static final String ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS = "additionalOneOfTypeAnnotations"; public static final String ADDITIONAL_ENUM_TYPE_ANNOTATIONS = "additionalEnumTypeAnnotations"; @@ -185,7 +184,7 @@ protected enum ENUM_PROPERTY_NAMING_TYPE {MACRO_CASE, legacy, original} protected List additionalModelTypeAnnotations = new LinkedList<>(); @Getter @Setter - protected Map xImplementsOverrides = new HashMap<>(); + protected List xImplementsSkip = new ArrayList<>(); @Getter @Setter protected Map> schemaImplements = new HashMap<>(); @@ -349,7 +348,7 @@ public AbstractJavaCodegen() { cliOptions.add(CliOption.newBoolean(IGNORE_ANYOF_IN_ENUM, "Ignore anyOf keyword in enum", ignoreAnyOfInEnum)); cliOptions.add(CliOption.newString(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, "Additional annotations for enum type(class level annotations)")); cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); - cliOptions.add(CliOption.newString(X_IMPLEMENTS_OVERRIDES, "Ability to exclude or replace interfaces that are specified using x-implements vendor extension. TODO:::")); + cliOptions.add(CliOption.newString(X_IMPLEMENTS_SKIP, "Ability to exclude interfaces that were specified in open api spec using x-implements vendor extension.")); cliOptions.add(CliOption.newString(ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS, "Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.", this.openApiNullable)); cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); @@ -460,8 +459,8 @@ public void processOpts() { convertPropertyToTypeAndWriteBack(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, annotations -> Arrays.asList(annotations.split(";")), this::setAdditionalEnumTypeAnnotations); - if (additionalProperties.containsKey(X_IMPLEMENTS_OVERRIDES)) { - this.setXImplementsOverrides(getPropertyAsStringMap(X_IMPLEMENTS_OVERRIDES)); + if (additionalProperties.containsKey(X_IMPLEMENTS_SKIP)) { + this.setXImplementsSkip(getPropertyAsStringList(X_IMPLEMENTS_SKIP)); } if (additionalProperties.containsKey(SCHEMA_IMPLEMENTS)) { this.setSchemaImplements(getPropertyAsStringListMap(SCHEMA_IMPLEMENTS)); @@ -2015,39 +2014,23 @@ public ModelsMap postProcessModels(ModelsMap objs) { } } - // skip or substitute interfaces predefined in x-implements via xImplementsOverrides - if (!this.xImplementsOverrides.isEmpty()) { - List interfacesToSkip = this.xImplementsOverrides.entrySet().stream() - .filter(entry -> entry.getValue().equals(X_IMPLEMENTS_OVERRIDES_SKIP)) - .map(Map.Entry::getKey) - .collect(Collectors.toList()); - Map interfacesSubstituteFromTo = this.xImplementsOverrides.entrySet().stream() - .filter(entry -> !entry.getValue().equals(X_IMPLEMENTS_OVERRIDES_SKIP)) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + // skip interfaces predefined in open api spec in x-implements via additional property xImplementsSkip + if (!this.xImplementsSkip.isEmpty()) { for (ModelMap mo : objs.getModels()) { CodegenModel cm = mo.getModel(); if (cm.getVendorExtensions().containsKey(X_IMPLEMENTS)) { List xImplementsInModelOriginal = (List) cm.getVendorExtensions().get(X_IMPLEMENTS); List xImplementsInModelSkipped = xImplementsInModelOriginal .stream() - .filter(interfacesToSkip::contains) + .filter(o -> this.xImplementsSkip.contains(o)) .collect(Collectors.toList()); - Map xImplementsInModelSubstituteFromTo = interfacesSubstituteFromTo.entrySet().stream() - .filter(entry -> xImplementsInModelOriginal.contains(entry.getKey())) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); if (!xImplementsInModelSkipped.isEmpty()) { - LOGGER.info("Following interfaces configured via additional property '{}' will be skipped for model {}: {}", cm.classname, X_IMPLEMENTS_OVERRIDES, xImplementsInModelSkipped); - } - if (!xImplementsInModelSubstituteFromTo.isEmpty()) { - LOGGER.info("Following interfaces configured via additional property '{}' will be replaced for model {}: {}", cm.classname, X_IMPLEMENTS_OVERRIDES, xImplementsInModelSubstituteFromTo.entrySet().stream() - .map(entry -> " from [" + entry.getKey() + "] to [" + entry.getValue() + "]") - .collect(Collectors.joining(","))); + LOGGER.info("Following interfaces configured via additional property '{}' will be skipped for model {}: {}", X_IMPLEMENTS_SKIP, cm.classname, xImplementsInModelSkipped); } List xImplementsInModelProcessed = xImplementsInModelOriginal.stream() .filter(Predicate.not(xImplementsInModelSkipped::contains)) - .map(item -> xImplementsInModelSubstituteFromTo.getOrDefault(item, item)) .collect(Collectors.toList()); - // implement only the non-filtered-out interfaces and replaced interfaces + // implement only the non-skipped interfaces cm.getVendorExtensions().replace(X_IMPLEMENTS, xImplementsInModelProcessed); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 79a1f4409806..ea9ce1bac41c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -826,24 +826,20 @@ public void testXImplements() throws IOException { final Map files = generateFiles(codegen, "src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml"); JavaFileAssert.assertThat(files.get("Animal.java")) - .implementsInterfaces("com.custompackage.InterfaceToKeep", "com.custompackage.InterfaceToSkip", "com.custompackage.InterfaceToSubstitute") - .doesNotImplementInterfaces("com.custompackage.SubstitutedInterface"); + .implementsInterfaces("com.custompackage.InterfaceToKeep", "com.custompackage.InterfaceToSkip"); } @Test - public void testXImplementsOverrides() throws IOException { + public void testXImplementsSkip() throws IOException { final SpringCodegen codegen = new SpringCodegen(); - String interfaceToSubstitute = "com.custompackage.InterfaceToSubstitute"; - String substitutedInterface = "com.custompackage.SubstitutedInterface"; String interfaceToSkip = "com.custompackage.InterfaceToSkip"; - String skipKeyword = "skip"; - codegen.additionalProperties().put(X_IMPLEMENTS_OVERRIDES, Map.of(interfaceToSubstitute, substitutedInterface, interfaceToSkip, skipKeyword)); + codegen.additionalProperties().put(X_IMPLEMENTS_SKIP, List.of(interfaceToSkip)); final Map files = generateFiles(codegen, "src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml"); JavaFileAssert.assertThat(files.get("Animal.java")) - .implementsInterfaces("com.custompackage.InterfaceToKeep", substitutedInterface) - .doesNotImplementInterfaces(interfaceToSubstitute, interfaceToSkip); + .implementsInterfaces("com.custompackage.InterfaceToKeep") + .doesNotImplementInterfaces(interfaceToSkip); } @Test @@ -859,7 +855,7 @@ public void testSchemaImplements() throws IOException { final Map files = generateFiles(codegen, "src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml"); JavaFileAssert.assertThat(files.get("Animal.java")) - .implementsInterfaces(anotherInterface, "com.custompackage.InterfaceToSubstitute", "com.custompackage.InterfaceToKeep", "com.custompackage.InterfaceToSkip") + .implementsInterfaces(anotherInterface, "com.custompackage.InterfaceToKeep", "com.custompackage.InterfaceToSkip") .doesNotImplementInterfaces("com.custompackage.SubstitutedInterface"); JavaFileAssert.assertThat(files.get("Foo.java")) diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml index 1772f4975380..257225df5d1a 100644 --- a/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing-x-implements.yaml @@ -1576,7 +1576,6 @@ components: Animal: type: object x-implements: - - com.custompackage.InterfaceToSubstitute - com.custompackage.InterfaceToSkip - com.custompackage.InterfaceToKeep discriminator: diff --git a/samples/server/petstore/springboot-x-implements-skip/.openapi-generator-ignore b/samples/server/petstore/springboot-x-implements-skip/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/FILES b/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/FILES new file mode 100644 index 000000000000..9f716ae63a6a --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/FILES @@ -0,0 +1,69 @@ +README.md +pom.xml +src/main/java/org/openapitools/OpenApiGeneratorApplication.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/AnotherFakeApi.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/FakeApi.java +src/main/java/org/openapitools/api/FakeClassnameTestApi.java +src/main/java/org/openapitools/api/FooApi.java +src/main/java/org/openapitools/api/PetApi.java +src/main/java/org/openapitools/api/StoreApi.java +src/main/java/org/openapitools/api/UserApi.java +src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java +src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java +src/main/java/org/openapitools/model/AnimalDto.java +src/main/java/org/openapitools/model/ApiResponseDto.java +src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +src/main/java/org/openapitools/model/ArrayTestDto.java +src/main/java/org/openapitools/model/CapitalizationDto.java +src/main/java/org/openapitools/model/CatDto.java +src/main/java/org/openapitools/model/CategoryDto.java +src/main/java/org/openapitools/model/ChildWithNullableDto.java +src/main/java/org/openapitools/model/ClassModelDto.java +src/main/java/org/openapitools/model/ClientDto.java +src/main/java/org/openapitools/model/DeprecatedObjectDto.java +src/main/java/org/openapitools/model/DogDto.java +src/main/java/org/openapitools/model/EnumArraysDto.java +src/main/java/org/openapitools/model/EnumClassDto.java +src/main/java/org/openapitools/model/EnumTestDto.java +src/main/java/org/openapitools/model/FakeBigDecimalMap200ResponseDto.java +src/main/java/org/openapitools/model/FileDto.java +src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +src/main/java/org/openapitools/model/FooDto.java +src/main/java/org/openapitools/model/FooGetDefaultResponseDto.java +src/main/java/org/openapitools/model/FormatTestDto.java +src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java +src/main/java/org/openapitools/model/HealthCheckResultDto.java +src/main/java/org/openapitools/model/ListDto.java +src/main/java/org/openapitools/model/MapTestDto.java +src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +src/main/java/org/openapitools/model/Model200ResponseDto.java +src/main/java/org/openapitools/model/NameDto.java +src/main/java/org/openapitools/model/NullableClassDto.java +src/main/java/org/openapitools/model/NumberOnlyDto.java +src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java +src/main/java/org/openapitools/model/OrderDto.java +src/main/java/org/openapitools/model/OuterCompositeDto.java +src/main/java/org/openapitools/model/OuterEnumDefaultValueDto.java +src/main/java/org/openapitools/model/OuterEnumDto.java +src/main/java/org/openapitools/model/OuterEnumIntegerDefaultValueDto.java +src/main/java/org/openapitools/model/OuterEnumIntegerDto.java +src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java +src/main/java/org/openapitools/model/ParentWithNullableDto.java +src/main/java/org/openapitools/model/PetDto.java +src/main/java/org/openapitools/model/ReadOnlyFirstDto.java +src/main/java/org/openapitools/model/ReturnDto.java +src/main/java/org/openapitools/model/SingleRefTypeDto.java +src/main/java/org/openapitools/model/SpecialModelNameDto.java +src/main/java/org/openapitools/model/TagDto.java +src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequestDto.java +src/main/java/org/openapitools/model/UserDto.java +src/main/resources/application.properties +src/main/resources/openapi.yaml +src/main/resources/static/swagger-ui.html +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/VERSION b/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/VERSION new file mode 100644 index 000000000000..193a12d6e891 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.20.0-SNAPSHOT diff --git a/samples/server/petstore/springboot-x-implements-skip/README.md b/samples/server/petstore/springboot-x-implements-skip/README.md new file mode 100644 index 000000000000..6721bbc28ca4 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/README.md @@ -0,0 +1,27 @@ +# OpenAPI generated server + +Spring Boot Server + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. +This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + +The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox). +Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the +generated Controller and Model classes. The specification is available to download using the following url: +http://localhost:80/v2/api-docs/ + +**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer +maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is +supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is, +as an added bonus, OpenAPI v3 compatible. + + + +Start your server as a simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:80/swagger-ui.html + +Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-x-implements-skip/pom.xml b/samples/server/petstore/springboot-x-implements-skip/pom.xml new file mode 100644 index 000000000000..8b028d261c8a --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/pom.xml @@ -0,0 +1,91 @@ + + 4.0.0 + org.openapitools + springboot + jar + springboot + 1.0.0-SNAPSHOT + + 1.8 + ${java.version} + ${java.version} + UTF-8 + 2.9.2 + 5.3.1 + + + org.springframework.boot + spring-boot-starter-parent + 2.5.14 + + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.data + spring-data-commons + + + + io.springfox + springfox-swagger2 + ${springfox.version} + + + org.webjars + swagger-ui + ${swagger-ui.version} + + + org.webjars + webjars-locator-core + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.8 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/InterfaceToKeep.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/InterfaceToKeep.java new file mode 100644 index 000000000000..0de312edd533 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/InterfaceToKeep.java @@ -0,0 +1,30 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import org.springframework.lang.Nullable; + +import org.openapitools.jackson.nullable.JsonNullable; + +import java.time.OffsetDateTime; + +import javax.validation.Valid; +import javax.validation.constraints.*; + +import java.util.*; + +import javax.annotation.Generated; + +interface InterfaceToKeep { +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithBar.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithBar.java new file mode 100644 index 000000000000..3068cf2c900e --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithBar.java @@ -0,0 +1,35 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import org.springframework.lang.Nullable; + +import org.openapitools.jackson.nullable.JsonNullable; + +import java.time.OffsetDateTime; + +import javax.validation.Valid; +import javax.validation.constraints.*; + +import java.util.*; + +import javax.annotation.Generated; + +interface WithBar { + + public String getBar(); + + public void setBar(String bar); + +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithColor.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithColor.java new file mode 100644 index 000000000000..4c940fad8653 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithColor.java @@ -0,0 +1,35 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import org.springframework.lang.Nullable; + +import org.openapitools.jackson.nullable.JsonNullable; + +import java.time.OffsetDateTime; + +import javax.validation.Valid; +import javax.validation.constraints.*; + +import java.util.*; + +import javax.annotation.Generated; + +interface WithColor { + + public String getColor(); + + public void setColor(String color); + +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithDefaultMethod.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithDefaultMethod.java new file mode 100644 index 000000000000..7666587e7c9c --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithDefaultMethod.java @@ -0,0 +1,34 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import org.springframework.lang.Nullable; + +import org.openapitools.jackson.nullable.JsonNullable; + +import java.time.OffsetDateTime; + +import javax.validation.Valid; +import javax.validation.constraints.*; + +import java.util.*; + +import javax.annotation.Generated; + +interface WithDefaultMethod { + + default String greet(String name) { + return "Hello, " + name + "!"; + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..97252a8a9402 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,30 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.FilterType; +import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; + +@SpringBootApplication( + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +@ComponentScan( + basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}, + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean(name = "org.openapitools.OpenApiGeneratorApplication.jsonNullableModule") + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/RFC3339DateFormat.java new file mode 100644 index 000000000000..bcd3936d8b34 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/RFC3339DateFormat.java @@ -0,0 +1,38 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java new file mode 100644 index 000000000000..90e427bd71cc --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -0,0 +1,74 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ClientDto; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Api(value = "$another-fake?", description = "the $another-fake? API") +public interface AnotherFakeApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_CALL123TEST_SPECIAL_TAGS = "/another-fake/dummy"; + /** + * PATCH /another-fake/dummy : To test special tags + * To test special tags and operation ID starting with number + * + * @param clientDto client model (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "$another-fake?" }, + value = "To test special tags", + nickname = "call123testSpecialTags", + notes = "To test special tags and operation ID starting with number", + response = ClientDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) + }) + @RequestMapping( + method = RequestMethod.PATCH, + value = AnotherFakeApi.PATH_CALL123TEST_SPECIAL_TAGS, + produces = { "application/json" }, + consumes = { "application/json" } + ) + default ResponseEntity call123testSpecialTags( + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApiController.java new file mode 100644 index 000000000000..da05b5e3d440 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import org.openapitools.model.ClientDto; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class AnotherFakeApiController implements AnotherFakeApi { + + private final NativeWebRequest request; + + @Autowired + public AnotherFakeApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/ApiUtil.java new file mode 100644 index 000000000000..c03486e4081d --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/ApiUtil.java @@ -0,0 +1,21 @@ +package org.openapitools.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + if (res != null) { + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java new file mode 100644 index 000000000000..f7d277c5047b --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java @@ -0,0 +1,898 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ApiResponseDto; +import java.math.BigDecimal; +import org.openapitools.model.ChildWithNullableDto; +import org.openapitools.model.ClientDto; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.EnumClassDto; +import org.openapitools.model.FakeBigDecimalMap200ResponseDto; +import org.openapitools.model.FileSchemaTestClassDto; +import org.openapitools.model.HealthCheckResultDto; +import java.time.LocalDate; +import java.util.Map; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.OuterObjectWithEnumPropertyDto; +import org.openapitools.model.PetDto; +import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequestDto; +import org.openapitools.model.UserDto; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Api(value = "fake", description = "the fake API") +public interface FakeApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_FAKE_BIG_DECIMAL_MAP = "/fake/BigDecimalMap"; + /** + * GET /fake/BigDecimalMap + * for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + * + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakeBigDecimalMap", + notes = "for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys", + response = FakeBigDecimalMap200ResponseDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = FakeBigDecimalMap200ResponseDto.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = FakeApi.PATH_FAKE_BIG_DECIMAL_MAP, + produces = { "*/*" } + ) + default ResponseEntity fakeBigDecimalMap( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"someId\" : 0.8008281904610115, \"someMap\" : { \"key\" : 6.027456183070403 } }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_FAKE_HEALTH_GET = "/fake/health"; + /** + * GET /fake/health : Health check endpoint + * + * @return The instance started successfully (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "Health check endpoint", + nickname = "fakeHealthGet", + notes = "", + response = HealthCheckResultDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "The instance started successfully", response = HealthCheckResultDto.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = FakeApi.PATH_FAKE_HEALTH_GET, + produces = { "application/json" } + ) + default ResponseEntity fakeHealthGet( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"NullableMessage\" : \"NullableMessage\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_FAKE_HTTP_SIGNATURE_TEST = "/fake/http-signature-test"; + /** + * GET /fake/http-signature-test : test http signature authentication + * + * @param petDto Pet object that needs to be added to the store (required) + * @param query1 query parameter (optional) + * @param header1 header parameter (optional) + * @return The instance started successfully (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test http signature authentication", + nickname = "fakeHttpSignatureTest", + notes = "", + authorizations = { + @Authorization(value = "http_signature_test") + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "The instance started successfully") + }) + @RequestMapping( + method = RequestMethod.GET, + value = FakeApi.PATH_FAKE_HTTP_SIGNATURE_TEST, + consumes = { "application/json", "application/xml" } + ) + default ResponseEntity fakeHttpSignatureTest( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto, + @ApiParam(value = "query parameter") @Valid @RequestParam(value = "query_1", required = false) @Nullable String query1, + @ApiParam(value = "header parameter") @RequestHeader(value = "header_1", required = false) @Nullable String header1 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_FAKE_OUTER_BOOLEAN_SERIALIZE = "/fake/outer/boolean"; + /** + * POST /fake/outer/boolean + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Output boolean (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakeOuterBooleanSerialize", + notes = "Test serialization of outer boolean types", + response = Boolean.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, + produces = { "*/*" }, + consumes = { "application/json" } + ) + default ResponseEntity fakeOuterBooleanSerialize( + @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_FAKE_OUTER_COMPOSITE_SERIALIZE = "/fake/outer/composite"; + /** + * POST /fake/outer/composite + * Test serialization of object with outer number type + * + * @param outerCompositeDto Input composite as post body (optional) + * @return Output composite (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakeOuterCompositeSerialize", + notes = "Test serialization of object with outer number type", + response = OuterCompositeDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Output composite", response = OuterCompositeDto.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, + produces = { "*/*" }, + consumes = { "application/json" } + ) + default ResponseEntity fakeOuterCompositeSerialize( + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_FAKE_OUTER_NUMBER_SERIALIZE = "/fake/outer/number"; + /** + * POST /fake/outer/number + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return Output number (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakeOuterNumberSerialize", + notes = "Test serialization of outer number types", + response = BigDecimal.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, + produces = { "*/*" }, + consumes = { "application/json" } + ) + default ResponseEntity fakeOuterNumberSerialize( + @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_FAKE_OUTER_STRING_SERIALIZE = "/fake/outer/string"; + /** + * POST /fake/outer/string + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return Output string (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakeOuterStringSerialize", + notes = "Test serialization of outer string types", + response = String.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Output string", response = String.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, + produces = { "*/*" }, + consumes = { "application/json" } + ) + default ResponseEntity fakeOuterStringSerialize( + @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_FAKE_PROPERTY_ENUM_INTEGER_SERIALIZE = "/fake/property/enum-int"; + /** + * POST /fake/property/enum-int + * Test serialization of enum (int) properties with examples + * + * @param outerObjectWithEnumPropertyDto Input enum (int) as post body (required) + * @return Output enum (int) (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "fakePropertyEnumIntegerSerialize", + notes = "Test serialization of enum (int) properties with examples", + response = OuterObjectWithEnumPropertyDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Output enum (int)", response = OuterObjectWithEnumPropertyDto.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_FAKE_PROPERTY_ENUM_INTEGER_SERIALIZE, + produces = { "*/*" }, + consumes = { "application/json" } + ) + default ResponseEntity fakePropertyEnumIntegerSerialize( + @ApiParam(value = "Input enum (int) as post body", required = true) @Valid @RequestBody OuterObjectWithEnumPropertyDto outerObjectWithEnumPropertyDto + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { + String exampleString = "{ \"value\" : 2 }"; + ApiUtil.setExampleResponse(request, "*/*", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_ADDITIONAL_PROPERTIES_REFERENCE = "/fake/additionalProperties-reference"; + /** + * POST /fake/additionalProperties-reference : test referenced additionalProperties + * + * + * @param requestBody request body (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test referenced additionalProperties", + nickname = "testAdditionalPropertiesReference", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_TEST_ADDITIONAL_PROPERTIES_REFERENCE, + consumes = { "application/json" } + ) + default ResponseEntity testAdditionalPropertiesReference( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_BODY_WITH_BINARY = "/fake/body-with-binary"; + /** + * PUT /fake/body-with-binary + * For this test, the body has to be a binary file. + * + * @param body image to upload (required) + * @return Success (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "testBodyWithBinary", + notes = "For this test, the body has to be a binary file." + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Success") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = FakeApi.PATH_TEST_BODY_WITH_BINARY, + consumes = { "image/png" } + ) + default ResponseEntity testBodyWithBinary( + @ApiParam(value = "image to upload", required = true) @Valid @RequestBody org.springframework.core.io.Resource body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_BODY_WITH_FILE_SCHEMA = "/fake/body-with-file-schema"; + /** + * PUT /fake/body-with-file-schema + * For this test, the body for this request must reference a schema named `File`. + * + * @param fileSchemaTestClassDto (required) + * @return Success (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "testBodyWithFileSchema", + notes = "For this test, the body for this request must reference a schema named `File`." + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Success") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = FakeApi.PATH_TEST_BODY_WITH_FILE_SCHEMA, + consumes = { "application/json" } + ) + default ResponseEntity testBodyWithFileSchema( + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_BODY_WITH_QUERY_PARAMS = "/fake/body-with-query-params"; + /** + * PUT /fake/body-with-query-params + * + * @param query (required) + * @param userDto (required) + * @return Success (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "testBodyWithQueryParams", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Success") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = FakeApi.PATH_TEST_BODY_WITH_QUERY_PARAMS, + consumes = { "application/json" } + ) + default ResponseEntity testBodyWithQueryParams( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, + @ApiParam(value = "", required = true) @Valid @RequestBody UserDto userDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_CLIENT_MODEL = "/fake"; + /** + * PATCH /fake : To test \"client\" model + * To test \"client\" model + * + * @param clientDto client model (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "To test \"client\" model", + nickname = "testClientModel", + notes = "To test \"client\" model", + response = ClientDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) + }) + @RequestMapping( + method = RequestMethod.PATCH, + value = FakeApi.PATH_TEST_CLIENT_MODEL, + produces = { "application/json" }, + consumes = { "application/json" } + ) + default ResponseEntity testClientModel( + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_ENDPOINT_PARAMETERS = "/fake"; + /** + * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional) + * @param password None (optional) + * @param paramCallback None (optional) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "fake" }, + value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", + nickname = "testEndpointParameters", + notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", + authorizations = { + @Authorization(value = "http_basic_test") + } + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_TEST_ENDPOINT_PARAMETERS, + consumes = { "application/x-www-form-urlencoded" } + ) + default ResponseEntity testEndpointParameters( + @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @DecimalMax(value = "987.6") @Valid @RequestParam(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestParam(value = "string", required = false) String string, + @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, + @ApiParam(value = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Size(min = 10, max = 64) @Valid @RequestParam(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_ENUM_PARAMETERS = "/fake"; + /** + * GET /fake : To test enum parameters + * To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional) + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional) + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumQueryModelArray (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return Invalid request (status code 400) + * or Not found (status code 404) + */ + @ApiOperation( + tags = { "fake" }, + value = "To test enum parameters", + nickname = "testEnumParameters", + notes = "To test enum parameters" + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid request"), + @ApiResponse(code = 404, message = "Not found") + }) + @RequestMapping( + method = RequestMethod.GET, + value = FakeApi.PATH_TEST_ENUM_PARAMETERS, + consumes = { "application/x-www-form-urlencoded" } + ) + default ResponseEntity testEnumParameters( + @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) @Nullable List enumHeaderStringArray, + @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, + @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) @Nullable List enumQueryStringArray, + @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, + @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, + @ApiParam(value = "") @Valid @RequestParam(value = "enum_query_model_array", required = false) @Nullable List enumQueryModelArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_GROUP_PARAMETERS = "/fake"; + /** + * DELETE /fake : Fake endpoint to test group parameters (optional) + * Fake endpoint to test group parameters (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return Something wrong (status code 400) + */ + @ApiOperation( + tags = { "fake" }, + value = "Fake endpoint to test group parameters (optional)", + nickname = "testGroupParameters", + notes = "Fake endpoint to test group parameters (optional)", + authorizations = { + @Authorization(value = "bearer_test") + } + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Something wrong") + }) + @RequestMapping( + method = RequestMethod.DELETE, + value = FakeApi.PATH_TEST_GROUP_PARAMETERS + ) + default ResponseEntity testGroupParameters( + @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, + @NotNull @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, + @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, + @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) @Nullable Integer stringGroup, + @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) @Nullable Boolean booleanGroup, + @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) @Nullable Long int64Group + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_INLINE_ADDITIONAL_PROPERTIES = "/fake/inline-additionalProperties"; + /** + * POST /fake/inline-additionalProperties : test inline additionalProperties + * + * + * @param requestBody request body (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test inline additionalProperties", + nickname = "testInlineAdditionalProperties", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_TEST_INLINE_ADDITIONAL_PROPERTIES, + consumes = { "application/json" } + ) + default ResponseEntity testInlineAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_INLINE_FREEFORM_ADDITIONAL_PROPERTIES = "/fake/inline-freeform-additionalProperties"; + /** + * POST /fake/inline-freeform-additionalProperties : test inline free-form additionalProperties + * + * + * @param testInlineFreeformAdditionalPropertiesRequestDto request body (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test inline free-form additionalProperties", + nickname = "testInlineFreeformAdditionalProperties", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_TEST_INLINE_FREEFORM_ADDITIONAL_PROPERTIES, + consumes = { "application/json" } + ) + default ResponseEntity testInlineFreeformAdditionalProperties( + @ApiParam(value = "request body", required = true) @Valid @RequestBody TestInlineFreeformAdditionalPropertiesRequestDto testInlineFreeformAdditionalPropertiesRequestDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_JSON_FORM_DATA = "/fake/jsonFormData"; + /** + * GET /fake/jsonFormData : test json serialization of form data + * + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test json serialization of form data", + nickname = "testJsonFormData", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.GET, + value = FakeApi.PATH_TEST_JSON_FORM_DATA, + consumes = { "application/x-www-form-urlencoded" } + ) + default ResponseEntity testJsonFormData( + @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_NULLABLE = "/fake/nullable"; + /** + * POST /fake/nullable : test nullable parent property + * + * + * @param childWithNullableDto request body (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test nullable parent property", + nickname = "testNullable", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_TEST_NULLABLE, + consumes = { "application/json" } + ) + default ResponseEntity testNullable( + @ApiParam(value = "request body", required = true) @Valid @RequestBody ChildWithNullableDto childWithNullableDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT = "/fake/test-query-parameters"; + /** + * PUT /fake/test-query-parameters + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @param allowEmpty (required) + * @param language (optional) + * @return Success (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "", + nickname = "testQueryParameterCollectionFormat", + notes = "To test the collection format in query parameters" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Success") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = FakeApi.PATH_TEST_QUERY_PARAMETER_COLLECTION_FORMAT + ) + default ResponseEntity testQueryParameterCollectionFormat( + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, + @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "allowEmpty", required = true) String allowEmpty, + @ApiParam(value = "") @Valid @RequestParam(value = "", required = false) @Nullable Map language + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_TEST_STRING_MAP_REFERENCE = "/fake/stringMap-reference"; + /** + * POST /fake/stringMap-reference : test referenced string map + * + * + * @param requestBody request body (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake" }, + value = "test referenced string map", + nickname = "testStringMapReference", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_TEST_STRING_MAP_REFERENCE, + consumes = { "application/json" } + ) + default ResponseEntity testStringMapReference( + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_UPLOAD_FILE_WITH_REQUIRED_FILE = "/fake/{petId}/uploadImageWithRequiredFile"; + /** + * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "uploads an image (required)", + nickname = "uploadFileWithRequiredFile", + notes = "", + response = ApiResponseDto.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = FakeApi.PATH_UPLOAD_FILE_WITH_REQUIRED_FILE, + produces = { "application/json" }, + consumes = { "multipart/form-data" } + ) + default ResponseEntity uploadFileWithRequiredFile( + @NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApiController.java new file mode 100644 index 000000000000..6b578ef556e3 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApiController.java @@ -0,0 +1,63 @@ +package org.openapitools.api; + +import org.openapitools.model.ApiResponseDto; +import java.math.BigDecimal; +import org.openapitools.model.ChildWithNullableDto; +import org.openapitools.model.ClientDto; +import org.springframework.format.annotation.DateTimeFormat; +import org.openapitools.model.EnumClassDto; +import org.openapitools.model.FakeBigDecimalMap200ResponseDto; +import org.openapitools.model.FileSchemaTestClassDto; +import org.openapitools.model.HealthCheckResultDto; +import java.time.LocalDate; +import java.util.Map; +import org.springframework.lang.Nullable; +import java.time.OffsetDateTime; +import org.openapitools.model.OuterCompositeDto; +import org.openapitools.model.OuterObjectWithEnumPropertyDto; +import org.openapitools.model.PetDto; +import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequestDto; +import org.openapitools.model.UserDto; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class FakeApiController implements FakeApi { + + private final NativeWebRequest request; + + @Autowired + public FakeApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java new file mode 100644 index 000000000000..37144cf4ee4b --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -0,0 +1,77 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ClientDto; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Api(value = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") +public interface FakeClassnameTestApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_TEST_CLASSNAME = "/fake_classname_test"; + /** + * PATCH /fake_classname_test : To test class name in snake case + * To test class name in snake case + * + * @param clientDto client model (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "fake_classname_tags 123#$%^" }, + value = "To test class name in snake case", + nickname = "testClassname", + notes = "To test class name in snake case", + response = ClientDto.class, + authorizations = { + @Authorization(value = "api_key_query") + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ClientDto.class) + }) + @RequestMapping( + method = RequestMethod.PATCH, + value = FakeClassnameTestApi.PATH_TEST_CLASSNAME, + produces = { "application/json" }, + consumes = { "application/json" } + ) + default ResponseEntity testClassname( + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"client\" : \"client\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java new file mode 100644 index 000000000000..68835b4b9f8f --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import org.openapitools.model.ClientDto; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class FakeClassnameTestApiController implements FakeClassnameTestApi { + + private final NativeWebRequest request; + + @Autowired + public FakeClassnameTestApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java new file mode 100644 index 000000000000..c503164ed050 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java @@ -0,0 +1,70 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.FooGetDefaultResponseDto; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Api(value = "foo", description = "the foo API") +public interface FooApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_FOO_GET = "/foo"; + /** + * GET /foo + * + * @return response (status code 200) + */ + @ApiOperation( + value = "", + nickname = "fooGet", + notes = "", + response = FooGetDefaultResponseDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "response", response = FooGetDefaultResponseDto.class) + }) + @RequestMapping( + method = RequestMethod.GET, + value = FooApi.PATH_FOO_GET, + produces = { "application/json" } + ) + default ResponseEntity fooGet( + + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"string\" : { \"bar\" : \"bar\" } }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApiController.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApiController.java new file mode 100644 index 000000000000..038f6ee5cc6c --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import org.openapitools.model.FooGetDefaultResponseDto; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class FooApiController implements FooApi { + + private final NativeWebRequest request; + + @Autowired + public FooApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java new file mode 100644 index 000000000000..220ab0412405 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java @@ -0,0 +1,410 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.ApiResponseDto; +import org.springframework.lang.Nullable; +import org.openapitools.model.PetDto; +import java.util.Set; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Api(value = "pet", description = "Everything about your Pets") +public interface PetApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_ADD_PET = "/pet"; + /** + * POST /pet : Add a new pet to the store + * + * + * @param petDto Pet object that needs to be added to the store (required) + * @return Successful operation (status code 200) + * or Invalid input (status code 405) + */ + @ApiOperation( + tags = { "pet" }, + value = "Add a new pet to the store", + nickname = "addPet", + notes = "", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Successful operation"), + @ApiResponse(code = 405, message = "Invalid input") + }) + @RequestMapping( + method = RequestMethod.POST, + value = PetApi.PATH_ADD_PET, + consumes = { "application/json", "application/xml" } + ) + default ResponseEntity addPet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_DELETE_PET = "/pet/{petId}"; + /** + * DELETE /pet/{petId} : Deletes a pet + * + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Successful operation (status code 200) + * or Invalid pet value (status code 400) + */ + @ApiOperation( + tags = { "pet" }, + value = "Deletes a pet", + nickname = "deletePet", + notes = "", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Successful operation"), + @ApiResponse(code = 400, message = "Invalid pet value") + }) + @RequestMapping( + method = RequestMethod.DELETE, + value = PetApi.PATH_DELETE_PET + ) + default ResponseEntity deletePet( + @NotNull @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) @Nullable String apiKey + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_FIND_PETS_BY_STATUS = "/pet/findByStatus"; + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + */ + @ApiOperation( + tags = { "pet" }, + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = PetDto.class, + responseContainer = "List", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = PetDto.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid status value") + }) + @RequestMapping( + method = RequestMethod.GET, + value = PetApi.PATH_FIND_PETS_BY_STATUS, + produces = { "application/xml", "application/json" } + ) + default ResponseEntity> findPetsByStatus( + @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) @Deprecated List status + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_FIND_PETS_BY_TAGS = "/pet/findByTags"; + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + */ + @Deprecated + @ApiOperation( + tags = { "pet" }, + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = PetDto.class, + responseContainer = "Set", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = PetDto.class, responseContainer = "Set"), + @ApiResponse(code = 400, message = "Invalid tag value") + }) + @RequestMapping( + method = RequestMethod.GET, + value = PetApi.PATH_FIND_PETS_BY_TAGS, + produces = { "application/xml", "application/json" } + ) + default ResponseEntity> findPetsByTags( + @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_GET_PET_BY_ID = "/pet/{petId}"; + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + */ + @ApiOperation( + tags = { "pet" }, + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = PetDto.class, + authorizations = { + @Authorization(value = "api_key") + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = PetDto.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found") + }) + @RequestMapping( + method = RequestMethod.GET, + value = PetApi.PATH_GET_PET_BY_ID, + produces = { "application/xml", "application/json" } + ) + default ResponseEntity getPetById( + @NotNull @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_UPDATE_PET = "/pet"; + /** + * PUT /pet : Update an existing pet + * + * + * @param petDto Pet object that needs to be added to the store (required) + * @return Successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + */ + @ApiOperation( + tags = { "pet" }, + value = "Update an existing pet", + nickname = "updatePet", + notes = "", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Successful operation"), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Pet not found"), + @ApiResponse(code = 405, message = "Validation exception") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = PetApi.PATH_UPDATE_PET, + consumes = { "application/json", "application/xml" } + ) + default ResponseEntity updatePet( + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_UPDATE_PET_WITH_FORM = "/pet/{petId}"; + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Successful operation (status code 200) + * or Invalid input (status code 405) + */ + @ApiOperation( + tags = { "pet" }, + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + notes = "", + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "Successful operation"), + @ApiResponse(code = 405, message = "Invalid input") + }) + @RequestMapping( + method = RequestMethod.POST, + value = PetApi.PATH_UPDATE_PET_WITH_FORM, + consumes = { "application/x-www-form-urlencoded" } + ) + default ResponseEntity updatePetWithForm( + @NotNull @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_UPLOAD_FILE = "/pet/{petId}/uploadImage"; + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "pet" }, + value = "uploads an image", + nickname = "uploadFile", + notes = "", + response = ApiResponseDto.class, + authorizations = { + @Authorization(value = "petstore_auth", scopes = { + @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), + @AuthorizationScope(scope = "read:pets", description = "read your pets") + }) + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = ApiResponseDto.class) + }) + @RequestMapping( + method = RequestMethod.POST, + value = PetApi.PATH_UPLOAD_FILE, + produces = { "application/json" }, + consumes = { "multipart/form-data" } + ) + default ResponseEntity uploadFile( + @NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApiController.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApiController.java new file mode 100644 index 000000000000..27650fb63af7 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApiController.java @@ -0,0 +1,49 @@ +package org.openapitools.api; + +import org.openapitools.model.ApiResponseDto; +import org.springframework.lang.Nullable; +import org.openapitools.model.PetDto; +import java.util.Set; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class PetApiController implements PetApi { + + private final NativeWebRequest request; + + @Autowired + public PetApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java new file mode 100644 index 000000000000..5f6ecd6fd385 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java @@ -0,0 +1,196 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.OrderDto; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Api(value = "store", description = "Access to Petstore orders") +public interface StoreApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_DELETE_ORDER = "/store/order/{order_id}"; + /** + * DELETE /store/order/{order_id} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @ApiOperation( + tags = { "store" }, + value = "Delete purchase order by ID", + nickname = "deleteOrder", + notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") + }) + @RequestMapping( + method = RequestMethod.DELETE, + value = StoreApi.PATH_DELETE_ORDER + ) + default ResponseEntity deleteOrder( + @NotNull @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_GET_INVENTORY = "/store/inventory"; + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "store" }, + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = Integer.class, + responseContainer = "Map", + authorizations = { + @Authorization(value = "api_key") + } + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") + }) + @RequestMapping( + method = RequestMethod.GET, + value = StoreApi.PATH_GET_INVENTORY, + produces = { "application/json" } + ) + default ResponseEntity> getInventory( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_GET_ORDER_BY_ID = "/store/order/{order_id}"; + /** + * GET /store/order/{order_id} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + */ + @ApiOperation( + tags = { "store" }, + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", + response = OrderDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = OrderDto.class), + @ApiResponse(code = 400, message = "Invalid ID supplied"), + @ApiResponse(code = 404, message = "Order not found") + }) + @RequestMapping( + method = RequestMethod.GET, + value = StoreApi.PATH_GET_ORDER_BY_ID, + produces = { "application/xml", "application/json" } + ) + default ResponseEntity getOrderById( + @NotNull @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_PLACE_ORDER = "/store/order"; + /** + * POST /store/order : Place an order for a pet + * + * + * @param orderDto order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + */ + @ApiOperation( + tags = { "store" }, + value = "Place an order for a pet", + nickname = "placeOrder", + notes = "", + response = OrderDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = OrderDto.class), + @ApiResponse(code = 400, message = "Invalid Order") + }) + @RequestMapping( + method = RequestMethod.POST, + value = StoreApi.PATH_PLACE_ORDER, + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } + ) + default ResponseEntity placeOrder( + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApiController.java new file mode 100644 index 000000000000..14845d6df819 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApiController.java @@ -0,0 +1,47 @@ +package org.openapitools.api; + +import java.util.Map; +import org.openapitools.model.OrderDto; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class StoreApiController implements StoreApi { + + private final NativeWebRequest request; + + @Autowired + public StoreApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java new file mode 100644 index 000000000000..ba794206c41c --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java @@ -0,0 +1,301 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import java.time.OffsetDateTime; +import org.openapitools.model.UserDto; +import io.swagger.annotations.*; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Api(value = "user", description = "Operations about user") +public interface UserApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_CREATE_USER = "/user"; + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param userDto Created user object (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user." + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = UserApi.PATH_CREATE_USER, + consumes = { "application/json" } + ) + default ResponseEntity createUser( + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody UserDto userDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_CREATE_USERS_WITH_ARRAY_INPUT = "/user/createWithArray"; + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * + * @param userDto List of user object (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = UserApi.PATH_CREATE_USERS_WITH_ARRAY_INPUT, + consumes = { "application/json" } + ) + default ResponseEntity createUsersWithArrayInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_CREATE_USERS_WITH_LIST_INPUT = "/user/createWithList"; + /** + * POST /user/createWithList : Creates list of users with given input array + * + * + * @param userDto List of user object (required) + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.POST, + value = UserApi.PATH_CREATE_USERS_WITH_LIST_INPUT, + consumes = { "application/json" } + ) + default ResponseEntity createUsersWithListInput( + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List<@Valid UserDto> userDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_DELETE_USER = "/user/{username}"; + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "user" }, + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user." + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.DELETE, + value = UserApi.PATH_DELETE_USER + ) + default ResponseEntity deleteUser( + @NotNull @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_GET_USER_BY_NAME = "/user/{username}"; + /** + * GET /user/{username} : Get user by user name + * + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "user" }, + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + response = UserDto.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = UserDto.class), + @ApiResponse(code = 400, message = "Invalid username supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.GET, + value = UserApi.PATH_GET_USER_BY_NAME, + produces = { "application/xml", "application/json" } + ) + default ResponseEntity getUserByName( + @NotNull @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username + ) { + getRequest().ifPresent(request -> { + for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { + if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { + String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; + ApiUtil.setExampleResponse(request, "application/json", exampleString); + break; + } + if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { + String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; + ApiUtil.setExampleResponse(request, "application/xml", exampleString); + break; + } + } + }); + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_LOGIN_USER = "/user/login"; + /** + * GET /user/login : Logs user into the system + * + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + */ + @ApiOperation( + tags = { "user" }, + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = String.class + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation", response = String.class), + @ApiResponse(code = 400, message = "Invalid username/password supplied") + }) + @RequestMapping( + method = RequestMethod.GET, + value = UserApi.PATH_LOGIN_USER, + produces = { "application/xml", "application/json" } + ) + default ResponseEntity loginUser( + @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, + @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_LOGOUT_USER = "/user/logout"; + /** + * GET /user/logout : Logs out current logged in user session + * + * + * @return successful operation (status code 200) + */ + @ApiOperation( + tags = { "user" }, + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "" + ) + @ApiResponses({ + @ApiResponse(code = 200, message = "successful operation") + }) + @RequestMapping( + method = RequestMethod.GET, + value = UserApi.PATH_LOGOUT_USER + ) + default ResponseEntity logoutUser( + + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + + + String PATH_UPDATE_USER = "/user/{username}"; + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param userDto Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + */ + @ApiOperation( + tags = { "user" }, + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user." + ) + @ApiResponses({ + @ApiResponse(code = 400, message = "Invalid user supplied"), + @ApiResponse(code = 404, message = "User not found") + }) + @RequestMapping( + method = RequestMethod.PUT, + value = UserApi.PATH_UPDATE_USER, + consumes = { "application/json" } + ) + default ResponseEntity updateUser( + @NotNull @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody UserDto userDto + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApiController.java new file mode 100644 index 000000000000..28e6350ea157 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApiController.java @@ -0,0 +1,47 @@ +package org.openapitools.api; + +import java.time.OffsetDateTime; +import org.openapitools.model.UserDto; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") +public class UserApiController implements UserApi { + + private final NativeWebRequest request; + + @Autowired + public UserApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java new file mode 100644 index 000000000000..5817e4685e6c --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java @@ -0,0 +1,79 @@ +package org.openapitools.configuration; + +import org.openapitools.model.EnumClassDto; +import org.openapitools.model.OuterEnumDefaultValueDto; +import org.openapitools.model.OuterEnumDto; +import org.openapitools.model.OuterEnumIntegerDefaultValueDto; +import org.openapitools.model.OuterEnumIntegerDto; +import org.openapitools.model.SingleRefTypeDto; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.convert.converter.Converter; + +/** + * This class provides Spring Converter beans for the enum models in the OpenAPI specification. + * + * By default, Spring only converts primitive types to enums using Enum::valueOf, which can prevent + * correct conversion if the OpenAPI specification is using an `enumPropertyNaming` other than + * `original` or the specification has an integer enum. + */ +@Configuration(value = "org.openapitools.configuration.enumConverterConfiguration") +public class EnumConverterConfiguration { + + @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter") + Converter enumClassConverter() { + return new Converter() { + @Override + public EnumClassDto convert(String source) { + return EnumClassDto.fromValue(source); + } + }; + } + @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumDefaultValueConverter") + Converter outerEnumDefaultValueConverter() { + return new Converter() { + @Override + public OuterEnumDefaultValueDto convert(String source) { + return OuterEnumDefaultValueDto.fromValue(source); + } + }; + } + @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter") + Converter outerEnumConverter() { + return new Converter() { + @Override + public OuterEnumDto convert(String source) { + return OuterEnumDto.fromValue(source); + } + }; + } + @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumIntegerDefaultValueConverter") + Converter outerEnumIntegerDefaultValueConverter() { + return new Converter() { + @Override + public OuterEnumIntegerDefaultValueDto convert(Integer source) { + return OuterEnumIntegerDefaultValueDto.fromValue(source); + } + }; + } + @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumIntegerConverter") + Converter outerEnumIntegerConverter() { + return new Converter() { + @Override + public OuterEnumIntegerDto convert(Integer source) { + return OuterEnumIntegerDto.fromValue(source); + } + }; + } + @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.singleRefTypeConverter") + Converter singleRefTypeConverter() { + return new Converter() { + @Override + public SingleRefTypeDto convert(String source) { + return SingleRefTypeDto.fromValue(source); + } + }; + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/HomeController.java new file mode 100644 index 000000000000..e390f86f5b73 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/HomeController.java @@ -0,0 +1,28 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +public class HomeController { + + static final String API_DOCS_PATH = "/v2/api-docs"; + + @GetMapping(value = "/swagger-config.yaml", produces = "text/plain") + @ResponseBody + public String swaggerConfig() { + return "url: " + API_DOCS_PATH + "\n"; + } + + @RequestMapping("/") + public String index() { + return "redirect:swagger-ui.html"; + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java new file mode 100644 index 000000000000..f56492cdd3b4 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/configuration/SpringFoxConfiguration.java @@ -0,0 +1,71 @@ +package org.openapitools.configuration; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import org.springframework.web.util.UriComponentsBuilder; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.paths.Paths; +import springfox.documentation.spring.web.paths.RelativePathProvider; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import javax.annotation.Generated; +import javax.servlet.ServletContext; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Configuration +@EnableSwagger2 +public class SpringFoxConfiguration { + + ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("OpenAPI Petstore") + .description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\") + .license("Apache-2.0") + .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html") + .termsOfServiceUrl("") + .version("1.0.0") + .contact(new Contact("","", "")) + .build(); + } + + @Bean + public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) { + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("org.openapitools.api")) + .build() + .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath)) + .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class) + .apiInfo(apiInfo()); + } + + class BasePathAwareRelativePathProvider extends RelativePathProvider { + private String basePath; + + public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) { + super(servletContext); + this.basePath = basePath; + } + + @Override + protected String applicationPath() { + return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString()); + } + + @Override + public String getOperationPath(String operationPath) { + UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/"); + return Paths.removeAdjacentForwardSlashes( + uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString()); + } + } + +} diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java new file mode 100644 index 000000000000..38c557ffce4e --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -0,0 +1,131 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AdditionalPropertiesClassDto + */ + +@JsonTypeName("AdditionalPropertiesClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class AdditionalPropertiesClassDto { + + @Valid + private Map mapProperty = new HashMap<>(); + + @Valid + private Map> mapOfMapProperty = new HashMap<>(); + + public AdditionalPropertiesClassDto mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; + } + + public AdditionalPropertiesClassDto putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; + } + + /** + * Get mapProperty + * @return mapProperty + */ + + @ApiModelProperty(value = "") + @JsonProperty("map_property") + public Map getMapProperty() { + return mapProperty; + } + + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + + public AdditionalPropertiesClassDto mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } + + public AdditionalPropertiesClassDto putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + + /** + * Get mapOfMapProperty + * @return mapOfMapProperty + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map_of_map_property") + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } + + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesClassDto additionalPropertiesClass = (AdditionalPropertiesClassDto) o; + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + } + + @Override + public int hashCode() { + return Objects.hash(mapProperty, mapOfMapProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClassDto {\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java new file mode 100644 index 000000000000..9c25dddc691a --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AllOfWithSingleRefDto.java @@ -0,0 +1,113 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.SingleRefTypeDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AllOfWithSingleRefDto + */ + +@JsonTypeName("AllOfWithSingleRef") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class AllOfWithSingleRefDto { + + private @Nullable String username; + + private @Nullable SingleRefTypeDto singleRefType; + + public AllOfWithSingleRefDto username(@Nullable String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + + @ApiModelProperty(value = "") + @JsonProperty("username") + public @Nullable String getUsername() { + return username; + } + + public void setUsername(@Nullable String username) { + this.username = username; + } + + public AllOfWithSingleRefDto singleRefType(@Nullable SingleRefTypeDto singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + /** + * Get singleRefType + * @return singleRefType + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("SingleRefType") + public @Nullable SingleRefTypeDto getSingleRefType() { + return singleRefType; + } + + public void setSingleRefType(@Nullable SingleRefTypeDto singleRefType) { + this.singleRefType = singleRefType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfWithSingleRefDto allOfWithSingleRef = (AllOfWithSingleRefDto) o; + return Objects.equals(this.username, allOfWithSingleRef.username) && + Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); + } + + @Override + public int hashCode() { + return Objects.hash(username, singleRefType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRefDto {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java new file mode 100644 index 000000000000..61e545767796 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/AnimalDto.java @@ -0,0 +1,134 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * AnimalDto + */ + +@JsonIgnoreProperties( + value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the className to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = CatDto.class, name = "CAT"), + @JsonSubTypes.Type(value = DogDto.class, name = "DOG") +}) + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class AnimalDto implements com.custompackage.InterfaceToKeep, com.custompackage.WithColor { + + private String className; + + private String color = "red"; + + public AnimalDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public AnimalDto(String className) { + this.className = className; + } + + public AnimalDto className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * @return className + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("className") + public String getClassName() { + return className; + } + + public void setClassName(String className) { + this.className = className; + } + + public AnimalDto color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * @return color + */ + + @ApiModelProperty(value = "") + @JsonProperty("color") + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AnimalDto animal = (AnimalDto) o; + return Objects.equals(this.className, animal.className) && + Objects.equals(this.color, animal.color); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AnimalDto {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ApiResponseDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ApiResponseDto.java new file mode 100644 index 000000000000..cd376e162fa9 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ApiResponseDto.java @@ -0,0 +1,135 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ApiResponseDto + */ + +@JsonTypeName("ApiResponse") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ApiResponseDto { + + private @Nullable Integer code; + + private @Nullable String type; + + private @Nullable String message; + + public ApiResponseDto code(@Nullable Integer code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + + @ApiModelProperty(value = "") + @JsonProperty("code") + public @Nullable Integer getCode() { + return code; + } + + public void setCode(@Nullable Integer code) { + this.code = code; + } + + public ApiResponseDto type(@Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @ApiModelProperty(value = "") + @JsonProperty("type") + public @Nullable String getType() { + return type; + } + + public void setType(@Nullable String type) { + this.type = type; + } + + public ApiResponseDto message(@Nullable String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + */ + + @ApiModelProperty(value = "") + @JsonProperty("message") + public @Nullable String getMessage() { + return message; + } + + public void setMessage(@Nullable String message) { + this.message = message; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiResponseDto _apiResponse = (ApiResponseDto) o; + return Objects.equals(this.code, _apiResponse.code) && + Objects.equals(this.type, _apiResponse.type) && + Objects.equals(this.message, _apiResponse.message); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiResponseDto {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java new file mode 100644 index 000000000000..ca83464735b5 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -0,0 +1,100 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayOfArrayOfNumberOnlyDto + */ + +@JsonTypeName("ArrayOfArrayOfNumberOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ArrayOfArrayOfNumberOnlyDto { + + @Valid + private List> arrayArrayNumber = new ArrayList<>(); + + public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; + } + + public ArrayOfArrayOfNumberOnlyDto addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); + } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; + } + + /** + * Get arrayArrayNumber + * @return arrayArrayNumber + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("ArrayArrayNumber") + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfArrayOfNumberOnlyDto arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnlyDto) o; + return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnlyDto {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java new file mode 100644 index 000000000000..0a18e0ad1dfb --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -0,0 +1,100 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayOfNumberOnlyDto + */ + +@JsonTypeName("ArrayOfNumberOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ArrayOfNumberOnlyDto { + + @Valid + private List arrayNumber = new ArrayList<>(); + + public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; + } + + public ArrayOfNumberOnlyDto addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); + } + this.arrayNumber.add(arrayNumberItem); + return this; + } + + /** + * Get arrayNumber + * @return arrayNumber + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("ArrayNumber") + public List getArrayNumber() { + return arrayNumber; + } + + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayOfNumberOnlyDto arrayOfNumberOnly = (ArrayOfNumberOnlyDto) o; + return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnlyDto {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayTestDto.java new file mode 100644 index 000000000000..c26db2a0c8f4 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -0,0 +1,166 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.ReadOnlyFirstDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ArrayTestDto + */ + +@JsonTypeName("ArrayTest") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ArrayTestDto { + + @Valid + private List arrayOfString = new ArrayList<>(); + + @Valid + private List> arrayArrayOfInteger = new ArrayList<>(); + + @Valid + private List> arrayArrayOfModel = new ArrayList<>(); + + public ArrayTestDto arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; + } + + public ArrayTestDto addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); + } + this.arrayOfString.add(arrayOfStringItem); + return this; + } + + /** + * Get arrayOfString + * @return arrayOfString + */ + @Size(min = 0, max = 3) + @ApiModelProperty(value = "") + @JsonProperty("array_of_string") + public List getArrayOfString() { + return arrayOfString; + } + + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTestDto arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTestDto addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * @return arrayArrayOfInteger + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("array_array_of_integer") + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTestDto arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTestDto addArrayArrayOfModelItem(List<@Valid ReadOnlyFirstDto> arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * @return arrayArrayOfModel + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("array_array_of_model") + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTestDto arrayTest = (ArrayTestDto) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && + Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && + Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTestDto {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); + sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CapitalizationDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CapitalizationDto.java new file mode 100644 index 000000000000..2f7a20d51ab4 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CapitalizationDto.java @@ -0,0 +1,207 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CapitalizationDto + */ + +@JsonTypeName("Capitalization") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class CapitalizationDto { + + private @Nullable String smallCamel; + + private @Nullable String capitalCamel; + + private @Nullable String smallSnake; + + private @Nullable String capitalSnake; + + private @Nullable String scAETHFlowPoints; + + private @Nullable String ATT_NAME; + + public CapitalizationDto smallCamel(@Nullable String smallCamel) { + this.smallCamel = smallCamel; + return this; + } + + /** + * Get smallCamel + * @return smallCamel + */ + + @ApiModelProperty(value = "") + @JsonProperty("smallCamel") + public @Nullable String getSmallCamel() { + return smallCamel; + } + + public void setSmallCamel(@Nullable String smallCamel) { + this.smallCamel = smallCamel; + } + + public CapitalizationDto capitalCamel(@Nullable String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; + } + + /** + * Get capitalCamel + * @return capitalCamel + */ + + @ApiModelProperty(value = "") + @JsonProperty("CapitalCamel") + public @Nullable String getCapitalCamel() { + return capitalCamel; + } + + public void setCapitalCamel(@Nullable String capitalCamel) { + this.capitalCamel = capitalCamel; + } + + public CapitalizationDto smallSnake(@Nullable String smallSnake) { + this.smallSnake = smallSnake; + return this; + } + + /** + * Get smallSnake + * @return smallSnake + */ + + @ApiModelProperty(value = "") + @JsonProperty("small_Snake") + public @Nullable String getSmallSnake() { + return smallSnake; + } + + public void setSmallSnake(@Nullable String smallSnake) { + this.smallSnake = smallSnake; + } + + public CapitalizationDto capitalSnake(@Nullable String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * @return capitalSnake + */ + + @ApiModelProperty(value = "") + @JsonProperty("Capital_Snake") + public @Nullable String getCapitalSnake() { + return capitalSnake; + } + + public void setCapitalSnake(@Nullable String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public CapitalizationDto scAETHFlowPoints(@Nullable String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * @return scAETHFlowPoints + */ + + @ApiModelProperty(value = "") + @JsonProperty("SCA_ETH_Flow_Points") + public @Nullable String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + public void setScAETHFlowPoints(@Nullable String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public CapitalizationDto ATT_NAME(@Nullable String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * @return ATT_NAME + */ + + @ApiModelProperty(value = "Name of the pet ") + @JsonProperty("ATT_NAME") + public @Nullable String getATTNAME() { + return ATT_NAME; + } + + public void setATTNAME(@Nullable String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CapitalizationDto capitalization = (CapitalizationDto) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) && + Objects.equals(this.capitalCamel, capitalization.capitalCamel) && + Objects.equals(this.smallSnake, capitalization.smallSnake) && + Objects.equals(this.capitalSnake, capitalization.capitalSnake) && + Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && + Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CapitalizationDto {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CatDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CatDto.java new file mode 100644 index 000000000000..8f2ee1512b37 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CatDto.java @@ -0,0 +1,114 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.AnimalDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CatDto + */ + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class CatDto extends AnimalDto { + + private @Nullable Boolean declawed; + + public CatDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public CatDto(String className) { + super(className); + } + + public CatDto declawed(@Nullable Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + */ + + @ApiModelProperty(value = "") + @JsonProperty("declawed") + public @Nullable Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(@Nullable Boolean declawed) { + this.declawed = declawed; + } + + + public CatDto className(String className) { + super.className(className); + return this; + } + + public CatDto color(String color) { + super.color(color); + return this; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatDto cat = (CatDto) o; + return Objects.equals(this.declawed, cat.declawed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java new file mode 100644 index 000000000000..a96abfd855ed --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/CategoryDto.java @@ -0,0 +1,122 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * CategoryDto + */ + +@JsonTypeName("Category") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class CategoryDto { + + private @Nullable Long id; + + private String name = "default-name"; + + public CategoryDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public CategoryDto(String name) { + this.name = name; + } + + public CategoryDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public CategoryDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CategoryDto category = (CategoryDto) o; + return Objects.equals(this.id, category.id) && + Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CategoryDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ChildWithNullableDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ChildWithNullableDto.java new file mode 100644 index 000000000000..c26b8eddf14d --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ChildWithNullableDto.java @@ -0,0 +1,118 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.model.ParentWithNullableDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ChildWithNullableDto + */ + + +@JsonTypeName("ChildWithNullable") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ChildWithNullableDto extends ParentWithNullableDto { + + private @Nullable String otherProperty; + + public ChildWithNullableDto otherProperty(@Nullable String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + /** + * Get otherProperty + * @return otherProperty + */ + + @ApiModelProperty(value = "") + @JsonProperty("otherProperty") + public @Nullable String getOtherProperty() { + return otherProperty; + } + + public void setOtherProperty(@Nullable String otherProperty) { + this.otherProperty = otherProperty; + } + + + public ChildWithNullableDto type(TypeEnum type) { + super.type(type); + return this; + } + + public ChildWithNullableDto nullableProperty(String nullableProperty) { + super.nullableProperty(nullableProperty); + return this; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullableDto childWithNullable = (ChildWithNullableDto) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullableDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClassModelDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClassModelDto.java new file mode 100644 index 000000000000..e7905f5dc3a9 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClassModelDto.java @@ -0,0 +1,88 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model with \"_class\" property + */ + +@ApiModel(description = "Model for testing model with \"_class\" property") +@JsonTypeName("ClassModel") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ClassModelDto { + + private @Nullable String propertyClass; + + public ClassModelDto propertyClass(@Nullable String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @ApiModelProperty(value = "") + @JsonProperty("_class") + public @Nullable String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(@Nullable String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModelDto classModel = (ClassModelDto) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModelDto {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClientDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClientDto.java new file mode 100644 index 000000000000..9570af694744 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ClientDto.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ClientDto + */ + +@JsonTypeName("Client") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ClientDto { + + private @Nullable String client; + + public ClientDto client(@Nullable String client) { + this.client = client; + return this; + } + + /** + * Get client + * @return client + */ + + @ApiModelProperty(value = "") + @JsonProperty("client") + public @Nullable String getClient() { + return client; + } + + public void setClient(@Nullable String client) { + this.client = client; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientDto client = (ClientDto) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientDto {\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DeprecatedObjectDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DeprecatedObjectDto.java new file mode 100644 index 000000000000..53ef817692c3 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DeprecatedObjectDto.java @@ -0,0 +1,89 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * DeprecatedObjectDto + * @deprecated + */ + +@Deprecated +@JsonTypeName("DeprecatedObject") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class DeprecatedObjectDto { + + private @Nullable String name; + + public DeprecatedObjectDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObjectDto deprecatedObject = (DeprecatedObjectDto) o; + return Objects.equals(this.name, deprecatedObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObjectDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DogDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DogDto.java new file mode 100644 index 000000000000..869db3b01751 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/DogDto.java @@ -0,0 +1,114 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.AnimalDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * DogDto + */ + + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class DogDto extends AnimalDto { + + private @Nullable String breed; + + public DogDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public DogDto(String className) { + super(className); + } + + public DogDto breed(@Nullable String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + */ + + @ApiModelProperty(value = "") + @JsonProperty("breed") + public @Nullable String getBreed() { + return breed; + } + + public void setBreed(@Nullable String breed) { + this.breed = breed; + } + + + public DogDto className(String className) { + super.className(className); + return this; + } + + public DogDto color(String color) { + super.color(color); + return this; + } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogDto dog = (DogDto) o; + return Objects.equals(this.breed, dog.breed) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogDto {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumArraysDto.java new file mode 100644 index 000000000000..b0514fbe6a45 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -0,0 +1,194 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EnumArraysDto + */ + +@JsonTypeName("EnumArrays") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class EnumArraysDto { + + /** + * Gets or Sets justSymbol + */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), + + DOLLAR("$"); + + private final String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable JustSymbolEnum justSymbol; + + /** + * Gets or Sets arrayEnum + */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private final String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @Valid + private List arrayEnum = new ArrayList<>(); + + public EnumArraysDto justSymbol(@Nullable JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * @return justSymbol + */ + + @ApiModelProperty(value = "") + @JsonProperty("just_symbol") + public @Nullable JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + public void setJustSymbol(@Nullable JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArraysDto arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArraysDto addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * @return arrayEnum + */ + + @ApiModelProperty(value = "") + @JsonProperty("array_enum") + public List getArrayEnum() { + return arrayEnum; + } + + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumArraysDto enumArrays = (EnumArraysDto) o; + return Objects.equals(this.justSymbol, enumArrays.justSymbol) && + Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArraysDto {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumClassDto.java new file mode 100644 index 000000000000..7deb2abb92bd --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumClassDto.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets EnumClass + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public enum EnumClassDto { + + _ABC("_abc"), + + _EFG("-efg"), + + _XYZ_("(xyz)"); + + private final String value; + + EnumClassDto(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClassDto fromValue(String value) { + for (EnumClassDto b : EnumClassDto.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java new file mode 100644 index 000000000000..a05ff2a7681f --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/EnumTestDto.java @@ -0,0 +1,429 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.model.OuterEnumDefaultValueDto; +import org.openapitools.model.OuterEnumDto; +import org.openapitools.model.OuterEnumIntegerDefaultValueDto; +import org.openapitools.model.OuterEnumIntegerDto; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * EnumTestDto + */ + +@JsonTypeName("Enum_Test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class EnumTestDto { + + /** + * Gets or Sets enumString + */ + public enum EnumStringEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private final String value; + + EnumStringEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable EnumStringEnum enumString; + + /** + * Gets or Sets enumStringRequired + */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), + + LOWER("lower"), + + EMPTY(""); + + private final String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private EnumStringRequiredEnum enumStringRequired; + + /** + * Gets or Sets enumInteger + */ + public enum EnumIntegerEnum { + NUMBER_1(1), + + NUMBER_MINUS_1(-1); + + private final Integer value; + + EnumIntegerEnum(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable EnumIntegerEnum enumInteger; + + /** + * Gets or Sets enumNumber + */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), + + NUMBER_MINUS_1_DOT_2(-1.2); + + private final Double value; + + EnumNumberEnum(Double value) { + this.value = value; + } + + @JsonValue + public Double getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable EnumNumberEnum enumNumber; + + private JsonNullable outerEnum = JsonNullable.undefined(); + + private @Nullable OuterEnumIntegerDto outerEnumInteger; + + private OuterEnumDefaultValueDto outerEnumDefaultValue = OuterEnumDefaultValueDto.PLACED; + + private OuterEnumIntegerDefaultValueDto outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValueDto.NUMBER_0; + + public EnumTestDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public EnumTestDto(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTestDto enumString(@Nullable EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } + + /** + * Get enumString + * @return enumString + */ + + @ApiModelProperty(value = "") + @JsonProperty("enum_string") + public @Nullable EnumStringEnum getEnumString() { + return enumString; + } + + public void setEnumString(@Nullable EnumStringEnum enumString) { + this.enumString = enumString; + } + + public EnumTestDto enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } + + /** + * Get enumStringRequired + * @return enumStringRequired + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("enum_string_required") + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } + + public EnumTestDto enumInteger(@Nullable EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } + + /** + * Get enumInteger + * @return enumInteger + */ + + @ApiModelProperty(value = "") + @JsonProperty("enum_integer") + public @Nullable EnumIntegerEnum getEnumInteger() { + return enumInteger; + } + + public void setEnumInteger(@Nullable EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTestDto enumNumber(@Nullable EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * @return enumNumber + */ + + @ApiModelProperty(value = "") + @JsonProperty("enum_number") + public @Nullable EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + public void setEnumNumber(@Nullable EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTestDto outerEnum(OuterEnumDto outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); + return this; + } + + /** + * Get outerEnum + * @return outerEnum + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("outerEnum") + public JsonNullable getOuterEnum() { + return outerEnum; + } + + public void setOuterEnum(JsonNullable outerEnum) { + this.outerEnum = outerEnum; + } + + public EnumTestDto outerEnumInteger(@Nullable OuterEnumIntegerDto outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + /** + * Get outerEnumInteger + * @return outerEnumInteger + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("outerEnumInteger") + public @Nullable OuterEnumIntegerDto getOuterEnumInteger() { + return outerEnumInteger; + } + + public void setOuterEnumInteger(@Nullable OuterEnumIntegerDto outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + public EnumTestDto outerEnumDefaultValue(OuterEnumDefaultValueDto outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + /** + * Get outerEnumDefaultValue + * @return outerEnumDefaultValue + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("outerEnumDefaultValue") + public OuterEnumDefaultValueDto getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + public void setOuterEnumDefaultValue(OuterEnumDefaultValueDto outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + public EnumTestDto outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValueDto outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * @return outerEnumIntegerDefaultValue + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("outerEnumIntegerDefaultValue") + public OuterEnumIntegerDefaultValueDto getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValueDto outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EnumTestDto enumTest = (EnumTestDto) o; + return Objects.equals(this.enumString, enumTest.enumString) && + Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && + Objects.equals(this.enumInteger, enumTest.enumInteger) && + Objects.equals(this.enumNumber, enumTest.enumNumber) && + equalsNullable(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTestDto {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FakeBigDecimalMap200ResponseDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FakeBigDecimalMap200ResponseDto.java new file mode 100644 index 000000000000..9b52b9bd9b0d --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FakeBigDecimalMap200ResponseDto.java @@ -0,0 +1,123 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FakeBigDecimalMap200ResponseDto + */ + +@JsonTypeName("fakeBigDecimalMap_200_response") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class FakeBigDecimalMap200ResponseDto { + + private @Nullable BigDecimal someId; + + @Valid + private Map someMap = new HashMap<>(); + + public FakeBigDecimalMap200ResponseDto someId(@Nullable BigDecimal someId) { + this.someId = someId; + return this; + } + + /** + * Get someId + * @return someId + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("someId") + public @Nullable BigDecimal getSomeId() { + return someId; + } + + public void setSomeId(@Nullable BigDecimal someId) { + this.someId = someId; + } + + public FakeBigDecimalMap200ResponseDto someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + public FakeBigDecimalMap200ResponseDto putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + this.someMap.put(key, someMapItem); + return this; + } + + /** + * Get someMap + * @return someMap + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("someMap") + public Map getSomeMap() { + return someMap; + } + + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FakeBigDecimalMap200ResponseDto fakeBigDecimalMap200Response = (FakeBigDecimalMap200ResponseDto) o; + return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && + Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + } + + @Override + public int hashCode() { + return Objects.hash(someId, someMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200ResponseDto {\n"); + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileDto.java new file mode 100644 index 000000000000..68982c42dc12 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileDto.java @@ -0,0 +1,88 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Must be named `File` for test. + */ + +@ApiModel(description = "Must be named `File` for test.") +@JsonTypeName("File") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class FileDto { + + private @Nullable String sourceURI; + + public FileDto sourceURI(@Nullable String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + */ + + @ApiModelProperty(value = "Test capitalization") + @JsonProperty("sourceURI") + public @Nullable String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(@Nullable String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileDto file = (FileDto) o; + return Objects.equals(this.sourceURI, file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileDto {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java new file mode 100644 index 000000000000..4a7ca33c3f49 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -0,0 +1,124 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.FileDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FileSchemaTestClassDto + */ + +@JsonTypeName("FileSchemaTestClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class FileSchemaTestClassDto { + + private @Nullable FileDto file; + + @Valid + private List<@Valid FileDto> files = new ArrayList<>(); + + public FileSchemaTestClassDto file(@Nullable FileDto file) { + this.file = file; + return this; + } + + /** + * Get file + * @return file + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("file") + public @Nullable FileDto getFile() { + return file; + } + + public void setFile(@Nullable FileDto file) { + this.file = file; + } + + public FileSchemaTestClassDto files(List<@Valid FileDto> files) { + this.files = files; + return this; + } + + public FileSchemaTestClassDto addFilesItem(FileDto filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(filesItem); + return this; + } + + /** + * Get files + * @return files + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("files") + public List<@Valid FileDto> getFiles() { + return files; + } + + public void setFiles(List<@Valid FileDto> files) { + this.files = files; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FileSchemaTestClassDto fileSchemaTestClass = (FileSchemaTestClassDto) o; + return Objects.equals(this.file, fileSchemaTestClass.file) && + Objects.equals(this.files, fileSchemaTestClass.files); + } + + @Override + public int hashCode() { + return Objects.hash(file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClassDto {\n"); + sb.append(" file: ").append(toIndentedString(file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooDto.java new file mode 100644 index 000000000000..c69ae4fc1ed0 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooDto.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FooDto + */ + +@JsonTypeName("Foo") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class FooDto implements com.custompackage.WithBar, com.custompackage.WithDefaultMethod { + + private String bar = "bar"; + + public FooDto bar(String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @ApiModelProperty(value = "") + @JsonProperty("bar") + public String getBar() { + return bar; + } + + public void setBar(String bar) { + this.bar = bar; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooDto foo = (FooDto) o; + return Objects.equals(this.bar, foo.bar); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooDto {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooGetDefaultResponseDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooGetDefaultResponseDto.java new file mode 100644 index 000000000000..6b87bed04493 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FooGetDefaultResponseDto.java @@ -0,0 +1,88 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.FooDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FooGetDefaultResponseDto + */ + +@JsonTypeName("_foo_get_default_response") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class FooGetDefaultResponseDto { + + private @Nullable FooDto string; + + public FooGetDefaultResponseDto string(@Nullable FooDto string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("string") + public @Nullable FooDto getString() { + return string; + } + + public void setString(@Nullable FooDto string) { + this.string = string; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponseDto fooGetDefaultResponse = (FooGetDefaultResponseDto) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponseDto {\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java new file mode 100644 index 000000000000..6680b8adf587 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/FormatTestDto.java @@ -0,0 +1,479 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FormatTestDto + */ + +@JsonTypeName("format_test") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class FormatTestDto { + + private @Nullable Integer integer; + + private @Nullable Integer int32; + + private @Nullable Long int64; + + private BigDecimal number; + + private @Nullable Float _float; + + private @Nullable Double _double; + + private @Nullable BigDecimal decimal; + + private @Nullable String string; + + private byte[] _byte; + + private @Nullable org.springframework.core.io.Resource binary; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private LocalDate date; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime dateTime; + + private @Nullable UUID uuid; + + private String password; + + private @Nullable String patternWithDigits; + + private @Nullable String patternWithDigitsAndDelimiter; + + public FormatTestDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public FormatTestDto(BigDecimal number, byte[] _byte, LocalDate date, String password) { + this.number = number; + this._byte = _byte; + this.date = date; + this.password = password; + } + + public FormatTestDto integer(@Nullable Integer integer) { + this.integer = integer; + return this; + } + + /** + * Get integer + * minimum: 10 + * maximum: 100 + * @return integer + */ + @Min(value = 10) @Max(value = 100) + @ApiModelProperty(value = "") + @JsonProperty("integer") + public @Nullable Integer getInteger() { + return integer; + } + + public void setInteger(@Nullable Integer integer) { + this.integer = integer; + } + + public FormatTestDto int32(@Nullable Integer int32) { + this.int32 = int32; + return this; + } + + /** + * Get int32 + * minimum: 20 + * maximum: 200 + * @return int32 + */ + @Min(value = 20) @Max(value = 200) + @ApiModelProperty(value = "") + @JsonProperty("int32") + public @Nullable Integer getInt32() { + return int32; + } + + public void setInt32(@Nullable Integer int32) { + this.int32 = int32; + } + + public FormatTestDto int64(@Nullable Long int64) { + this.int64 = int64; + return this; + } + + /** + * Get int64 + * @return int64 + */ + + @ApiModelProperty(value = "") + @JsonProperty("int64") + public @Nullable Long getInt64() { + return int64; + } + + public void setInt64(@Nullable Long int64) { + this.int64 = int64; + } + + public FormatTestDto number(BigDecimal number) { + this.number = number; + return this; + } + + /** + * Get number + * minimum: 32.1 + * maximum: 543.2 + * @return number + */ + @NotNull @Valid @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") + @ApiModelProperty(required = true, value = "") + @JsonProperty("number") + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public FormatTestDto _float(@Nullable Float _float) { + this._float = _float; + return this; + } + + /** + * Get _float + * minimum: 54.3 + * maximum: 987.6 + * @return _float + */ + @DecimalMin(value = "54.3") @DecimalMax(value = "987.6") + @ApiModelProperty(value = "") + @JsonProperty("float") + public @Nullable Float getFloat() { + return _float; + } + + public void setFloat(@Nullable Float _float) { + this._float = _float; + } + + public FormatTestDto _double(@Nullable Double _double) { + this._double = _double; + return this; + } + + /** + * Get _double + * minimum: 67.8 + * maximum: 123.4 + * @return _double + */ + @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") + @ApiModelProperty(value = "") + @JsonProperty("double") + public @Nullable Double getDouble() { + return _double; + } + + public void setDouble(@Nullable Double _double) { + this._double = _double; + } + + public FormatTestDto decimal(@Nullable BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get decimal + * @return decimal + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("decimal") + public @Nullable BigDecimal getDecimal() { + return decimal; + } + + public void setDecimal(@Nullable BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTestDto string(@Nullable String string) { + this.string = string; + return this; + } + + /** + * Get string + * @return string + */ + @Pattern(regexp = "/[a-z]/i") + @ApiModelProperty(value = "") + @JsonProperty("string") + public @Nullable String getString() { + return string; + } + + public void setString(@Nullable String string) { + this.string = string; + } + + public FormatTestDto _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * @return _byte + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("byte") + public byte[] getByte() { + return _byte; + } + + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTestDto binary(@Nullable org.springframework.core.io.Resource binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * @return binary + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("binary") + public @Nullable org.springframework.core.io.Resource getBinary() { + return binary; + } + + public void setBinary(@Nullable org.springframework.core.io.Resource binary) { + this.binary = binary; + } + + public FormatTestDto date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @NotNull @Valid + @ApiModelProperty(required = true, value = "") + @JsonProperty("date") + public LocalDate getDate() { + return date; + } + + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTestDto dateTime(@Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("dateTime") + public @Nullable OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(@Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTestDto uuid(@Nullable UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @Valid + @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") + @JsonProperty("uuid") + public @Nullable UUID getUuid() { + return uuid; + } + + public void setUuid(@Nullable UUID uuid) { + this.uuid = uuid; + } + + public FormatTestDto password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @NotNull @Size(min = 10, max = 64) + @ApiModelProperty(required = true, value = "") + @JsonProperty("password") + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public FormatTestDto patternWithDigits(@Nullable String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * @return patternWithDigits + */ + @Pattern(regexp = "^\\d{10}$") + @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.") + @JsonProperty("pattern_with_digits") + public @Nullable String getPatternWithDigits() { + return patternWithDigits; + } + + public void setPatternWithDigits(@Nullable String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTestDto patternWithDigitsAndDelimiter(@Nullable String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + * @return patternWithDigitsAndDelimiter + */ + @Pattern(regexp = "/^image_\\d{1,3}$/i") + @ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + @JsonProperty("pattern_with_digits_and_delimiter") + public @Nullable String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + public void setPatternWithDigitsAndDelimiter(@Nullable String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormatTestDto formatTest = (FormatTestDto) o; + return Objects.equals(this.integer, formatTest.integer) && + Objects.equals(this.int32, formatTest.int32) && + Objects.equals(this.int64, formatTest.int64) && + Objects.equals(this.number, formatTest.number) && + Objects.equals(this._float, formatTest._float) && + Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && + Objects.equals(this.string, formatTest.string) && + Arrays.equals(this._byte, formatTest._byte) && + Objects.equals(this.binary, formatTest.binary) && + Objects.equals(this.date, formatTest.date) && + Objects.equals(this.dateTime, formatTest.dateTime) && + Objects.equals(this.uuid, formatTest.uuid) && + Objects.equals(this.password, formatTest.password) && + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + } + + @Override + public int hashCode() { + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTestDto {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java new file mode 100644 index 000000000000..22352d6763d8 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HasOnlyReadOnlyDto.java @@ -0,0 +1,111 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * HasOnlyReadOnlyDto + */ + +@JsonTypeName("hasOnlyReadOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class HasOnlyReadOnlyDto { + + private @Nullable String bar; + + private @Nullable String foo; + + public HasOnlyReadOnlyDto bar(@Nullable String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") + public @Nullable String getBar() { + return bar; + } + + public void setBar(@Nullable String bar) { + this.bar = bar; + } + + public HasOnlyReadOnlyDto foo(@Nullable String foo) { + this.foo = foo; + return this; + } + + /** + * Get foo + * @return foo + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("foo") + public @Nullable String getFoo() { + return foo; + } + + public void setFoo(@Nullable String foo) { + this.foo = foo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HasOnlyReadOnlyDto hasOnlyReadOnly = (HasOnlyReadOnlyDto) o; + return Objects.equals(this.bar, hasOnlyReadOnly.bar) && + Objects.equals(this.foo, hasOnlyReadOnly.foo); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnlyDto {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java new file mode 100644 index 000000000000..0c4f65085d58 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/HealthCheckResultDto.java @@ -0,0 +1,102 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + */ + +@ApiModel(description = "Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.") +@JsonTypeName("HealthCheckResult") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class HealthCheckResultDto { + + private JsonNullable nullableMessage = JsonNullable.undefined(); + + public HealthCheckResultDto nullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + return this; + } + + /** + * Get nullableMessage + * @return nullableMessage + */ + + @ApiModelProperty(value = "") + @JsonProperty("NullableMessage") + public JsonNullable getNullableMessage() { + return nullableMessage; + } + + public void setNullableMessage(JsonNullable nullableMessage) { + this.nullableMessage = nullableMessage; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResultDto healthCheckResult = (HealthCheckResultDto) o; + return equalsNullable(this.nullableMessage, healthCheckResult.nullableMessage); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableMessage)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResultDto {\n"); + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ListDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ListDto.java new file mode 100644 index 000000000000..a54c9a8ffde4 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ListDto.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ListDto + */ + +@JsonTypeName("List") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ListDto { + + private @Nullable String _123List; + + public ListDto _123List(@Nullable String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + */ + + @ApiModelProperty(value = "") + @JsonProperty("123-list") + public @Nullable String get123List() { + return _123List; + } + + public void set123List(@Nullable String _123List) { + this._123List = _123List; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListDto _list = (ListDto) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListDto {\n"); + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MapTestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MapTestDto.java new file mode 100644 index 000000000000..78b4edea7585 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MapTestDto.java @@ -0,0 +1,233 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.HashMap; +import java.util.Map; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * MapTestDto + */ + +@JsonTypeName("MapTest") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class MapTestDto { + + @Valid + private Map> mapMapOfString = new HashMap<>(); + + /** + * Gets or Sets inner + */ + public enum InnerEnum { + UPPER("UPPER"), + + LOWER("lower"); + + private final String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + @Valid + private Map mapOfEnumString = new HashMap<>(); + + @Valid + private Map directMap = new HashMap<>(); + + @Valid + private Map indirectMap = new HashMap<>(); + + public MapTestDto mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTestDto putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * @return mapMapOfString + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map_map_of_string") + public Map> getMapMapOfString() { + return mapMapOfString; + } + + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTestDto mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTestDto putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * @return mapOfEnumString + */ + + @ApiModelProperty(value = "") + @JsonProperty("map_of_enum_string") + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTestDto directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTestDto putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * @return directMap + */ + + @ApiModelProperty(value = "") + @JsonProperty("direct_map") + public Map getDirectMap() { + return directMap; + } + + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTestDto indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTestDto putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * @return indirectMap + */ + + @ApiModelProperty(value = "") + @JsonProperty("indirect_map") + public Map getIndirectMap() { + return indirectMap; + } + + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MapTestDto mapTest = (MapTestDto) o; + return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && + Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && + Objects.equals(this.directMap, mapTest.directMap) && + Objects.equals(this.indirectMap, mapTest.indirectMap); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MapTestDto {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java new file mode 100644 index 000000000000..1467b18d60e2 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -0,0 +1,151 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import org.openapitools.model.AnimalDto; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * MixedPropertiesAndAdditionalPropertiesClassDto + */ + +@JsonTypeName("MixedPropertiesAndAdditionalPropertiesClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class MixedPropertiesAndAdditionalPropertiesClassDto { + + private @Nullable UUID uuid; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime dateTime; + + @Valid + private Map map = new HashMap<>(); + + public MixedPropertiesAndAdditionalPropertiesClassDto uuid(@Nullable UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("uuid") + public @Nullable UUID getUuid() { + return uuid; + } + + public void setUuid(@Nullable UUID uuid) { + this.uuid = uuid; + } + + public MixedPropertiesAndAdditionalPropertiesClassDto dateTime(@Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * @return dateTime + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("dateTime") + public @Nullable OffsetDateTime getDateTime() { + return dateTime; + } + + public void setDateTime(@Nullable OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClassDto map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClassDto putMapItem(String key, AnimalDto mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); + } + this.map.put(key, mapItem); + return this; + } + + /** + * Get map + * @return map + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("map") + public Map getMap() { + return map; + } + + public void setMap(Map map) { + this.map = map; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MixedPropertiesAndAdditionalPropertiesClassDto mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClassDto) o; + return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && + Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && + Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClassDto {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/Model200ResponseDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/Model200ResponseDto.java new file mode 100644 index 000000000000..7e6465e9aa32 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/Model200ResponseDto.java @@ -0,0 +1,112 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model name starting with number + */ + +@ApiModel(description = "Model for testing model name starting with number") +@JsonTypeName("200_response") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class Model200ResponseDto { + + private @Nullable Integer name; + + private @Nullable String propertyClass; + + public Model200ResponseDto name(@Nullable Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public @Nullable Integer getName() { + return name; + } + + public void setName(@Nullable Integer name) { + this.name = name; + } + + public Model200ResponseDto propertyClass(@Nullable String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * @return propertyClass + */ + + @ApiModelProperty(value = "") + @JsonProperty("class") + public @Nullable String getPropertyClass() { + return propertyClass; + } + + public void setPropertyClass(@Nullable String propertyClass) { + this.propertyClass = propertyClass; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Model200ResponseDto _200Response = (Model200ResponseDto) o; + return Objects.equals(this.name, _200Response.name) && + Objects.equals(this.propertyClass, _200Response.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200ResponseDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java new file mode 100644 index 000000000000..4b4000690c69 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NameDto.java @@ -0,0 +1,171 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing model name same as property name + */ + +@ApiModel(description = "Model for testing model name same as property name") +@JsonTypeName("Name") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class NameDto { + + private Integer name; + + private @Nullable Integer snakeCase; + + private @Nullable String property; + + private @Nullable Integer _123Number; + + public NameDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public NameDto(Integer name) { + this.name = name; + } + + public NameDto name(Integer name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("name") + public Integer getName() { + return name; + } + + public void setName(Integer name) { + this.name = name; + } + + public NameDto snakeCase(@Nullable Integer snakeCase) { + this.snakeCase = snakeCase; + return this; + } + + /** + * Get snakeCase + * @return snakeCase + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("snake_case") + public @Nullable Integer getSnakeCase() { + return snakeCase; + } + + public void setSnakeCase(@Nullable Integer snakeCase) { + this.snakeCase = snakeCase; + } + + public NameDto property(@Nullable String property) { + this.property = property; + return this; + } + + /** + * Get property + * @return property + */ + + @ApiModelProperty(value = "") + @JsonProperty("property") + public @Nullable String getProperty() { + return property; + } + + public void setProperty(@Nullable String property) { + this.property = property; + } + + public NameDto _123Number(@Nullable Integer _123Number) { + this._123Number = _123Number; + return this; + } + + /** + * Get _123Number + * @return _123Number + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("123Number") + public @Nullable Integer get123Number() { + return _123Number; + } + + public void set123Number(@Nullable Integer _123Number) { + this._123Number = _123Number; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NameDto name = (NameDto) o; + return Objects.equals(this.name, name.name) && + Objects.equals(this.snakeCase, name.snakeCase) && + Objects.equals(this.property, name.property) && + Objects.equals(this._123Number, name._123Number); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123Number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NameDto {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java new file mode 100644 index 000000000000..44e9f0f6bd23 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NullableClassDto.java @@ -0,0 +1,473 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * NullableClassDto + */ + +@JsonTypeName("NullableClass") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class NullableClassDto { + + private JsonNullable integerProp = JsonNullable.undefined(); + + private JsonNullable numberProp = JsonNullable.undefined(); + + private JsonNullable booleanProp = JsonNullable.undefined(); + + private JsonNullable stringProp = JsonNullable.undefined(); + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) + private JsonNullable dateProp = JsonNullable.undefined(); + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private JsonNullable datetimeProp = JsonNullable.undefined(); + + @Valid + private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); + + @Valid + private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); + + @Valid + private List arrayItemsNullable = new ArrayList<>(); + + @Valid + private JsonNullable> objectNullableProp = JsonNullable.>undefined(); + + @Valid + private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); + + @Valid + private Map objectItemsNullable = new HashMap<>(); + + public NullableClassDto integerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + return this; + } + + /** + * Get integerProp + * @return integerProp + */ + + @ApiModelProperty(value = "") + @JsonProperty("integer_prop") + public JsonNullable getIntegerProp() { + return integerProp; + } + + public void setIntegerProp(JsonNullable integerProp) { + this.integerProp = integerProp; + } + + public NullableClassDto numberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + return this; + } + + /** + * Get numberProp + * @return numberProp + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("number_prop") + public JsonNullable getNumberProp() { + return numberProp; + } + + public void setNumberProp(JsonNullable numberProp) { + this.numberProp = numberProp; + } + + public NullableClassDto booleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + return this; + } + + /** + * Get booleanProp + * @return booleanProp + */ + + @ApiModelProperty(value = "") + @JsonProperty("boolean_prop") + public JsonNullable getBooleanProp() { + return booleanProp; + } + + public void setBooleanProp(JsonNullable booleanProp) { + this.booleanProp = booleanProp; + } + + public NullableClassDto stringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + return this; + } + + /** + * Get stringProp + * @return stringProp + */ + + @ApiModelProperty(value = "") + @JsonProperty("string_prop") + public JsonNullable getStringProp() { + return stringProp; + } + + public void setStringProp(JsonNullable stringProp) { + this.stringProp = stringProp; + } + + public NullableClassDto dateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + return this; + } + + /** + * Get dateProp + * @return dateProp + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("date_prop") + public JsonNullable getDateProp() { + return dateProp; + } + + public void setDateProp(JsonNullable dateProp) { + this.dateProp = dateProp; + } + + public NullableClassDto datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + return this; + } + + /** + * Get datetimeProp + * @return datetimeProp + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("datetime_prop") + public JsonNullable getDatetimeProp() { + return datetimeProp; + } + + public void setDatetimeProp(JsonNullable datetimeProp) { + this.datetimeProp = datetimeProp; + } + + public NullableClassDto arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.of(arrayNullableProp); + return this; + } + + public NullableClassDto addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) { + this.arrayNullableProp = JsonNullable.of(new ArrayList<>()); + } + this.arrayNullableProp.get().add(arrayNullablePropItem); + return this; + } + + /** + * Get arrayNullableProp + * @return arrayNullableProp + */ + + @ApiModelProperty(value = "") + @JsonProperty("array_nullable_prop") + public JsonNullable> getArrayNullableProp() { + return arrayNullableProp; + } + + public void setArrayNullableProp(JsonNullable> arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClassDto arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.of(arrayAndItemsNullableProp); + return this; + } + + public NullableClassDto addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) { + this.arrayAndItemsNullableProp = JsonNullable.of(new ArrayList<>()); + } + this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem); + return this; + } + + /** + * Get arrayAndItemsNullableProp + * @return arrayAndItemsNullableProp + */ + + @ApiModelProperty(value = "") + @JsonProperty("array_and_items_nullable_prop") + public JsonNullable> getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + public void setArrayAndItemsNullableProp(JsonNullable> arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClassDto arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClassDto addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get arrayItemsNullable + * @return arrayItemsNullable + */ + + @ApiModelProperty(value = "") + @JsonProperty("array_items_nullable") + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClassDto objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.of(objectNullableProp); + return this; + } + + public NullableClassDto putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) { + this.objectNullableProp = JsonNullable.of(new HashMap<>()); + } + this.objectNullableProp.get().put(key, objectNullablePropItem); + return this; + } + + /** + * Get objectNullableProp + * @return objectNullableProp + */ + + @ApiModelProperty(value = "") + @JsonProperty("object_nullable_prop") + public JsonNullable> getObjectNullableProp() { + return objectNullableProp; + } + + public void setObjectNullableProp(JsonNullable> objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClassDto objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = JsonNullable.of(objectAndItemsNullableProp); + return this; + } + + public NullableClassDto putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) { + this.objectAndItemsNullableProp = JsonNullable.of(new HashMap<>()); + } + this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem); + return this; + } + + /** + * Get objectAndItemsNullableProp + * @return objectAndItemsNullableProp + */ + + @ApiModelProperty(value = "") + @JsonProperty("object_and_items_nullable_prop") + public JsonNullable> getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + public void setObjectAndItemsNullableProp(JsonNullable> objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClassDto objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + public NullableClassDto putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + /** + * Get objectItemsNullable + * @return objectItemsNullable + */ + + @ApiModelProperty(value = "") + @JsonProperty("object_items_nullable") + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public NullableClassDto putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClassDto nullableClass = (NullableClassDto) o; + return equalsNullable(this.integerProp, nullableClass.integerProp) && + equalsNullable(this.numberProp, nullableClass.numberProp) && + equalsNullable(this.booleanProp, nullableClass.booleanProp) && + equalsNullable(this.stringProp, nullableClass.stringProp) && + equalsNullable(this.dateProp, nullableClass.dateProp) && + equalsNullable(this.datetimeProp, nullableClass.datetimeProp) && + equalsNullable(this.arrayNullableProp, nullableClass.arrayNullableProp) && + equalsNullable(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && + equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + Objects.equals(this.additionalProperties, nullableClass.additionalProperties); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClassDto {\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NumberOnlyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NumberOnlyDto.java new file mode 100644 index 000000000000..5b28a5d15990 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/NumberOnlyDto.java @@ -0,0 +1,88 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * NumberOnlyDto + */ + +@JsonTypeName("NumberOnly") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class NumberOnlyDto { + + private @Nullable BigDecimal justNumber; + + public NumberOnlyDto justNumber(@Nullable BigDecimal justNumber) { + this.justNumber = justNumber; + return this; + } + + /** + * Get justNumber + * @return justNumber + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("JustNumber") + public @Nullable BigDecimal getJustNumber() { + return justNumber; + } + + public void setJustNumber(@Nullable BigDecimal justNumber) { + this.justNumber = justNumber; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NumberOnlyDto numberOnly = (NumberOnlyDto) o; + return Objects.equals(this.justNumber, numberOnly.justNumber); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnlyDto {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java new file mode 100644 index 000000000000..bab5e5c8374c --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ObjectWithDeprecatedFieldsDto.java @@ -0,0 +1,194 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.DeprecatedObjectDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ObjectWithDeprecatedFieldsDto + */ + +@JsonTypeName("ObjectWithDeprecatedFields") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ObjectWithDeprecatedFieldsDto { + + private @Nullable String uuid; + + @Deprecated + private @Nullable BigDecimal id; + + @Deprecated + private @Nullable DeprecatedObjectDto deprecatedRef; + + @Deprecated + @Valid + private List bars = new ArrayList<>(); + + public ObjectWithDeprecatedFieldsDto uuid(@Nullable String uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * @return uuid + */ + + @ApiModelProperty(value = "") + @JsonProperty("uuid") + public @Nullable String getUuid() { + return uuid; + } + + public void setUuid(@Nullable String uuid) { + this.uuid = uuid; + } + + public ObjectWithDeprecatedFieldsDto id(@Nullable BigDecimal id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + * @deprecated + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("id") + @Deprecated + public @Nullable BigDecimal getId() { + return id; + } + + /** + * @deprecated + */ + @Deprecated + public void setId(@Nullable BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFieldsDto deprecatedRef(@Nullable DeprecatedObjectDto deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get deprecatedRef + * @return deprecatedRef + * @deprecated + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("deprecatedRef") + @Deprecated + public @Nullable DeprecatedObjectDto getDeprecatedRef() { + return deprecatedRef; + } + + /** + * @deprecated + */ + @Deprecated + public void setDeprecatedRef(@Nullable DeprecatedObjectDto deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFieldsDto bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFieldsDto addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + this.bars.add(barsItem); + return this; + } + + /** + * Get bars + * @return bars + * @deprecated + */ + + @ApiModelProperty(value = "") + @JsonProperty("bars") + @Deprecated + public List getBars() { + return bars; + } + + /** + * @deprecated + */ + @Deprecated + public void setBars(List bars) { + this.bars = bars; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFieldsDto objectWithDeprecatedFields = (ObjectWithDeprecatedFieldsDto) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFieldsDto {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OrderDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OrderDto.java new file mode 100644 index 000000000000..7aa174abf7cf --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OrderDto.java @@ -0,0 +1,248 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.time.OffsetDateTime; +import org.springframework.format.annotation.DateTimeFormat; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * OrderDto + */ + +@JsonTypeName("Order") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class OrderDto { + + private @Nullable Long id; + + private @Nullable Long petId; + + private @Nullable Integer quantity; + + @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) + private @Nullable OffsetDateTime shipDate; + + /** + * Order Status + */ + public enum StatusEnum { + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private final String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable StatusEnum status; + + private Boolean complete = false; + + public OrderDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public OrderDto petId(@Nullable Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * @return petId + */ + + @ApiModelProperty(value = "") + @JsonProperty("petId") + public @Nullable Long getPetId() { + return petId; + } + + public void setPetId(@Nullable Long petId) { + this.petId = petId; + } + + public OrderDto quantity(@Nullable Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * @return quantity + */ + + @ApiModelProperty(value = "") + @JsonProperty("quantity") + public @Nullable Integer getQuantity() { + return quantity; + } + + public void setQuantity(@Nullable Integer quantity) { + this.quantity = quantity; + } + + public OrderDto shipDate(@Nullable OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * @return shipDate + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("shipDate") + public @Nullable OffsetDateTime getShipDate() { + return shipDate; + } + + public void setShipDate(@Nullable OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public OrderDto status(@Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * @return status + */ + + @ApiModelProperty(value = "Order Status") + @JsonProperty("status") + public @Nullable StatusEnum getStatus() { + return status; + } + + public void setStatus(@Nullable StatusEnum status) { + this.status = status; + } + + public OrderDto complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * @return complete + */ + + @ApiModelProperty(value = "") + @JsonProperty("complete") + public Boolean getComplete() { + return complete; + } + + public void setComplete(Boolean complete) { + this.complete = complete; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrderDto order = (OrderDto) o; + return Objects.equals(this.id, order.id) && + Objects.equals(this.petId, order.petId) && + Objects.equals(this.quantity, order.quantity) && + Objects.equals(this.shipDate, order.shipDate) && + Objects.equals(this.status, order.status) && + Objects.equals(this.complete, order.complete); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrderDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterCompositeDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterCompositeDto.java new file mode 100644 index 000000000000..513ea57ace27 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterCompositeDto.java @@ -0,0 +1,136 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * OuterCompositeDto + */ + +@JsonTypeName("OuterComposite") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class OuterCompositeDto { + + private @Nullable BigDecimal myNumber; + + private @Nullable String myString; + + private @Nullable Boolean myBoolean; + + public OuterCompositeDto myNumber(@Nullable BigDecimal myNumber) { + this.myNumber = myNumber; + return this; + } + + /** + * Get myNumber + * @return myNumber + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("my_number") + public @Nullable BigDecimal getMyNumber() { + return myNumber; + } + + public void setMyNumber(@Nullable BigDecimal myNumber) { + this.myNumber = myNumber; + } + + public OuterCompositeDto myString(@Nullable String myString) { + this.myString = myString; + return this; + } + + /** + * Get myString + * @return myString + */ + + @ApiModelProperty(value = "") + @JsonProperty("my_string") + public @Nullable String getMyString() { + return myString; + } + + public void setMyString(@Nullable String myString) { + this.myString = myString; + } + + public OuterCompositeDto myBoolean(@Nullable Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * @return myBoolean + */ + + @ApiModelProperty(value = "") + @JsonProperty("my_boolean") + public @Nullable Boolean getMyBoolean() { + return myBoolean; + } + + public void setMyBoolean(@Nullable Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterCompositeDto outerComposite = (OuterCompositeDto) o; + return Objects.equals(this.myNumber, outerComposite.myNumber) && + Objects.equals(this.myString, outerComposite.myString) && + Objects.equals(this.myBoolean, outerComposite.myBoolean); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterCompositeDto {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDefaultValueDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDefaultValueDto.java new file mode 100644 index 000000000000..7ec6b4495ac6 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDefaultValueDto.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public enum OuterEnumDefaultValueDto { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private final String value; + + OuterEnumDefaultValueDto(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValueDto fromValue(String value) { + for (OuterEnumDefaultValueDto b : OuterEnumDefaultValueDto.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDto.java new file mode 100644 index 000000000000..55c44cd4439e --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumDto.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnum + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public enum OuterEnumDto { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private final String value; + + OuterEnumDto(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDto fromValue(String value) { + for (OuterEnumDto b : OuterEnumDto.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDefaultValueDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDefaultValueDto.java new file mode 100644 index 000000000000..9df945356cfa --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDefaultValueDto.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public enum OuterEnumIntegerDefaultValueDto { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private final Integer value; + + OuterEnumIntegerDefaultValueDto(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValueDto fromValue(Integer value) { + for (OuterEnumIntegerDefaultValueDto b : OuterEnumIntegerDefaultValueDto.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDto.java new file mode 100644 index 000000000000..a12c716609b1 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterEnumIntegerDto.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public enum OuterEnumIntegerDto { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private final Integer value; + + OuterEnumIntegerDto(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDto fromValue(Integer value) { + for (OuterEnumIntegerDto b : OuterEnumIntegerDto.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java new file mode 100644 index 000000000000..193ae403bbbd --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/OuterObjectWithEnumPropertyDto.java @@ -0,0 +1,100 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.OuterEnumIntegerDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * OuterObjectWithEnumPropertyDto + */ + +@JsonTypeName("OuterObjectWithEnumProperty") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class OuterObjectWithEnumPropertyDto { + + private OuterEnumIntegerDto value; + + public OuterObjectWithEnumPropertyDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public OuterObjectWithEnumPropertyDto(OuterEnumIntegerDto value) { + this.value = value; + } + + public OuterObjectWithEnumPropertyDto value(OuterEnumIntegerDto value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @NotNull @Valid + @ApiModelProperty(required = true, value = "") + @JsonProperty("value") + public OuterEnumIntegerDto getValue() { + return value; + } + + public void setValue(OuterEnumIntegerDto value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterObjectWithEnumPropertyDto outerObjectWithEnumProperty = (OuterObjectWithEnumPropertyDto) o; + return Objects.equals(this.value, outerObjectWithEnumProperty.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumPropertyDto {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java new file mode 100644 index 000000000000..5828fb56ac64 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ParentWithNullableDto.java @@ -0,0 +1,170 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; +import org.springframework.lang.Nullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ParentWithNullableDto + */ + +@JsonIgnoreProperties( + value = "type", // ignore manually set type, it will be automatically generated by Jackson during serialization + allowSetters = true // allows the type to be set during deserialization +) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildWithNullableDto.class, name = "ChildWithNullable") +}) + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ParentWithNullableDto { + + /** + * Gets or Sets type + */ + public enum TypeEnum { + CHILD_WITH_NULLABLE("ChildWithNullable"); + + private final String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable TypeEnum type; + + private JsonNullable nullableProperty = JsonNullable.undefined(); + + public ParentWithNullableDto type(@Nullable TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + + @ApiModelProperty(value = "") + @JsonProperty("type") + public @Nullable TypeEnum getType() { + return type; + } + + public void setType(@Nullable TypeEnum type) { + this.type = type; + } + + public ParentWithNullableDto nullableProperty(String nullableProperty) { + this.nullableProperty = JsonNullable.of(nullableProperty); + return this; + } + + /** + * Get nullableProperty + * @return nullableProperty + */ + + @ApiModelProperty(value = "") + @JsonProperty("nullableProperty") + public JsonNullable getNullableProperty() { + return nullableProperty; + } + + public void setNullableProperty(JsonNullable nullableProperty) { + this.nullableProperty = nullableProperty; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullableDto parentWithNullable = (ParentWithNullableDto) o; + return Objects.equals(this.type, parentWithNullable.type) && + equalsNullable(this.nullableProperty, parentWithNullable.nullableProperty); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(type, hashCodeNullable(nullableProperty)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullableDto {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java new file mode 100644 index 000000000000..dddd44e75b42 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/PetDto.java @@ -0,0 +1,284 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.openapitools.model.CategoryDto; +import org.openapitools.model.TagDto; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * PetDto + */ + +@JsonTypeName("Pet") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class PetDto { + + private @Nullable Long id; + + private @Nullable CategoryDto category; + + private String name; + + @Valid + private Set photoUrls = new LinkedHashSet<>(); + + @Valid + private List<@Valid TagDto> tags = new ArrayList<>(); + + /** + * pet status in the store + */ + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private final String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + private @Nullable StatusEnum status; + + public PetDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public PetDto(String name, Set photoUrls) { + this.name = name; + this.photoUrls = photoUrls; + } + + public PetDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public PetDto category(@Nullable CategoryDto category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("category") + public @Nullable CategoryDto getCategory() { + return category; + } + + public void setCategory(@Nullable CategoryDto category) { + this.category = category; + } + + public PetDto name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @NotNull + @ApiModelProperty(example = "doggie", required = true, value = "") + @JsonProperty("name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public PetDto photoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public PetDto addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + */ + @NotNull + @ApiModelProperty(required = true, value = "") + @JsonProperty("photoUrls") + public Set getPhotoUrls() { + return photoUrls; + } + + @JsonDeserialize(as = LinkedHashSet.class) + public void setPhotoUrls(Set photoUrls) { + this.photoUrls = photoUrls; + } + + public PetDto tags(List<@Valid TagDto> tags) { + this.tags = tags; + return this; + } + + public PetDto addTagsItem(TagDto tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + */ + @Valid + @ApiModelProperty(value = "") + @JsonProperty("tags") + public List<@Valid TagDto> getTags() { + return tags; + } + + public void setTags(List<@Valid TagDto> tags) { + this.tags = tags; + } + + public PetDto status(@Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + */ + + @ApiModelProperty(value = "pet status in the store") + @JsonProperty("status") + public @Nullable StatusEnum getStatus() { + return status; + } + + public void setStatus(@Nullable StatusEnum status) { + this.status = status; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PetDto pet = (PetDto) o; + return Objects.equals(this.id, pet.id) && + Objects.equals(this.category, pet.category) && + Objects.equals(this.name, pet.name) && + Objects.equals(this.photoUrls, pet.photoUrls) && + Objects.equals(this.tags, pet.tags) && + Objects.equals(this.status, pet.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PetDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java new file mode 100644 index 000000000000..25d85abc18ab --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReadOnlyFirstDto.java @@ -0,0 +1,111 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ReadOnlyFirstDto + */ + +@JsonTypeName("ReadOnlyFirst") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ReadOnlyFirstDto { + + private @Nullable String bar; + + private @Nullable String baz; + + public ReadOnlyFirstDto bar(@Nullable String bar) { + this.bar = bar; + return this; + } + + /** + * Get bar + * @return bar + */ + + @ApiModelProperty(readOnly = true, value = "") + @JsonProperty("bar") + public @Nullable String getBar() { + return bar; + } + + public void setBar(@Nullable String bar) { + this.bar = bar; + } + + public ReadOnlyFirstDto baz(@Nullable String baz) { + this.baz = baz; + return this; + } + + /** + * Get baz + * @return baz + */ + + @ApiModelProperty(value = "") + @JsonProperty("baz") + public @Nullable String getBaz() { + return baz; + } + + public void setBaz(@Nullable String baz) { + this.baz = baz; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReadOnlyFirstDto readOnlyFirst = (ReadOnlyFirstDto) o; + return Objects.equals(this.bar, readOnlyFirst.bar) && + Objects.equals(this.baz, readOnlyFirst.baz); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirstDto {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReturnDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReturnDto.java new file mode 100644 index 000000000000..6755a2fe8eba --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/ReturnDto.java @@ -0,0 +1,88 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * Model for testing reserved words + */ + +@ApiModel(description = "Model for testing reserved words") +@JsonTypeName("Return") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class ReturnDto { + + private @Nullable Integer _return; + + public ReturnDto _return(@Nullable Integer _return) { + this._return = _return; + return this; + } + + /** + * Get _return + * @return _return + */ + + @ApiModelProperty(value = "") + @JsonProperty("return") + public @Nullable Integer getReturn() { + return _return; + } + + public void setReturn(@Nullable Integer _return) { + this._return = _return; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReturnDto _return = (ReturnDto) o; + return Objects.equals(this._return, _return._return); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReturnDto {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SingleRefTypeDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SingleRefTypeDto.java new file mode 100644 index 000000000000..ab029d8fc0cd --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SingleRefTypeDto.java @@ -0,0 +1,55 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonValue; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public enum SingleRefTypeDto { + + ADMIN("admin"), + + USER("user"); + + private final String value; + + SingleRefTypeDto(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefTypeDto fromValue(String value) { + for (SingleRefTypeDto b : SingleRefTypeDto.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SpecialModelNameDto.java new file mode 100644 index 000000000000..c1bb7d0954e8 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -0,0 +1,87 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * SpecialModelNameDto + */ + +@JsonTypeName("_special_model.name_") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class SpecialModelNameDto { + + private @Nullable Long $SpecialPropertyName; + + public SpecialModelNameDto $SpecialPropertyName(@Nullable Long $SpecialPropertyName) { + this.$SpecialPropertyName = $SpecialPropertyName; + return this; + } + + /** + * Get $SpecialPropertyName + * @return $SpecialPropertyName + */ + + @ApiModelProperty(value = "") + @JsonProperty("$special[property.name]") + public @Nullable Long get$SpecialPropertyName() { + return $SpecialPropertyName; + } + + public void set$SpecialPropertyName(@Nullable Long $SpecialPropertyName) { + this.$SpecialPropertyName = $SpecialPropertyName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SpecialModelNameDto specialModelName = (SpecialModelNameDto) o; + return Objects.equals(this.$SpecialPropertyName, specialModelName.$SpecialPropertyName); + } + + @Override + public int hashCode() { + return Objects.hash($SpecialPropertyName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelNameDto {\n"); + sb.append(" $SpecialPropertyName: ").append(toIndentedString($SpecialPropertyName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TagDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TagDto.java new file mode 100644 index 000000000000..b9b325383164 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TagDto.java @@ -0,0 +1,111 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * TagDto + */ + +@JsonTypeName("Tag") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class TagDto { + + private @Nullable Long id; + + private @Nullable String name; + + public TagDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public TagDto name(@Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + + @ApiModelProperty(value = "") + @JsonProperty("name") + public @Nullable String getName() { + return name; + } + + public void setName(@Nullable String name) { + this.name = name; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TagDto tag = (TagDto) o; + return Objects.equals(this.id, tag.id) && + Objects.equals(this.name, tag.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TagDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequestDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequestDto.java new file mode 100644 index 000000000000..04bdad9db8e7 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequestDto.java @@ -0,0 +1,131 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +/** + * TestInlineFreeformAdditionalPropertiesRequestDto + */ + +@JsonTypeName("testInlineFreeformAdditionalProperties_request") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class TestInlineFreeformAdditionalPropertiesRequestDto { + + private @Nullable String someProperty; + + public TestInlineFreeformAdditionalPropertiesRequestDto someProperty(@Nullable String someProperty) { + this.someProperty = someProperty; + return this; + } + + /** + * Get someProperty + * @return someProperty + */ + + @ApiModelProperty(value = "") + @JsonProperty("someProperty") + public @Nullable String getSomeProperty() { + return someProperty; + } + + public void setSomeProperty(@Nullable String someProperty) { + this.someProperty = someProperty; + } + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + */ + @JsonAnySetter + public TestInlineFreeformAdditionalPropertiesRequestDto putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TestInlineFreeformAdditionalPropertiesRequestDto testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequestDto) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && + Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(someProperty, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TestInlineFreeformAdditionalPropertiesRequestDto {\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); + + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/UserDto.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/UserDto.java new file mode 100644 index 000000000000..02362e76fc3b --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/model/UserDto.java @@ -0,0 +1,255 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * UserDto + */ + +@JsonTypeName("User") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class UserDto { + + private @Nullable Long id; + + private @Nullable String username; + + private @Nullable String firstName; + + private @Nullable String lastName; + + private @Nullable String email; + + private @Nullable String password; + + private @Nullable String phone; + + private @Nullable Integer userStatus; + + public UserDto id(@Nullable Long id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + + @ApiModelProperty(value = "") + @JsonProperty("id") + public @Nullable Long getId() { + return id; + } + + public void setId(@Nullable Long id) { + this.id = id; + } + + public UserDto username(@Nullable String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + + @ApiModelProperty(value = "") + @JsonProperty("username") + public @Nullable String getUsername() { + return username; + } + + public void setUsername(@Nullable String username) { + this.username = username; + } + + public UserDto firstName(@Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + + @ApiModelProperty(value = "") + @JsonProperty("firstName") + public @Nullable String getFirstName() { + return firstName; + } + + public void setFirstName(@Nullable String firstName) { + this.firstName = firstName; + } + + public UserDto lastName(@Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + + @ApiModelProperty(value = "") + @JsonProperty("lastName") + public @Nullable String getLastName() { + return lastName; + } + + public void setLastName(@Nullable String lastName) { + this.lastName = lastName; + } + + public UserDto email(@Nullable String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + + @ApiModelProperty(value = "") + @JsonProperty("email") + public @Nullable String getEmail() { + return email; + } + + public void setEmail(@Nullable String email) { + this.email = email; + } + + public UserDto password(@Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + + @ApiModelProperty(value = "") + @JsonProperty("password") + public @Nullable String getPassword() { + return password; + } + + public void setPassword(@Nullable String password) { + this.password = password; + } + + public UserDto phone(@Nullable String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * @return phone + */ + + @ApiModelProperty(value = "") + @JsonProperty("phone") + public @Nullable String getPhone() { + return phone; + } + + public void setPhone(@Nullable String phone) { + this.phone = phone; + } + + public UserDto userStatus(@Nullable Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * @return userStatus + */ + + @ApiModelProperty(value = "User Status") + @JsonProperty("userStatus") + public @Nullable Integer getUserStatus() { + return userStatus; + } + + public void setUserStatus(@Nullable Integer userStatus) { + this.userStatus = userStatus; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserDto user = (UserDto) o; + return Objects.equals(this.id, user.id) && + Objects.equals(this.username, user.username) && + Objects.equals(this.firstName, user.firstName) && + Objects.equals(this.lastName, user.lastName) && + Objects.equals(this.email, user.email) && + Objects.equals(this.password, user.password) && + Objects.equals(this.phone, user.phone) && + Objects.equals(this.userStatus, user.userStatus); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserDto {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/resources/application.properties b/samples/server/petstore/springboot-x-implements-skip/src/main/resources/application.properties new file mode 100644 index 000000000000..9d06609db665 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/resources/application.properties @@ -0,0 +1,3 @@ +server.port=80 +spring.jackson.date-format=org.openapitools.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-x-implements-skip/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..279b8e9cc6df --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/resources/openapi.yaml @@ -0,0 +1,2443 @@ +openapi: 3.0.0 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_varaible +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: "#/components/schemas/_foo_get_default_response" + description: response + x-accepts: + - application/json + /pet: + post: + description: "" + operationId: addPet + requestBody: + $ref: "#/components/requestBodies/Pet" + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: pet + put: + description: "" + operationId: updatePet + requestBody: + $ref: "#/components/requestBodies/Pet" + responses: + "200": + description: Successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + "405": + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-webclient-blocking: true + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + - description: test server with variables + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + description: target server + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - deprecated: true + description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + application/json: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + description: successful operation + "400": + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: "#/components/schemas/Pet" + type: array + uniqueItems: true + description: successful operation + "400": + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + x-tags: + - tag: pet + /pet/{petId}: + delete: + description: "" + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + description: Successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: + - application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Pet" + application/json: + schema: + $ref: "#/components/schemas/Pet" + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-webclient-blocking: true + x-accepts: + - application/json + - application/xml + x-tags: + - tag: pet + post: + description: "" + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/updatePetWithForm_request" + responses: + "200": + description: Successful operation + "405": + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + description: "" + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/uploadFile_request" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-webclient-blocking: false + x-accepts: + - application/json + x-tags: + - tag: store + /store/order: + post: + description: "" + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/Order" + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + description: successful operation + "400": + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-content-type: application/json + x-accepts: + - application/json + - application/xml + x-tags: + - tag: store + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: + - application/json + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/Order" + application/json: + schema: + $ref: "#/components/schemas/Order" + description: successful operation + "400": + description: Invalid ID supplied + "404": + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: + - application/json + - application/xml + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /user/createWithArray: + post: + description: "" + operationId: createUsersWithArrayInput + requestBody: + $ref: "#/components/requestBodies/UserArray" + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /user/createWithList: + post: + description: "" + operationId: createUsersWithListInput + requestBody: + $ref: "#/components/requestBodies/UserArray" + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /user/login: + get: + description: "" + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + "400": + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: + - application/json + - application/xml + x-tags: + - tag: user + /user/logout: + get: + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: + - application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Delete user + tags: + - user + x-accepts: + - application/json + x-tags: + - tag: user + get: + description: "" + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/xml: + schema: + $ref: "#/components/schemas/User" + application/json: + schema: + $ref: "#/components/schemas/User" + description: successful operation + "400": + description: Invalid username supplied + "404": + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: + - application/json + - application/xml + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + description: Updated user object + required: true + responses: + "400": + description: Invalid user supplied + "404": + description: User not found + summary: Updated user + tags: + - user + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake_classname_tags 123#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + "400": + description: Something wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: + - application/json + x-tags: + - tag: fake + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + - explode: true + in: query + name: enum_query_model_array + required: false + schema: + items: + $ref: "#/components/schemas/EnumClass" + type: array + style: form + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testEnumParameters_request" + responses: + "400": + description: Invalid request + "404": + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + summary: To test "client" model + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testEndpointParameters_request" + responses: + "400": + description: Invalid username supplied + "404": + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterNumber" + description: Input number as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterNumber" + description: Output number + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/property/enum-int: + post: + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterObjectWithEnumProperty" + description: Input enum (int) as post body + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterObjectWithEnumProperty" + description: Output enum (int) + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterString" + description: Input string as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterString" + description: Output string + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Input boolean as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterBoolean" + description: Output boolean + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/OuterComposite" + description: Input composite as post body + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/OuterComposite" + description: Output composite + tags: + - fake + x-content-type: application/json + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: "#/components/schemas/fakeBigDecimalMap_200_response" + description: successful operation + tags: + - fake + x-accepts: + - '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + description: "" + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/testJsonFormData_request" + responses: + "200": + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/FreeFormObject" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/MapOfString" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/inline-additionalProperties: + post: + description: "" + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/testInlineFreeformAdditionalProperties_request" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test inline free-form additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/nullable: + post: + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/ChildWithNullable" + description: request body + required: true + responses: + "200": + description: successful operation + summary: test nullable parent property + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/User" + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request must reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/FileSchemaTestClass" + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/body-with-binary: + put: + description: "For this test, the body has to be a binary file." + operationId: testBodyWithBinary + requestBody: + content: + image/png: + schema: + format: binary + nullable: true + type: string + description: image to upload + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: image/png + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: pipeDelimited + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: language + required: false + schema: + additionalProperties: + format: string + type: string + type: object + style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form + responses: + "200": + description: Success + tags: + - fake + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/{petId}/uploadImageWithRequiredFile: + post: + description: "" + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/uploadFileWithRequiredFile_request" + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/ApiResponse" + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: + - application/json + x-tags: + - tag: pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/HealthCheckResult" + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: "#/components/requestBodies/Pet" + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: "#/components/schemas/User" + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + application/xml: + schema: + $ref: "#/components/schemas/Pet" + description: Pet object that needs to be added to the store + required: true + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: "#/components/schemas/Category" + name: + example: doggie + type: string + photoUrls: + items: + type: string + xml: + name: photoUrl + type: array + uniqueItems: true + xml: + wrapped: true + tags: + items: + $ref: "#/components/schemas/Tag" + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: "#/components/schemas/Animal" + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: "#/components/schemas/Animal" + - properties: + declawed: + type: boolean + type: object + Animal: + discriminator: + mapping: + DOG: "#/components/schemas/Dog" + CAT: "#/components/schemas/Cat" + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + x-implements: + - com.custompackage.InterfaceToSkip + - com.custompackage.InterfaceToKeep + AnimalFarm: + items: + $ref: "#/components/schemas/Animal" + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + decimal: + format: number + type: string + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: "#/components/schemas/OuterEnum" + outerEnumInteger: + $ref: "#/components/schemas/OuterEnumInteger" + outerEnumDefaultValue: + $ref: "#/components/schemas/OuterEnumDefaultValue" + outerEnumIntegerDefaultValue: + $ref: "#/components/schemas/OuterEnumIntegerDefaultValue" + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: "#/components/schemas/Animal" + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + maxItems: 3 + minItems: 0 + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: "#/components/schemas/ReadOnlyFirst" + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: "#/components/schemas/ParentWithNullable" + - properties: + otherProperty: + type: string + type: object + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + properties: + file: + $ref: "#/components/schemas/File" + files: + items: + $ref: "#/components/schemas/File" + type: array + type: object + File: + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + OuterObjectWithEnumProperty: + example: + value: 2 + properties: + value: + $ref: "#/components/schemas/OuterEnumInteger" + required: + - value + type: object + DeprecatedObject: + deprecated: true + properties: + name: + type: string + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true + type: number + deprecatedRef: + $ref: "#/components/schemas/DeprecatedObject" + bars: + deprecated: true + items: + $ref: "#/components/schemas/Bar" + type: array + type: object + AllOfWithSingleRef: + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: "#/components/schemas/SingleRefType" + type: object + SingleRefType: + enum: + - admin + - user + title: SingleRefType + type: string + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: "#/components/schemas/Foo" + type: object + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/resources/static/swagger-ui.html b/samples/server/petstore/springboot-x-implements-skip/src/main/resources/static/swagger-ui.html new file mode 100644 index 000000000000..f85b6654f67d --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/resources/static/swagger-ui.html @@ -0,0 +1,60 @@ + + + + + + Swagger UI + + + + + + + +
+ + + + + + diff --git a/samples/server/petstore/springboot-x-implements-skip/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-x-implements-skip/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-x-implements-skip/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file From 1597304d469906bf6e23401cb52b033deb265770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 29 Jan 2026 09:44:08 +0100 Subject: [PATCH 09/21] add xKotlinImplementsSkip and xKotlinImplementsFieldsSkip additional properties --- ...otlin-spring-boot-x-kotlin-implements.yaml | 3 ++ .../languages/AbstractKotlinCodegen.java | 43 +++++++++++++++++-- .../petstore-with-x-kotlin-implements.yaml | 4 +- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml b/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml index f40ec19ea242..f5763ebfd70d 100644 --- a/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml +++ b/bin/configs/kotlin-spring-boot-x-kotlin-implements.yaml @@ -21,3 +21,6 @@ additionalProperties: Pet: id Category: [ name, id ] Dog: [ bark, breed ] + xKotlinImplementsSkip: [ com.some.pack.WithPhotoUrls ] + xKotlinImplementsFieldsSkip: + Pet: [ photoUrls ] \ No newline at end of file diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index 5450161e846c..e8b2647fcf6f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -58,6 +58,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co public static final String USE_JAKARTA_EE = "useJakartaEe"; public static final String SCHEMA_IMPLEMENTS = "schemaImplements"; public static final String SCHEMA_IMPLEMENTS_FIELDS = "schemaImplementsFields"; + public static final String X_KOTLIN_IMPLEMENTS_SKIP = "xKotlinImplementsSkip"; + public static final String X_KOTLIN_IMPLEMENTS_FIELDS_SKIP = "xKotlinImplementsFieldsSkip"; private final Logger LOGGER = LoggerFactory.getLogger(AbstractKotlinCodegen.class); @@ -96,6 +98,12 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co @Getter @Setter protected Map> schemaImplementsFields = new HashMap<>(); + @Getter + @Setter + protected List xKotlinImplementsSkip = new ArrayList<>(); + @Getter + @Setter + protected Map> xKotlinImplementsFieldsSkip = new HashMap<>(); public AbstractKotlinCodegen() { super(); @@ -529,6 +537,12 @@ public void processOpts() { if (additionalProperties.containsKey(SCHEMA_IMPLEMENTS_FIELDS)) { this.setSchemaImplementsFields(getPropertyAsStringListMap(SCHEMA_IMPLEMENTS_FIELDS)); } + if (additionalProperties.containsKey(X_KOTLIN_IMPLEMENTS_SKIP)) { + this.setXKotlinImplementsSkip(getPropertyAsStringList(X_KOTLIN_IMPLEMENTS_SKIP)); + } + if (additionalProperties.containsKey(X_KOTLIN_IMPLEMENTS_FIELDS_SKIP)) { + this.setXKotlinImplementsFieldsSkip(getPropertyAsStringListMap(X_KOTLIN_IMPLEMENTS_FIELDS_SKIP)); + } additionalProperties.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, getSortParamsByRequiredFlag()); additionalProperties.put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, getSortModelPropertiesByRequiredFlag()); @@ -857,27 +871,48 @@ public CodegenModel fromModel(String name, Schema schema) { List schemaImplementedInterfacesClasses = this.getSchemaImplements().getOrDefault(m.getSchemaName(), List.of()); List schemaImplementedInterfacesFields = this.getSchemaImplementsFields().getOrDefault(m.getSchemaName(), List.of()); List vendorExtensionImplementedInterfacesClasses = (List) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS.getName()); + List interfacesToSkip = this.getXKotlinImplementsSkip().stream() + .filter(vendorExtensionImplementedInterfacesClasses::contains) + .collect(Collectors.toList()); + if (!interfacesToSkip.isEmpty()) { + LOGGER.info("Interface(s) {} in model {} are skipped from being marked as implemented via additional property '{}'.", + interfacesToSkip, name, X_KOTLIN_IMPLEMENTS_SKIP); + } + List vendorExtensionImplementedInterfacesClassesFiltered = vendorExtensionImplementedInterfacesClasses.stream() + .filter(interfaceName -> !interfacesToSkip.contains(interfaceName)) + .collect(Collectors.toList()); List vendorExtensionImplementedInterfacesFields = Optional.ofNullable((List) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName())) .map(xKotlinImplementsFields -> { - if (vendorExtensionImplementedInterfacesClasses.isEmpty() && !xKotlinImplementsFields.isEmpty()) { + if (vendorExtensionImplementedInterfacesClassesFiltered.isEmpty() && !xKotlinImplementsFields.isEmpty()) { LOGGER.warn("Annotating {} with {} without {} is not supported. {} will be ignored.", name, VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName(), VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName()); } return xKotlinImplementsFields; }).orElse(List.of()); - List combinedImplementedInterfacesClasses = Stream.concat(vendorExtensionImplementedInterfacesClasses.stream(), schemaImplementedInterfacesClasses.stream()) + List fieldsToSkip = this.getXKotlinImplementsFieldsSkip().getOrDefault(m.getSchemaName(), List.of()) + .stream() + .filter(vendorExtensionImplementedInterfacesFields::contains) + .collect(Collectors.toList()); + if (!fieldsToSkip.isEmpty()) { + LOGGER.info("Field(s) {} in model {} are skipped from being marked as inherited via additional property '{}'.", + fieldsToSkip, name, X_KOTLIN_IMPLEMENTS_FIELDS_SKIP); + } + List vendorExtensionImplementedInterfacesFieldsFiltered = vendorExtensionImplementedInterfacesFields.stream() + .filter(interfaceName -> !fieldsToSkip.contains(interfaceName)) + .collect(Collectors.toList()); + List combinedImplementedInterfacesClasses = Stream.concat(vendorExtensionImplementedInterfacesClassesFiltered.stream(), schemaImplementedInterfacesClasses.stream()) .distinct() .sorted() .collect(Collectors.toList()); - List combinedImplementedInterfacesFields = Stream.concat(vendorExtensionImplementedInterfacesFields.stream(), schemaImplementedInterfacesFields.stream()) + List combinedImplementedInterfacesFields = Stream.concat(vendorExtensionImplementedInterfacesFieldsFiltered.stream(), schemaImplementedInterfacesFields.stream()) .distinct() .collect(Collectors.toList()); if (serializableModel && !combinedImplementedInterfacesClasses.contains("java.io.Serializable")) { combinedImplementedInterfacesClasses.add("java.io.Serializable"); } m.getVendorExtensions().replace(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), combinedImplementedInterfacesClasses); - LOGGER.info("Model {} implements interfaces: {}", name, combinedImplementedInterfacesClasses); + LOGGER.info("Model {} implements interface(s): {}", name, combinedImplementedInterfacesClasses); m.optionalVars = m.optionalVars.stream().distinct().collect(Collectors.toList()); // Update allVars/requiredVars/optionalVars with isInherited // Each of these lists contains elements that are similar, but they are all cloned diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml index b54ec0cd53ef..276e8595e33c 100644 --- a/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml @@ -509,8 +509,8 @@ components: mapping: Dog: '#/components/schemas/Dog' Cat: '#/components/schemas/Cat' - x-kotlin-implements: [ com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods ] - x-kotlin-implements-fields: [ name, category ] + x-kotlin-implements: [ com.some.pack.Named, com.some.pack.WithPhotoUrls, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods ] + x-kotlin-implements-fields: [ name, category, photoUrls ] required: - name - photoUrls From 86def9a6736b592d82e49be5170fd13ec941e80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 29 Jan 2026 10:01:20 +0100 Subject: [PATCH 10/21] add unit tests --- .../spring/KotlinSpringServerCodegenTest.java | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index 8310d4698143..78a6f938314b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -1040,6 +1040,40 @@ public void generateSerializableModelWithXimplements() throws Exception { ); } + @Test + public void generateSerializableModelWithXimplementsSkip() throws Exception { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, true); + codegen.additionalProperties().put(X_KOTLIN_IMPLEMENTS_SKIP, List.of("com.some.pack.Fetchable")); + codegen.additionalProperties().put(X_KOTLIN_IMPLEMENTS_FIELDS_SKIP, Map.of("Dog", List.of("likesFetch"))); + + ClientOptInput input = new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml")) + .config(codegen); + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + Path path = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Dog.kt"); + assertFileContains( + path, + "@get:JsonProperty(\"likesFetch\", required = true) val likesFetch: kotlin.Boolean,", + ") : Pet, java.io.Serializable {", + "private const val serialVersionUID: kotlin.Long = 1" + ); + } + @Test public void generateSerializableModelWithSchemaImplements() throws Exception { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); @@ -1093,7 +1127,7 @@ public void generateSerializableModelWithSchemaImplements() throws Exception { Path pet = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Pet.kt"); assertFileContains( pet, - "interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods, com.some.pack.WithId, java.io.Serializable {", + "interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods, com.some.pack.WithId, com.some.pack.WithPhotoUrls, java.io.Serializable {", "override val name: kotlin.String", "val photoUrls: kotlin.collections.List", "val petType: kotlin.String", @@ -1114,6 +1148,45 @@ public void generateSerializableModelWithSchemaImplements() throws Exception { ); } + @Test + public void generateSerializableModelWithXimplementsSkipAndSchemaImplements() throws Exception { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(CodegenConstants.SERIALIZABLE_MODEL, true); + //remove the old interface with likesFetch attribute here + codegen.additionalProperties().put(X_KOTLIN_IMPLEMENTS_SKIP, List.of("com.some.pack.Fetchable")); + codegen.additionalProperties().put(X_KOTLIN_IMPLEMENTS_FIELDS_SKIP, Map.of("Dog", List.of("likesFetch"))); + //and add a new one that again should mark likesFetch as override + codegen.additionalProperties().put(KotlinSpringServerCodegen.SCHEMA_IMPLEMENTS, Map.of("Dog", List.of("com.some.different.pack.MyOwnFetchable") + )); + codegen.additionalProperties().put(KotlinSpringServerCodegen.SCHEMA_IMPLEMENTS_FIELDS, Map.of("Dog", List.of("likesFetch"))); + + ClientOptInput input = new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/petstore-with-x-kotlin-implements.yaml")) + .config(codegen); + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "false"); + + generator.opts(input).generate(); + + Path path = Paths.get(outputPath + "/src/main/kotlin/org/openapitools/model/Dog.kt"); + assertFileContains( + path, + "@get:JsonProperty(\"likesFetch\", required = true) override val likesFetch: kotlin.Boolean,", + ") : Pet, com.some.different.pack.MyOwnFetchable, java.io.Serializable {", + "private const val serialVersionUID: kotlin.Long = 1" + ); + } + @Test public void generateHttpInterfaceReactiveWithReactorResponseEntity() throws Exception { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); From 0869730be9f7f423efa7997a1c43e21dd499338b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 29 Jan 2026 10:45:41 +0100 Subject: [PATCH 11/21] add documentation --- .../codegen/languages/KotlinSpringServerCodegen.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index 62404681c5cb..d25cc315cd95 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -247,6 +247,11 @@ public KotlinSpringServerCodegen() { addSwitch(USE_RESPONSE_ENTITY, "Whether (when false) to return actual type (e.g. List) and handle non-happy path responses via exceptions flow or (when true) return entire ResponseEntity (e.g. ResponseEntity>). If disabled, method are annotated using a @ResponseStatus annotation, which has the status of the first response declared in the Api definition", useResponseEntity); + addOption(X_KOTLIN_IMPLEMENTS_SKIP, "A list of fully qualified interfaces that should NOT be implemented despite their presence in vendor extension `x-kotlin-implements`", "empty array"); + addOption(X_KOTLIN_IMPLEMENTS_FIELDS_SKIP, "A list of fields per schema name that should NOT be created with `override` keyword despite their presence in vendor extension `x-kotlin-implements-fields` for the schema", "empty map of arrays by schema names"); + addOption(SCHEMA_IMPLEMENTS, "A list of interfaces per schema name that should be implemented (serves similar purpose as `x-kotlin-implements`, but is fully decoupled from the api spec)", "empty array"); + addOption(SCHEMA_IMPLEMENTS_FIELDS, "A list of fields per schema name that should be prepended with `override` (serves similar purpose as `x-kotlin-implements-fields`, but is fully decoupled from the api spec)", + "empty map of arrays by schema names"); supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application."); supportedLibraries.put(SPRING_CLOUD_LIBRARY, "Spring-Cloud-Feign client with Spring-Boot auto-configured settings."); From fdb48bf103a516c796018afc4d017274c62cc5f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 29 Jan 2026 11:50:12 +0100 Subject: [PATCH 12/21] commit changes and add missing interface --- .../src/main/kotlin/com/some/pack/WithPhotoUrls.kt | 5 +++++ .../src/main/kotlin/org/openapitools/model/Pet.kt | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/com/some/pack/WithPhotoUrls.kt diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/com/some/pack/WithPhotoUrls.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/com/some/pack/WithPhotoUrls.kt new file mode 100644 index 000000000000..3413b1b314ab --- /dev/null +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/com/some/pack/WithPhotoUrls.kt @@ -0,0 +1,5 @@ +package com.some.pack + +interface WithPhotoUrls { + val photoUrls: kotlin.collections.List +} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Pet.kt index 3f436436591e..b84896b73529 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/model/Pet.kt @@ -41,14 +41,14 @@ import io.swagger.annotations.ApiModelProperty JsonSubTypes.Type(value = Dog::class, name = "Dog") ) -interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods, java.io.Serializable { +interface Pet : com.some.pack.Named, com.some.pack.WithCategory, com.some.pack.WithDefaultMethods, com.some.pack.WithPhotoUrls, java.io.Serializable { @get:ApiModelProperty(example = "null", required = true, value = "") override val name: kotlin.String @get:ApiModelProperty(example = "null", required = true, value = "") - val photoUrls: kotlin.collections.List + override val photoUrls: kotlin.collections.List @get:ApiModelProperty(example = "null", required = true, value = "") From 02dbf12fc036380a309fc7a57be5436bbd703a0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 29 Jan 2026 13:37:43 +0100 Subject: [PATCH 13/21] add documentation --- docs/generators/java-camel.md | 2 ++ docs/generators/kotlin-spring.md | 4 ++++ docs/generators/spring.md | 2 ++ .../main/java/org/openapitools/codegen/CliOption.java | 4 ++++ .../codegen/languages/AbstractJavaCodegen.java | 1 - .../codegen/languages/KotlinSpringServerCodegen.java | 9 ++++----- .../openapitools/codegen/languages/SpringCodegen.java | 3 +++ 7 files changed, 19 insertions(+), 6 deletions(-) diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md index 1ad4a1fcd311..49a3c8114a40 100644 --- a/docs/generators/java-camel.md +++ b/docs/generators/java-camel.md @@ -86,6 +86,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |resourceFolder|resource folder for generated resources| |src/main/resources| |responseWrapper|wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, RxObservable, RxSingle or fully qualified type)| |null| |returnSuccessCode|Generated server returns 2xx code| |false| +|schemaImplements|Ability to supply interfaces per schema that should be implemented (serves similar purpose as vendor extension `x-implements`, but is fully decoupled from the api spec). Example: yaml `schemaImplements: {Pet: com.some.pack.WithId, Category: [com.some.pack.CategoryInterface], Dog: [com.some.pack.Canine, com.some.pack.OtherInterface]}` implements interfaces in schemas `Pet` (interface `com.some.pack.WithId`), `Category` (interface `com.some.pack.CategoryInterface`), `Dog`(interfaces `com.some.pack.Canine`, `com.some.pack.OtherInterface`)| |empty map| |scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| |scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| |scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| @@ -117,6 +118,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useTags|use tags for creating interface and controller classnames| |false| |virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| +|xImplementsSkip|Ability to choose interfaces that should NOT be implemented in the models despite their presence in vendor extension `x-implements`. Takes a list of fully qualified interface names. Example: yaml `xImplementsSkip: [com.some.pack.WithPhotoUrls]` skips implementing the interface `com.some.pack.WithPhotoUrls` in any schema| |empty list| ## SUPPORTED VENDOR EXTENSIONS diff --git a/docs/generators/kotlin-spring.md b/docs/generators/kotlin-spring.md index 9dfba5d3e6c8..ff4db4233c2d 100644 --- a/docs/generators/kotlin-spring.md +++ b/docs/generators/kotlin-spring.md @@ -43,6 +43,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |parcelizeModels|toggle "@Parcelize" for generated models| |null| |reactive|use coroutines for reactive behavior| |false| |requestMappingMode|Where to generate the class level @RequestMapping annotation.|
**api_interface**
Generate the @RequestMapping annotation on the generated Api Interface.
**controller**
Generate the @RequestMapping annotation on the generated Api Controller Implementation.
**none**
Do not add a class level @RequestMapping annotation.
|controller| +|schemaImplements|A map of single interface or a list of interfaces per schema name that should be implemented (serves similar purpose as `x-kotlin-implements`, but is fully decoupled from the api spec). Example: yaml `schemaImplements: {Pet: com.some.pack.WithId, Category: [com.some.pack.CategoryInterface], Dog: [com.some.pack.Canine, com.some.pack.OtherInterface]}` implements interfaces in schemas `Pet` (interface `com.some.pack.WithId`), `Category` (interface `com.some.pack.CategoryInterface`), `Dog`(interfaces `com.some.pack.Canine`, `com.some.pack.OtherInterface`)| |empty map| +|schemaImplementsFields|A map of single field or a list of fields per schema name that should be prepended with `override` (serves similar purpose as `x-kotlin-implements-fields`, but is fully decoupled from the api spec). Example: yaml `schemaImplementsFields: {Pet: id, Category: [name, id], Dog: [bark, breed]}` marks fields to be prepended with `override` in schemas `Pet` (field `id`), `Category` (fields `name`, `id`) and `Dog` (fields `bark`, `breed`)| |empty map| |serializableModel|boolean - toggle "implements Serializable" for generated models| |null| |serverPort|configuration the port in which the sever is to run on| |8080| |serviceImplementation|generate stub service implementations that extends service interfaces. If this is set to true service interfaces will also be generated| |false| @@ -59,6 +61,8 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useSpringBoot3|Generate code and provide dependencies for use with Spring Boot 3.x. (Use jakarta instead of javax in imports). Enabling this option will also enable `useJakartaEe`.| |false| |useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true| |useTags|Whether to use tags for creating interface and controller class names| |false| +|xKotlinImplementsFieldsSkip|A list of fields per schema name that should NOT be created with `override` keyword despite their presence in vendor extension `x-kotlin-implements-fields` for the schema. Example: yaml `xKotlinImplementsFieldsSkip: Pet: [photoUrls]` skips `override` for `photoUrls` in schema `Pet`| |empty map| +|xKotlinImplementsSkip|A list of fully qualified interfaces that should NOT be implemented despite their presence in vendor extension `x-kotlin-implements`. Example: yaml `xKotlinImplementsSkip: [com.some.pack.WithPhotoUrls]` skips implementing the interface in any schema| |empty list| ## SUPPORTED VENDOR EXTENSIONS diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 244aad5065cc..dfec3b05a685 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -79,6 +79,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |resourceFolder|resource folder for generated resources| |src/main/resources| |responseWrapper|wrap the responses in given type (Future, Callable, CompletableFuture,ListenableFuture, DeferredResult, RxObservable, RxSingle or fully qualified type)| |null| |returnSuccessCode|Generated server returns 2xx code| |false| +|schemaImplements|Ability to supply interfaces per schema that should be implemented (serves similar purpose as vendor extension `x-implements`, but is fully decoupled from the api spec). Example: yaml `schemaImplements: {Pet: com.some.pack.WithId, Category: [com.some.pack.CategoryInterface], Dog: [com.some.pack.Canine, com.some.pack.OtherInterface]}` implements interfaces in schemas `Pet` (interface `com.some.pack.WithId`), `Category` (interface `com.some.pack.CategoryInterface`), `Dog`(interfaces `com.some.pack.Canine`, `com.some.pack.OtherInterface`)| |empty map| |scmConnection|SCM connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| |scmDeveloperConnection|SCM developer connection in generated pom.xml| |scm:git:git@github.com:openapitools/openapi-generator.git| |scmUrl|SCM URL in generated pom.xml| |https://github.com/openapitools/openapi-generator| @@ -110,6 +111,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |useTags|use tags for creating interface and controller classnames| |false| |virtualService|Generates the virtual service. For more details refer - https://github.com/virtualansoftware/virtualan/wiki| |false| |withXml|whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)| |false| +|xImplementsSkip|Ability to choose interfaces that should NOT be implemented in the models despite their presence in vendor extension `x-implements`. Takes a list of fully qualified interface names. Example: yaml `xImplementsSkip: [com.some.pack.WithPhotoUrls]` skips implementing the interface `com.some.pack.WithPhotoUrls` in any schema| |empty list| ## SUPPORTED VENDOR EXTENSIONS diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java index 484ddae0827e..1f56bb1ef510 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CliOption.java @@ -112,6 +112,10 @@ public static CliOption newString(String opt, String description) { return new CliOption(opt, description, SchemaTypeUtil.STRING_TYPE); } + public static CliOption newString(String opt, String description, String defaultValue) { + return new CliOption(opt, description, SchemaTypeUtil.STRING_TYPE).defaultValue(String.valueOf(defaultValue)); + } + @JsonIgnore public String getOptionHelp() { StringBuilder sb = new StringBuilder(description); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 8a5c35f297f3..9dcfae7fa818 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -348,7 +348,6 @@ public AbstractJavaCodegen() { cliOptions.add(CliOption.newBoolean(IGNORE_ANYOF_IN_ENUM, "Ignore anyOf keyword in enum", ignoreAnyOfInEnum)); cliOptions.add(CliOption.newString(ADDITIONAL_ENUM_TYPE_ANNOTATIONS, "Additional annotations for enum type(class level annotations)")); cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); - cliOptions.add(CliOption.newString(X_IMPLEMENTS_SKIP, "Ability to exclude interfaces that were specified in open api spec using x-implements vendor extension.")); cliOptions.add(CliOption.newString(ADDITIONAL_ONE_OF_TYPE_ANNOTATIONS, "Additional annotations for oneOf interfaces(class level annotations). List separated by semicolon(;) or new line (Linux or Windows)")); cliOptions.add(CliOption.newBoolean(OPENAPI_NULLABLE, "Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.", this.openApiNullable)); cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Skip header parameters in the generated API methods using @ApiImplicitParams annotation.", implicitHeaders)); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java index d25cc315cd95..db39cb29b4d5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinSpringServerCodegen.java @@ -247,11 +247,10 @@ public KotlinSpringServerCodegen() { addSwitch(USE_RESPONSE_ENTITY, "Whether (when false) to return actual type (e.g. List) and handle non-happy path responses via exceptions flow or (when true) return entire ResponseEntity (e.g. ResponseEntity>). If disabled, method are annotated using a @ResponseStatus annotation, which has the status of the first response declared in the Api definition", useResponseEntity); - addOption(X_KOTLIN_IMPLEMENTS_SKIP, "A list of fully qualified interfaces that should NOT be implemented despite their presence in vendor extension `x-kotlin-implements`", "empty array"); - addOption(X_KOTLIN_IMPLEMENTS_FIELDS_SKIP, "A list of fields per schema name that should NOT be created with `override` keyword despite their presence in vendor extension `x-kotlin-implements-fields` for the schema", "empty map of arrays by schema names"); - addOption(SCHEMA_IMPLEMENTS, "A list of interfaces per schema name that should be implemented (serves similar purpose as `x-kotlin-implements`, but is fully decoupled from the api spec)", "empty array"); - addOption(SCHEMA_IMPLEMENTS_FIELDS, "A list of fields per schema name that should be prepended with `override` (serves similar purpose as `x-kotlin-implements-fields`, but is fully decoupled from the api spec)", - "empty map of arrays by schema names"); + addOption(X_KOTLIN_IMPLEMENTS_SKIP, "A list of fully qualified interfaces that should NOT be implemented despite their presence in vendor extension `x-kotlin-implements`. Example: yaml `xKotlinImplementsSkip: [com.some.pack.WithPhotoUrls]` skips implementing the interface in any schema", "empty list"); + addOption(X_KOTLIN_IMPLEMENTS_FIELDS_SKIP, "A list of fields per schema name that should NOT be created with `override` keyword despite their presence in vendor extension `x-kotlin-implements-fields` for the schema. Example: yaml `xKotlinImplementsFieldsSkip: Pet: [photoUrls]` skips `override` for `photoUrls` in schema `Pet`", "empty map"); + addOption(SCHEMA_IMPLEMENTS, "A map of single interface or a list of interfaces per schema name that should be implemented (serves similar purpose as `x-kotlin-implements`, but is fully decoupled from the api spec). Example: yaml `schemaImplements: {Pet: com.some.pack.WithId, Category: [com.some.pack.CategoryInterface], Dog: [com.some.pack.Canine, com.some.pack.OtherInterface]}` implements interfaces in schemas `Pet` (interface `com.some.pack.WithId`), `Category` (interface `com.some.pack.CategoryInterface`), `Dog`(interfaces `com.some.pack.Canine`, `com.some.pack.OtherInterface`)", "empty map"); + addOption(SCHEMA_IMPLEMENTS_FIELDS, "A map of single field or a list of fields per schema name that should be prepended with `override` (serves similar purpose as `x-kotlin-implements-fields`, but is fully decoupled from the api spec). Example: yaml `schemaImplementsFields: {Pet: id, Category: [name, id], Dog: [bark, breed]}` marks fields to be prepended with `override` in schemas `Pet` (field `id`), `Category` (fields `name`, `id`) and `Dog` (fields `bark`, `breed`)", "empty map"); supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application."); supportedLibraries.put(SPRING_CLOUD_LIBRARY, "Spring-Cloud-Feign client with Spring-Boot auto-configured settings."); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index a2cc1bbc190d..f2c447169bc0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -249,6 +249,9 @@ public SpringCodegen() { cliOptions .add(CliOption.newBoolean(RETURN_SUCCESS_CODE, "Generated server returns 2xx code", returnSuccessCode)); cliOptions.add(CliOption.newBoolean(SPRING_CONTROLLER, "Annotate the generated API as a Spring Controller", useSpringController)); + cliOptions.add(CliOption.newString(X_IMPLEMENTS_SKIP, "Ability to choose interfaces that should NOT be implemented in the models despite their presence in vendor extension `x-implements`. Takes a list of fully qualified interface names. Example: yaml `xImplementsSkip: [com.some.pack.WithPhotoUrls]` skips implementing the interface `com.some.pack.WithPhotoUrls` in any schema", "empty list")); + cliOptions.add(CliOption.newString(SCHEMA_IMPLEMENTS, "Ability to supply interfaces per schema that should be implemented (serves similar purpose as vendor extension `x-implements`, but is fully decoupled from the api spec). Example: yaml `schemaImplements: {Pet: com.some.pack.WithId, Category: [com.some.pack.CategoryInterface], Dog: [com.some.pack.Canine, com.some.pack.OtherInterface]}` implements interfaces in schemas `Pet` (interface `com.some.pack.WithId`), `Category` (interface `com.some.pack.CategoryInterface`), `Dog`(interfaces `com.some.pack.Canine`, `com.some.pack.OtherInterface`)", "empty map")); + CliOption requestMappingOpt = new CliOption(REQUEST_MAPPING_OPTION, "Where to generate the class level @RequestMapping annotation.") From 90de5edab0b1f7087a19f163600cb5106758db69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 29 Jan 2026 13:47:06 +0100 Subject: [PATCH 14/21] add output to samples --- .github/workflows/samples-jdk17.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml index 250520df6d9a..c12c38982375 100644 --- a/.github/workflows/samples-jdk17.yaml +++ b/.github/workflows/samples-jdk17.yaml @@ -54,6 +54,7 @@ jobs: - samples/client/petstore/java/microprofile-rest-client-outer-enum # servers - samples/openapi3/server/petstore/springboot-3 + - samples/server/petstore/springboot-x-implements-skip - samples/server/petstore/java-camel/ - samples/server/petstore/java-helidon-server/v3/mp/ - samples/server/petstore/java-helidon-server/v3/se From eedb60ebbc7d48ac399d66052a63e0ff80573aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 29 Jan 2026 14:18:04 +0100 Subject: [PATCH 15/21] change logs --- .../openapitools/codegen/languages/AbstractJavaCodegen.java | 4 ++-- .../openapitools/codegen/languages/AbstractKotlinCodegen.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 9dcfae7fa818..6be8566720a9 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -2024,7 +2024,7 @@ public ModelsMap postProcessModels(ModelsMap objs) { .filter(o -> this.xImplementsSkip.contains(o)) .collect(Collectors.toList()); if (!xImplementsInModelSkipped.isEmpty()) { - LOGGER.info("Following interfaces configured via additional property '{}' will be skipped for model {}: {}", X_IMPLEMENTS_SKIP, cm.classname, xImplementsInModelSkipped); + LOGGER.info("Following interfaces configured via config option '{}' will be skipped for model {}: {}", X_IMPLEMENTS_SKIP, cm.classname, xImplementsInModelSkipped); } List xImplementsInModelProcessed = xImplementsInModelOriginal.stream() .filter(Predicate.not(xImplementsInModelSkipped::contains)) @@ -2039,7 +2039,7 @@ public ModelsMap postProcessModels(ModelsMap objs) { for (ModelMap mo : objs.getModels()) { CodegenModel cm = mo.getModel(); if (this.schemaImplements.containsKey(cm.getSchemaName())) { - LOGGER.info("Adding interface(s) {} configured via additional property '{}' to model {}", this.schemaImplements.get(cm.getSchemaName()), SCHEMA_IMPLEMENTS, cm.classname); + LOGGER.info("Adding interface(s) {} configured via config option '{}' to model {}", this.schemaImplements.get(cm.getSchemaName()), SCHEMA_IMPLEMENTS, cm.classname); cm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList()); List xImplementsInModel = (List) cm.getVendorExtensions().get(X_IMPLEMENTS); List schemaImplements = this.schemaImplements.get(cm.getSchemaName()); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index e8b2647fcf6f..b46c23aa7b54 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -875,7 +875,7 @@ public CodegenModel fromModel(String name, Schema schema) { .filter(vendorExtensionImplementedInterfacesClasses::contains) .collect(Collectors.toList()); if (!interfacesToSkip.isEmpty()) { - LOGGER.info("Interface(s) {} in model {} are skipped from being marked as implemented via additional property '{}'.", + LOGGER.info("Interface(s) {} in model {} are skipped from being marked as implemented via config option '{}'.", interfacesToSkip, name, X_KOTLIN_IMPLEMENTS_SKIP); } List vendorExtensionImplementedInterfacesClassesFiltered = vendorExtensionImplementedInterfacesClasses.stream() @@ -895,7 +895,7 @@ public CodegenModel fromModel(String name, Schema schema) { .filter(vendorExtensionImplementedInterfacesFields::contains) .collect(Collectors.toList()); if (!fieldsToSkip.isEmpty()) { - LOGGER.info("Field(s) {} in model {} are skipped from being marked as inherited via additional property '{}'.", + LOGGER.info("Field(s) {} in model {} are skipped from being marked as inherited via config option '{}'.", fieldsToSkip, name, X_KOTLIN_IMPLEMENTS_FIELDS_SKIP); } List vendorExtensionImplementedInterfacesFieldsFiltered = vendorExtensionImplementedInterfacesFields.stream() From 7b996907121cd843c5efcf4bb5625013f3adaea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Thu, 29 Jan 2026 23:11:32 +0100 Subject: [PATCH 16/21] fix issue #22756 --- .../main/resources/kotlin-spring/api.mustache | 3 ++- .../kotlin-spring/apiInterface.mustache | 3 ++- .../apiInterface.mustache | 3 ++- .../spring/KotlinSpringServerCodegenTest.java | 9 ++++--- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/StoreApi.kt | 12 ++++++---- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiClient.kt | 24 ++++++++++++------- .../org/openapitools/api/StoreApiClient.kt | 12 ++++++---- .../org/openapitools/api/UserApiClient.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiClient.kt | 24 ++++++++++++------- .../org/openapitools/api/StoreApiClient.kt | 12 ++++++---- .../org/openapitools/api/UserApiClient.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiClient.kt | 24 ++++++++++++------- .../org/openapitools/api/StoreApiClient.kt | 12 ++++++---- .../org/openapitools/api/UserApiClient.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiClient.kt | 24 ++++++++++++------- .../org/openapitools/api/StoreApiClient.kt | 12 ++++++---- .../org/openapitools/api/UserApiClient.kt | 24 ++++++++++++------- .../org/openapitools/api/FakeApiController.kt | 6 +++-- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../org/openapitools/api/TestApiController.kt | 3 ++- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/StoreApi.kt | 12 ++++++---- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/StoreApi.kt | 12 ++++++---- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/StoreApi.kt | 12 ++++++---- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/DefaultApi.kt | 3 ++- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../api/MultipartMixedApiController.kt | 3 ++- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/StoreApi.kt | 12 ++++++---- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/FakeApi.kt | 3 ++- .../openapitools/api/FakeClassnameTestApi.kt | 3 ++- .../kotlin/org/openapitools/api/FooApi.kt | 3 ++- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/StoreApi.kt | 12 ++++++---- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/PetApi.kt | 24 ++++++++++++------- .../kotlin/org/openapitools/api/StoreApi.kt | 12 ++++++---- .../kotlin/org/openapitools/api/UserApi.kt | 24 ++++++++++++------- .../org/openapitools/api/PetApiController.kt | 24 ++++++++++++------- .../openapitools/api/StoreApiController.kt | 12 ++++++---- .../org/openapitools/api/UserApiController.kt | 24 ++++++++++++------- 80 files changed, 948 insertions(+), 474 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache index e7543518633c..07d45a3e505c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/api.mustache @@ -86,7 +86,8 @@ class {{classname}}Controller({{#serviceInterface}}@Autowired(required = true) v value = [{{#responses}}ApiResponse(code = {{{code}}}, message = "{{{message}}}"{{#baseType}}, response = {{{.}}}::class{{/baseType}}{{#containerType}}, responseContainer = "{{{.}}}"{{/containerType}}){{^-last}},{{/-last}}{{/responses}}]){{/swagger1AnnotationLibrary}} @RequestMapping( method = [RequestMethod.{{httpMethod}}], - value = [PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}} /* "{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}" */]{{#singleContentTypes}}{{#hasProduces}}, + // "{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}" + value = [PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}]{{#singleContentTypes}}{{#hasProduces}}, produces = [{{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}}]{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache index 106f9cc32e42..67a9c8f4d096 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/apiInterface.mustache @@ -101,7 +101,8 @@ interface {{classname}} { ){{/swagger1AnnotationLibrary}} @RequestMapping( method = [RequestMethod.{{httpMethod}}], - value = [PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}} /* "{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}" */]{{#singleContentTypes}}{{#hasProduces}}, + // "{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}" + value = [PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}]{{#singleContentTypes}}{{#hasProduces}}, produces = [{{#vendorExtensions.x-accepts}}"{{{.}}}"{{^-last}}, {{/-last}}{{/vendorExtensions.x-accepts}}]{{/hasProduces}}{{#hasConsumes}}, consumes = "{{{vendorExtensions.x-content-type}}}"{{/hasConsumes}}{{/singleContentTypes}}{{^singleContentTypes}}{{#hasProduces}}, produces = [{{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}}]{{/hasProduces}}{{#hasConsumes}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/apiInterface.mustache b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/apiInterface.mustache index 4a384caa2a9c..54aa9a914296 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/apiInterface.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-spring/libraries/spring-declarative-http-interface/apiInterface.mustache @@ -60,7 +60,8 @@ interface {{classname}} { }}{{^useResponseEntity}} @ResponseStatus({{#springHttpStatus}}{{#responses.0}}{{{code}}}{{/responses.0}}{{/springHttpStatus}}) {{/useResponseEntity}}{{! }}{{#httpMethod}} @HttpExchange( - url = PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}} /* "{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}" */, + // "{{#lambdaEscapeInNormalString}}{{{path}}}{{/lambdaEscapeInNormalString}}" + url = PATH_{{#lambda.uppercase}}{{#lambda.snakecase}}{{{operationId}}}{{/lambda.snakecase}}{{/lambda.uppercase}}, method = "{{httpMethod}}" ) {{/httpMethod}}{{! diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index 78a6f938314b..2f89c4217dd2 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -1221,20 +1221,23 @@ public void generateHttpInterfaceReactiveWithReactorResponseEntity() throws Exce "import reactor.core.publisher.Flux\n" + "import reactor.core.publisher.Mono", " @HttpExchange(\n" - + " url = PATH_GET_INVENTORY /* \"/store/inventory\" */,\n" + + " // \"/store/inventory\"\n" + + " url = PATH_GET_INVENTORY,\n" + " method = \"GET\"\n" + " )\n" + " fun getInventory(\n" + " ): Mono>>", " @HttpExchange(\n" - + " url = PATH_DELETE_ORDER /* \"/store/order/{orderId}\" */,\n" + + " // \"/store/order/{orderId}\"\n" + + " url = PATH_DELETE_ORDER,\n" + " method = \"DELETE\"\n" + " )\n" + " fun deleteOrder(\n" + " @Parameter(description = \"ID of the order that needs to be deleted\", required = true) @PathVariable(\"orderId\") orderId: kotlin.String\n" + " ): Mono>", " @HttpExchange(\n" - + " url = PATH_PLACE_ORDER /* \"/store/order\" */,\n" + + " // \"/store/order\"\n" + + " url = PATH_PLACE_ORDER,\n" + " method = \"POST\"\n" + " )\n" + " fun placeOrder(\n" diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt index d7f11001a364..952c9a60e282 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -35,7 +35,8 @@ interface PetApi { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -48,7 +49,8 @@ interface PetApi { @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @PathVariable("petId") petId: kotlin.Long, @@ -60,7 +62,8 @@ interface PetApi { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -72,7 +75,8 @@ interface PetApi { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -84,7 +88,8 @@ interface PetApi { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -96,7 +101,8 @@ interface PetApi { @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -109,7 +115,8 @@ interface PetApi { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -123,7 +130,8 @@ interface PetApi { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApi.kt index ebf282cd14a1..d98225449459 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -34,7 +34,8 @@ interface StoreApi { @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @PathVariable("orderId") orderId: kotlin.String @@ -45,7 +46,8 @@ interface StoreApi { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -55,7 +57,8 @@ interface StoreApi { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -67,7 +70,8 @@ interface StoreApi { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApi.kt index 20ed6a010327..141481aa804d 100644 --- a/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-spring-cloud/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -34,7 +34,8 @@ interface UserApi { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) fun createUser( @@ -46,7 +47,8 @@ interface UserApi { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) fun createUsersWithArrayInput( @@ -58,7 +60,8 @@ interface UserApi { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) fun createUsersWithListInput( @@ -70,7 +73,8 @@ interface UserApi { @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @PathVariable("username") username: kotlin.String @@ -81,7 +85,8 @@ interface UserApi { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -93,7 +98,8 @@ interface UserApi { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -106,7 +112,8 @@ interface UserApi { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) @@ -115,7 +122,8 @@ interface UserApi { @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) fun updateUser( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/PetApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/PetApiClient.kt index 7b2af7510d63..8b9a5925db24 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/PetApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/PetApiClient.kt @@ -30,7 +30,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_ADD_PET /* "/pet" */, + // "/pet" + url = PATH_ADD_PET, method = "POST" ) suspend fun addPet( @@ -39,7 +40,8 @@ interface PetApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( - url = PATH_DELETE_PET /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_DELETE_PET, method = "DELETE" ) suspend fun deletePet( @@ -49,7 +51,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */, + // "/pet/findByStatus" + url = PATH_FIND_PETS_BY_STATUS, method = "GET" ) suspend fun findPetsByStatus( @@ -59,7 +62,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */, + // "/pet/findByTags" + url = PATH_FIND_PETS_BY_TAGS, method = "GET" ) suspend fun findPetsByTags( @@ -69,7 +73,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_GET_PET_BY_ID /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_GET_PET_BY_ID, method = "GET" ) suspend fun getPetById( @@ -78,7 +83,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_UPDATE_PET /* "/pet" */, + // "/pet" + url = PATH_UPDATE_PET, method = "PUT" ) suspend fun updatePet( @@ -87,7 +93,8 @@ interface PetApi { @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) @HttpExchange( - url = PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_UPDATE_PET_WITH_FORM, method = "POST" ) suspend fun updatePetWithForm( @@ -98,7 +105,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */, + // "/pet/{petId}/uploadImage" + url = PATH_UPLOAD_FILE, method = "POST" ) suspend fun uploadFile( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/StoreApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/StoreApiClient.kt index 7c94a2c09a0a..26c77b04368d 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/StoreApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/StoreApiClient.kt @@ -29,7 +29,8 @@ interface StoreApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( - url = PATH_DELETE_ORDER /* "/store/order/{orderId}" */, + // "/store/order/{orderId}" + url = PATH_DELETE_ORDER, method = "DELETE" ) suspend fun deleteOrder( @@ -38,7 +39,8 @@ interface StoreApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_GET_INVENTORY /* "/store/inventory" */, + // "/store/inventory" + url = PATH_GET_INVENTORY, method = "GET" ) suspend fun getInventory( @@ -47,7 +49,8 @@ interface StoreApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */, + // "/store/order/{orderId}" + url = PATH_GET_ORDER_BY_ID, method = "GET" ) suspend fun getOrderById( @@ -56,7 +59,8 @@ interface StoreApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_PLACE_ORDER /* "/store/order" */, + // "/store/order" + url = PATH_PLACE_ORDER, method = "POST" ) suspend fun placeOrder( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/UserApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/UserApiClient.kt index 67ecef197e65..85b7891a59fc 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/UserApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-coroutines/src/main/kotlin/org/openapitools/api/UserApiClient.kt @@ -29,7 +29,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_CREATE_USER /* "/user" */, + // "/user" + url = PATH_CREATE_USER, method = "POST" ) suspend fun createUser( @@ -38,7 +39,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */, + // "/user/createWithArray" + url = PATH_CREATE_USERS_WITH_ARRAY_INPUT, method = "POST" ) suspend fun createUsersWithArrayInput( @@ -47,7 +49,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */, + // "/user/createWithList" + url = PATH_CREATE_USERS_WITH_LIST_INPUT, method = "POST" ) suspend fun createUsersWithListInput( @@ -56,7 +59,8 @@ interface UserApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( - url = PATH_DELETE_USER /* "/user/{username}" */, + // "/user/{username}" + url = PATH_DELETE_USER, method = "DELETE" ) suspend fun deleteUser( @@ -65,7 +69,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_GET_USER_BY_NAME /* "/user/{username}" */, + // "/user/{username}" + url = PATH_GET_USER_BY_NAME, method = "GET" ) suspend fun getUserByName( @@ -74,7 +79,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_LOGIN_USER /* "/user/login" */, + // "/user/login" + url = PATH_LOGIN_USER, method = "GET" ) suspend fun loginUser( @@ -84,7 +90,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @HttpExchange( - url = PATH_LOGOUT_USER /* "/user/logout" */, + // "/user/logout" + url = PATH_LOGOUT_USER, method = "GET" ) suspend fun logoutUser( @@ -92,7 +99,8 @@ interface UserApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @HttpExchange( - url = PATH_UPDATE_USER /* "/user/{username}" */, + // "/user/{username}" + url = PATH_UPDATE_USER, method = "PUT" ) suspend fun updateUser( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/PetApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/PetApiClient.kt index fbc8a9bdb11a..9fc7ef8a9b21 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/PetApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/PetApiClient.kt @@ -31,7 +31,8 @@ import kotlin.collections.Map interface PetApi { @HttpExchange( - url = PATH_ADD_PET /* "/pet" */, + // "/pet" + url = PATH_ADD_PET, method = "POST" ) fun addPet( @@ -40,7 +41,8 @@ interface PetApi { @HttpExchange( - url = PATH_DELETE_PET /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_DELETE_PET, method = "DELETE" ) fun deletePet( @@ -50,7 +52,8 @@ interface PetApi { @HttpExchange( - url = PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */, + // "/pet/findByStatus" + url = PATH_FIND_PETS_BY_STATUS, method = "GET" ) fun findPetsByStatus( @@ -59,7 +62,8 @@ interface PetApi { @HttpExchange( - url = PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */, + // "/pet/findByTags" + url = PATH_FIND_PETS_BY_TAGS, method = "GET" ) fun findPetsByTags( @@ -68,7 +72,8 @@ interface PetApi { @HttpExchange( - url = PATH_GET_PET_BY_ID /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_GET_PET_BY_ID, method = "GET" ) fun getPetById( @@ -77,7 +82,8 @@ interface PetApi { @HttpExchange( - url = PATH_UPDATE_PET /* "/pet" */, + // "/pet" + url = PATH_UPDATE_PET, method = "PUT" ) fun updatePet( @@ -86,7 +92,8 @@ interface PetApi { @HttpExchange( - url = PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_UPDATE_PET_WITH_FORM, method = "POST" ) fun updatePetWithForm( @@ -97,7 +104,8 @@ interface PetApi { @HttpExchange( - url = PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */, + // "/pet/{petId}/uploadImage" + url = PATH_UPLOAD_FILE, method = "POST" ) fun uploadFile( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/StoreApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/StoreApiClient.kt index 0eb0d1faf240..ad979ddbe2e6 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/StoreApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/StoreApiClient.kt @@ -30,7 +30,8 @@ import kotlin.collections.Map interface StoreApi { @HttpExchange( - url = PATH_DELETE_ORDER /* "/store/order/{orderId}" */, + // "/store/order/{orderId}" + url = PATH_DELETE_ORDER, method = "DELETE" ) fun deleteOrder( @@ -39,7 +40,8 @@ interface StoreApi { @HttpExchange( - url = PATH_GET_INVENTORY /* "/store/inventory" */, + // "/store/inventory" + url = PATH_GET_INVENTORY, method = "GET" ) fun getInventory( @@ -47,7 +49,8 @@ interface StoreApi { @HttpExchange( - url = PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */, + // "/store/order/{orderId}" + url = PATH_GET_ORDER_BY_ID, method = "GET" ) fun getOrderById( @@ -56,7 +59,8 @@ interface StoreApi { @HttpExchange( - url = PATH_PLACE_ORDER /* "/store/order" */, + // "/store/order" + url = PATH_PLACE_ORDER, method = "POST" ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/UserApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/UserApiClient.kt index 15ccf0e0589f..a0df6504e4d9 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/UserApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-reactive-reactor-wrapped/src/main/kotlin/org/openapitools/api/UserApiClient.kt @@ -30,7 +30,8 @@ import kotlin.collections.Map interface UserApi { @HttpExchange( - url = PATH_CREATE_USER /* "/user" */, + // "/user" + url = PATH_CREATE_USER, method = "POST" ) fun createUser( @@ -39,7 +40,8 @@ interface UserApi { @HttpExchange( - url = PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */, + // "/user/createWithArray" + url = PATH_CREATE_USERS_WITH_ARRAY_INPUT, method = "POST" ) fun createUsersWithArrayInput( @@ -48,7 +50,8 @@ interface UserApi { @HttpExchange( - url = PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */, + // "/user/createWithList" + url = PATH_CREATE_USERS_WITH_LIST_INPUT, method = "POST" ) fun createUsersWithListInput( @@ -57,7 +60,8 @@ interface UserApi { @HttpExchange( - url = PATH_DELETE_USER /* "/user/{username}" */, + // "/user/{username}" + url = PATH_DELETE_USER, method = "DELETE" ) fun deleteUser( @@ -66,7 +70,8 @@ interface UserApi { @HttpExchange( - url = PATH_GET_USER_BY_NAME /* "/user/{username}" */, + // "/user/{username}" + url = PATH_GET_USER_BY_NAME, method = "GET" ) fun getUserByName( @@ -75,7 +80,8 @@ interface UserApi { @HttpExchange( - url = PATH_LOGIN_USER /* "/user/login" */, + // "/user/login" + url = PATH_LOGIN_USER, method = "GET" ) fun loginUser( @@ -85,7 +91,8 @@ interface UserApi { @HttpExchange( - url = PATH_LOGOUT_USER /* "/user/logout" */, + // "/user/logout" + url = PATH_LOGOUT_USER, method = "GET" ) fun logoutUser( @@ -93,7 +100,8 @@ interface UserApi { @HttpExchange( - url = PATH_UPDATE_USER /* "/user/{username}" */, + // "/user/{username}" + url = PATH_UPDATE_USER, method = "PUT" ) fun updateUser( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/PetApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/PetApiClient.kt index c435585c469e..47823e63364c 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/PetApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/PetApiClient.kt @@ -29,7 +29,8 @@ import kotlin.collections.Map interface PetApi { @HttpExchange( - url = PATH_ADD_PET /* "/pet" */, + // "/pet" + url = PATH_ADD_PET, method = "POST" ) fun addPet( @@ -38,7 +39,8 @@ interface PetApi { @HttpExchange( - url = PATH_DELETE_PET /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_DELETE_PET, method = "DELETE" ) fun deletePet( @@ -48,7 +50,8 @@ interface PetApi { @HttpExchange( - url = PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */, + // "/pet/findByStatus" + url = PATH_FIND_PETS_BY_STATUS, method = "GET" ) fun findPetsByStatus( @@ -57,7 +60,8 @@ interface PetApi { @HttpExchange( - url = PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */, + // "/pet/findByTags" + url = PATH_FIND_PETS_BY_TAGS, method = "GET" ) fun findPetsByTags( @@ -66,7 +70,8 @@ interface PetApi { @HttpExchange( - url = PATH_GET_PET_BY_ID /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_GET_PET_BY_ID, method = "GET" ) fun getPetById( @@ -75,7 +80,8 @@ interface PetApi { @HttpExchange( - url = PATH_UPDATE_PET /* "/pet" */, + // "/pet" + url = PATH_UPDATE_PET, method = "PUT" ) fun updatePet( @@ -84,7 +90,8 @@ interface PetApi { @HttpExchange( - url = PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_UPDATE_PET_WITH_FORM, method = "POST" ) fun updatePetWithForm( @@ -95,7 +102,8 @@ interface PetApi { @HttpExchange( - url = PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */, + // "/pet/{petId}/uploadImage" + url = PATH_UPLOAD_FILE, method = "POST" ) fun uploadFile( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/StoreApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/StoreApiClient.kt index 5ae8679640d8..fa73100b0a29 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/StoreApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/StoreApiClient.kt @@ -28,7 +28,8 @@ import kotlin.collections.Map interface StoreApi { @HttpExchange( - url = PATH_DELETE_ORDER /* "/store/order/{orderId}" */, + // "/store/order/{orderId}" + url = PATH_DELETE_ORDER, method = "DELETE" ) fun deleteOrder( @@ -37,7 +38,8 @@ interface StoreApi { @HttpExchange( - url = PATH_GET_INVENTORY /* "/store/inventory" */, + // "/store/inventory" + url = PATH_GET_INVENTORY, method = "GET" ) fun getInventory( @@ -45,7 +47,8 @@ interface StoreApi { @HttpExchange( - url = PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */, + // "/store/order/{orderId}" + url = PATH_GET_ORDER_BY_ID, method = "GET" ) fun getOrderById( @@ -54,7 +57,8 @@ interface StoreApi { @HttpExchange( - url = PATH_PLACE_ORDER /* "/store/order" */, + // "/store/order" + url = PATH_PLACE_ORDER, method = "POST" ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/UserApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/UserApiClient.kt index 019895e02376..8f7969058889 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/UserApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface-wrapped/src/main/kotlin/org/openapitools/api/UserApiClient.kt @@ -28,7 +28,8 @@ import kotlin.collections.Map interface UserApi { @HttpExchange( - url = PATH_CREATE_USER /* "/user" */, + // "/user" + url = PATH_CREATE_USER, method = "POST" ) fun createUser( @@ -37,7 +38,8 @@ interface UserApi { @HttpExchange( - url = PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */, + // "/user/createWithArray" + url = PATH_CREATE_USERS_WITH_ARRAY_INPUT, method = "POST" ) fun createUsersWithArrayInput( @@ -46,7 +48,8 @@ interface UserApi { @HttpExchange( - url = PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */, + // "/user/createWithList" + url = PATH_CREATE_USERS_WITH_LIST_INPUT, method = "POST" ) fun createUsersWithListInput( @@ -55,7 +58,8 @@ interface UserApi { @HttpExchange( - url = PATH_DELETE_USER /* "/user/{username}" */, + // "/user/{username}" + url = PATH_DELETE_USER, method = "DELETE" ) fun deleteUser( @@ -64,7 +68,8 @@ interface UserApi { @HttpExchange( - url = PATH_GET_USER_BY_NAME /* "/user/{username}" */, + // "/user/{username}" + url = PATH_GET_USER_BY_NAME, method = "GET" ) fun getUserByName( @@ -73,7 +78,8 @@ interface UserApi { @HttpExchange( - url = PATH_LOGIN_USER /* "/user/login" */, + // "/user/login" + url = PATH_LOGIN_USER, method = "GET" ) fun loginUser( @@ -83,7 +89,8 @@ interface UserApi { @HttpExchange( - url = PATH_LOGOUT_USER /* "/user/logout" */, + // "/user/logout" + url = PATH_LOGOUT_USER, method = "GET" ) fun logoutUser( @@ -91,7 +98,8 @@ interface UserApi { @HttpExchange( - url = PATH_UPDATE_USER /* "/user/{username}" */, + // "/user/{username}" + url = PATH_UPDATE_USER, method = "PUT" ) fun updateUser( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/PetApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/PetApiClient.kt index c435585c469e..47823e63364c 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/PetApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/PetApiClient.kt @@ -29,7 +29,8 @@ import kotlin.collections.Map interface PetApi { @HttpExchange( - url = PATH_ADD_PET /* "/pet" */, + // "/pet" + url = PATH_ADD_PET, method = "POST" ) fun addPet( @@ -38,7 +39,8 @@ interface PetApi { @HttpExchange( - url = PATH_DELETE_PET /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_DELETE_PET, method = "DELETE" ) fun deletePet( @@ -48,7 +50,8 @@ interface PetApi { @HttpExchange( - url = PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */, + // "/pet/findByStatus" + url = PATH_FIND_PETS_BY_STATUS, method = "GET" ) fun findPetsByStatus( @@ -57,7 +60,8 @@ interface PetApi { @HttpExchange( - url = PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */, + // "/pet/findByTags" + url = PATH_FIND_PETS_BY_TAGS, method = "GET" ) fun findPetsByTags( @@ -66,7 +70,8 @@ interface PetApi { @HttpExchange( - url = PATH_GET_PET_BY_ID /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_GET_PET_BY_ID, method = "GET" ) fun getPetById( @@ -75,7 +80,8 @@ interface PetApi { @HttpExchange( - url = PATH_UPDATE_PET /* "/pet" */, + // "/pet" + url = PATH_UPDATE_PET, method = "PUT" ) fun updatePet( @@ -84,7 +90,8 @@ interface PetApi { @HttpExchange( - url = PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */, + // "/pet/{petId}" + url = PATH_UPDATE_PET_WITH_FORM, method = "POST" ) fun updatePetWithForm( @@ -95,7 +102,8 @@ interface PetApi { @HttpExchange( - url = PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */, + // "/pet/{petId}/uploadImage" + url = PATH_UPLOAD_FILE, method = "POST" ) fun uploadFile( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/StoreApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/StoreApiClient.kt index 5ae8679640d8..fa73100b0a29 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/StoreApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/StoreApiClient.kt @@ -28,7 +28,8 @@ import kotlin.collections.Map interface StoreApi { @HttpExchange( - url = PATH_DELETE_ORDER /* "/store/order/{orderId}" */, + // "/store/order/{orderId}" + url = PATH_DELETE_ORDER, method = "DELETE" ) fun deleteOrder( @@ -37,7 +38,8 @@ interface StoreApi { @HttpExchange( - url = PATH_GET_INVENTORY /* "/store/inventory" */, + // "/store/inventory" + url = PATH_GET_INVENTORY, method = "GET" ) fun getInventory( @@ -45,7 +47,8 @@ interface StoreApi { @HttpExchange( - url = PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */, + // "/store/order/{orderId}" + url = PATH_GET_ORDER_BY_ID, method = "GET" ) fun getOrderById( @@ -54,7 +57,8 @@ interface StoreApi { @HttpExchange( - url = PATH_PLACE_ORDER /* "/store/order" */, + // "/store/order" + url = PATH_PLACE_ORDER, method = "POST" ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/UserApiClient.kt b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/UserApiClient.kt index 019895e02376..8f7969058889 100644 --- a/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/UserApiClient.kt +++ b/samples/server/petstore/kotlin-spring-declarative-interface/src/main/kotlin/org/openapitools/api/UserApiClient.kt @@ -28,7 +28,8 @@ import kotlin.collections.Map interface UserApi { @HttpExchange( - url = PATH_CREATE_USER /* "/user" */, + // "/user" + url = PATH_CREATE_USER, method = "POST" ) fun createUser( @@ -37,7 +38,8 @@ interface UserApi { @HttpExchange( - url = PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */, + // "/user/createWithArray" + url = PATH_CREATE_USERS_WITH_ARRAY_INPUT, method = "POST" ) fun createUsersWithArrayInput( @@ -46,7 +48,8 @@ interface UserApi { @HttpExchange( - url = PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */, + // "/user/createWithList" + url = PATH_CREATE_USERS_WITH_LIST_INPUT, method = "POST" ) fun createUsersWithListInput( @@ -55,7 +58,8 @@ interface UserApi { @HttpExchange( - url = PATH_DELETE_USER /* "/user/{username}" */, + // "/user/{username}" + url = PATH_DELETE_USER, method = "DELETE" ) fun deleteUser( @@ -64,7 +68,8 @@ interface UserApi { @HttpExchange( - url = PATH_GET_USER_BY_NAME /* "/user/{username}" */, + // "/user/{username}" + url = PATH_GET_USER_BY_NAME, method = "GET" ) fun getUserByName( @@ -73,7 +78,8 @@ interface UserApi { @HttpExchange( - url = PATH_LOGIN_USER /* "/user/login" */, + // "/user/login" + url = PATH_LOGIN_USER, method = "GET" ) fun loginUser( @@ -83,7 +89,8 @@ interface UserApi { @HttpExchange( - url = PATH_LOGOUT_USER /* "/user/logout" */, + // "/user/logout" + url = PATH_LOGOUT_USER, method = "GET" ) fun logoutUser( @@ -91,7 +98,8 @@ interface UserApi { @HttpExchange( - url = PATH_UPDATE_USER /* "/user/{username}" */, + // "/user/{username}" + url = PATH_UPDATE_USER, method = "PUT" ) fun updateUser( diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/FakeApiController.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/FakeApiController.kt index 22e0be86e156..b1d3383a2feb 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/FakeApiController.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/FakeApiController.kt @@ -42,7 +42,8 @@ class FakeApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ANNOTATIONS /* "/fake/annotations" */], + // "/fake/annotations" + value = [PATH_ANNOTATIONS], consumes = ["application/json"] ) fun annotations( @@ -61,7 +62,8 @@ class FakeApiController() { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET_WITH_FORM_NUMBER /* "/fake/annotations" */], + // "/fake/annotations" + value = [PATH_UPDATE_PET_WITH_FORM_NUMBER], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithFormNumber( diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/PetApiController.kt index 947050a6ed47..5dd603c189fb 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -45,7 +45,8 @@ class PetApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -65,7 +66,8 @@ class PetApiController() { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -85,7 +87,8 @@ class PetApiController() { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -105,7 +108,8 @@ class PetApiController() { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -126,7 +130,8 @@ class PetApiController() { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -148,7 +153,8 @@ class PetApiController() { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -168,7 +174,8 @@ class PetApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -189,7 +196,8 @@ class PetApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/StoreApiController.kt index fd02efc120e5..e9e3620a9e75 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -43,7 +43,8 @@ class StoreApiController() { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String @@ -61,7 +62,8 @@ class StoreApiController() { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -79,7 +81,8 @@ class StoreApiController() { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -98,7 +101,8 @@ class StoreApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/UserApiController.kt index 1637461c8b3e..b59055789659 100644 --- a/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-spring-default/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -43,7 +43,8 @@ class UserApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) fun createUser( @@ -62,7 +63,8 @@ class UserApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) fun createUsersWithArrayInput( @@ -81,7 +83,8 @@ class UserApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) fun createUsersWithListInput( @@ -101,7 +104,8 @@ class UserApiController() { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -120,7 +124,8 @@ class UserApiController() { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -139,7 +144,8 @@ class UserApiController() { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -159,7 +165,8 @@ class UserApiController() { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) @@ -176,7 +183,8 @@ class UserApiController() { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/PetApiController.kt index 0cffbb9f76e6..1d02b4b3083e 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -31,7 +31,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -44,7 +45,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @PathVariable("petId") petId: kotlin.Long, @@ -56,7 +58,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -68,7 +71,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -80,7 +84,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -92,7 +97,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -105,7 +111,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -119,7 +126,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 457638d16963..62c40eca0e3b 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -30,7 +30,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @PathVariable("orderId") orderId: kotlin.String @@ -41,7 +42,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -51,7 +53,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -63,7 +66,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/UserApiController.kt index fa8508cf219f..7e9125232393 100644 --- a/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3-no-response-entity/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -30,7 +30,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) fun createUser( @@ -42,7 +43,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) fun createUsersWithArrayInput( @@ -54,7 +56,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) fun createUsersWithListInput( @@ -66,7 +69,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @PathVariable("username") username: kotlin.String @@ -77,7 +81,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -89,7 +94,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -102,7 +108,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -111,7 +118,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt index 0cffbb9f76e6..1d02b4b3083e 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -31,7 +31,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -44,7 +45,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @PathVariable("petId") petId: kotlin.Long, @@ -56,7 +58,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -68,7 +71,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -80,7 +84,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -92,7 +97,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -105,7 +111,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -119,7 +126,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 457638d16963..62c40eca0e3b 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -30,7 +30,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @PathVariable("orderId") orderId: kotlin.String @@ -41,7 +42,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -51,7 +53,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -63,7 +66,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt index fa8508cf219f..7e9125232393 100644 --- a/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-3/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -30,7 +30,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) fun createUser( @@ -42,7 +43,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) fun createUsersWithArrayInput( @@ -54,7 +56,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) fun createUsersWithListInput( @@ -66,7 +69,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @PathVariable("username") username: kotlin.String @@ -77,7 +81,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -89,7 +94,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -102,7 +108,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -111,7 +118,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/PetApiController.kt index 0cffbb9f76e6..1d02b4b3083e 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -31,7 +31,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -44,7 +45,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @PathVariable("petId") petId: kotlin.Long, @@ -56,7 +58,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -68,7 +71,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -80,7 +84,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -92,7 +97,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -105,7 +111,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -119,7 +126,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 457638d16963..62c40eca0e3b 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -30,7 +30,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @PathVariable("orderId") orderId: kotlin.String @@ -41,7 +42,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -51,7 +53,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -63,7 +66,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/UserApiController.kt index fa8508cf219f..7e9125232393 100644 --- a/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-additionalproperties/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -30,7 +30,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) fun createUser( @@ -42,7 +43,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) fun createUsersWithArrayInput( @@ -54,7 +56,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) fun createUsersWithListInput( @@ -66,7 +69,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @PathVariable("username") username: kotlin.String @@ -77,7 +81,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -89,7 +94,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -102,7 +108,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -111,7 +118,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/api/TestApiController.kt b/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/api/TestApiController.kt index 786fa3170812..64844ce66fb6 100644 --- a/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/api/TestApiController.kt +++ b/samples/server/petstore/kotlin-springboot-bigdecimal-default/src/main/kotlin/org/openapitools/api/TestApiController.kt @@ -42,7 +42,8 @@ class TestApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_TEST_POST /* "/test" */], + // "/test" + value = [PATH_TEST_POST], consumes = ["application/json"] ) fun testPost( diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt index 5e1fdce5c82a..6a53f60e4740 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -54,7 +54,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -76,7 +77,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -98,7 +100,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -120,7 +123,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -143,7 +147,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -167,7 +172,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -189,7 +195,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -212,7 +219,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt index 82f685e7b002..f9c427133fe6 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -52,7 +52,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String @@ -72,7 +73,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -92,7 +94,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -113,7 +116,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt index c242451d0637..f529e5d341ec 100644 --- a/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate-nodefaults/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -52,7 +52,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) fun createUser( @@ -73,7 +74,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) fun createUsersWithArrayInput( @@ -94,7 +96,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) fun createUsersWithListInput( @@ -116,7 +119,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -137,7 +141,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -158,7 +163,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -180,7 +186,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return getDelegate().logoutUser() @@ -199,7 +206,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index 69c499864ac4..5bf22b07f12f 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -53,7 +53,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -75,7 +76,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -97,7 +99,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -119,7 +122,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -142,7 +146,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -166,7 +171,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -188,7 +194,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -211,7 +218,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 6b18141f8511..b71c1ed81383 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -51,7 +51,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String @@ -71,7 +72,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -91,7 +93,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -112,7 +115,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index ff3341aef8e7..b4cf29d94cee 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -51,7 +51,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) fun createUser( @@ -72,7 +73,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) fun createUsersWithArrayInput( @@ -93,7 +95,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) fun createUsersWithListInput( @@ -115,7 +118,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -136,7 +140,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -157,7 +162,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -179,7 +185,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return getDelegate().logoutUser() @@ -198,7 +205,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index fa15babac154..fe980df7e0b8 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -56,7 +56,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json"] ) suspend fun addPet( @@ -78,7 +79,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) suspend fun deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -102,7 +104,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/json"] ) fun findPetsByStatus( @@ -126,7 +129,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/json"] ) fun findPetsByTags( @@ -149,7 +153,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/json"] ) suspend fun getPetById( @@ -171,7 +176,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json"] ) suspend fun updatePet( @@ -193,7 +199,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) suspend fun updatePetWithForm( @@ -218,7 +225,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 331b6fbb9ef2..76eba5a5d747 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -54,7 +54,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) suspend fun deleteOrder( @ApiParam(value = "", required = true) @PathVariable("orderId") orderId: kotlin.String, @@ -77,7 +78,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) suspend fun getInventory(@ApiParam(hidden = true) exchange: org.springframework.web.server.ServerWebExchange): ResponseEntity> { @@ -96,7 +98,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/json"] ) suspend fun getOrderById( @@ -118,7 +121,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index 6db96e4fccb7..2f3723c68253 100644 --- a/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-include-http-request-context-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -54,7 +54,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) suspend fun createUser( @@ -75,7 +76,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) suspend fun createUsersWithArrayInput( @@ -96,7 +98,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) suspend fun createUsersWithListInput( @@ -117,7 +120,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) suspend fun deleteUser( @ApiParam(value = "", required = true) @PathVariable("username") username: kotlin.String, @@ -138,7 +142,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/json"] ) suspend fun getUserByName( @@ -160,7 +165,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/json"] ) suspend fun loginUser( @@ -182,7 +188,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) suspend fun logoutUser(@ApiParam(hidden = true) exchange: org.springframework.web.server.ServerWebExchange): ResponseEntity { return getDelegate().logoutUser(exchange) @@ -199,7 +206,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) suspend fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/DefaultApi.kt b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/DefaultApi.kt index 3c941f081efa..642db5b5731e 100644 --- a/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/DefaultApi.kt +++ b/samples/server/petstore/kotlin-springboot-integer-enum/src/main/kotlin/org/openapitools/api/DefaultApi.kt @@ -35,7 +35,8 @@ interface DefaultApi { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_HEALTHCHECK /* "/healthcheck" */], + // "/healthcheck" + value = [PATH_HEALTHCHECK], produces = ["application/json"] ) fun healthcheck(): ResponseEntity diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt index 962ade8e3edd..9fb28de9e854 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -44,7 +44,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json", "application/xml"] ) fun addPet( @@ -63,7 +64,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -83,7 +85,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -103,7 +106,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -124,7 +128,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -145,7 +150,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json", "application/xml"] ) fun updatePet( @@ -164,7 +170,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -185,7 +192,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 4f33be22d54a..1884db667f9c 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -43,7 +43,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String @@ -61,7 +62,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -79,7 +81,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -98,7 +101,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"] ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt index da1123a59ed3..7dd168a5cf20 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -42,7 +42,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */] + // "/user" + value = [PATH_CREATE_USER] ) fun createUser( @Parameter(description = "Created user object", required = true) @Valid @RequestBody body: User @@ -59,7 +60,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */] + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT] ) fun createUsersWithArrayInput( @Parameter(description = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List @@ -76,7 +78,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */] + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT] ) fun createUsersWithListInput( @Parameter(description = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List @@ -94,7 +97,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -113,7 +117,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -132,7 +137,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -151,7 +157,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -167,7 +174,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_UPDATE_USER] ) fun updateUser( @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt index 5667157d17d8..dd50dc75d4d9 100644 --- a/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt +++ b/samples/server/petstore/kotlin-springboot-multipart-request-model/src/main/kotlin/org/openapitools/api/MultipartMixedApiController.kt @@ -43,7 +43,8 @@ class MultipartMixedApiController() { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_MULTIPART_MIXED /* "/multipart-mixed" */], + // "/multipart-mixed" + value = [PATH_MULTIPART_MIXED], consumes = ["multipart/form-data"] ) fun multipartMixed( diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index 71a6b25c63c7..7dd9d3db357b 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -37,7 +37,8 @@ interface PetApi { @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json", "application/xml"] ) fun addPet( @@ -49,7 +50,8 @@ interface PetApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @PathVariable("petId") petId: kotlin.Long, @@ -61,7 +63,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -73,7 +76,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -85,7 +89,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -97,7 +102,8 @@ interface PetApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json", "application/xml"] ) fun updatePet( @@ -109,7 +115,8 @@ interface PetApi { @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -123,7 +130,8 @@ interface PetApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index ad4786fca395..47d1684a2539 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -36,7 +36,8 @@ interface StoreApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @PathVariable("orderId") orderId: kotlin.String @@ -47,7 +48,8 @@ interface StoreApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): Map { @@ -57,7 +59,8 @@ interface StoreApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -69,7 +72,8 @@ interface StoreApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"] ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index 379afaa0ea5e..58d74e838988 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -36,7 +36,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */] + // "/user" + value = [PATH_CREATE_USER] ) fun createUser( @Valid @RequestBody body: User @@ -47,7 +48,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */] + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT] ) fun createUsersWithArrayInput( @Valid @RequestBody body: kotlin.collections.List @@ -58,7 +60,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */] + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT] ) fun createUsersWithListInput( @Valid @RequestBody body: kotlin.collections.List @@ -69,7 +72,8 @@ interface UserApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @PathVariable("username") username: kotlin.String @@ -80,7 +84,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -92,7 +97,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -105,7 +111,8 @@ interface UserApi { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): Unit { return getDelegate().logoutUser() @@ -114,7 +121,8 @@ interface UserApi { @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_UPDATE_USER] ) fun updateUser( @PathVariable("username") username: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/PetApiController.kt index 9883bf1e6f0e..b765890c06d2 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -31,7 +31,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json", "application/xml"] ) fun addPet( @@ -43,7 +44,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @PathVariable("petId") petId: kotlin.Long, @@ -55,7 +57,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -67,7 +70,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -79,7 +83,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -91,7 +96,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json", "application/xml"] ) fun updatePet( @@ -103,7 +109,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -117,7 +124,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiController.kt index e3eb06f2505d..a0975c618562 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -30,7 +30,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @PathVariable("orderId") orderId: kotlin.String @@ -41,7 +42,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): Map { @@ -51,7 +53,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -63,7 +66,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"] ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/UserApiController.kt index 306f9c0925d0..c5a0f6438041 100644 --- a/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-no-response-entity/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -30,7 +30,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */] + // "/user" + value = [PATH_CREATE_USER] ) fun createUser( @Valid @RequestBody body: User @@ -41,7 +42,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */] + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT] ) fun createUsersWithArrayInput( @Valid @RequestBody body: kotlin.collections.List @@ -52,7 +54,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */] + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT] ) fun createUsersWithListInput( @Valid @RequestBody body: kotlin.collections.List @@ -63,7 +66,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @PathVariable("username") username: kotlin.String @@ -74,7 +78,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -86,7 +91,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -99,7 +105,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @ResponseStatus(HttpStatus.OK) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): Unit { return service.logoutUser() @@ -108,7 +115,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @ResponseStatus(HttpStatus.BAD_REQUEST) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_UPDATE_USER] ) fun updateUser( @PathVariable("username") username: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/PetApiController.kt index 117cd461b20c..4eb99427a4d9 100644 --- a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -46,7 +46,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -66,7 +67,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) suspend fun deletePet( @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -86,7 +88,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) suspend fun findPetsByStatus( @@ -106,7 +109,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) suspend fun findPetsByTags( @@ -127,7 +131,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) suspend fun getPetById( @@ -149,7 +154,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -169,7 +175,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) suspend fun updatePetWithForm( @@ -190,7 +197,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 702584aaf3d1..03750f1b7577 100644 --- a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -44,7 +44,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) suspend fun deleteOrder( @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String @@ -62,7 +63,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) suspend fun getInventory(): ResponseEntity> { @@ -80,7 +82,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) suspend fun getOrderById( @@ -99,7 +102,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/UserApiController.kt index 48d01df2a018..d677e66a952f 100644 --- a/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive-without-flow/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -44,7 +44,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) suspend fun createUser( @@ -63,7 +64,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) suspend fun createUsersWithArrayInput( @@ -82,7 +84,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) suspend fun createUsersWithListInput( @@ -102,7 +105,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) suspend fun deleteUser( @Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -121,7 +125,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) suspend fun getUserByName( @@ -140,7 +145,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) suspend fun loginUser( @@ -160,7 +166,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) suspend fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -177,7 +184,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) suspend fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt index 5e19c2fc98bf..1f183caa6cb1 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -46,7 +46,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -66,7 +67,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) suspend fun deletePet( @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -86,7 +88,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -106,7 +109,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -127,7 +131,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) suspend fun getPetById( @@ -149,7 +154,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], produces = ["application/xml", "application/json"], consumes = ["application/json", "application/xml"] ) @@ -169,7 +175,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) suspend fun updatePetWithForm( @@ -190,7 +197,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 702584aaf3d1..03750f1b7577 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -44,7 +44,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) suspend fun deleteOrder( @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String @@ -62,7 +63,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) suspend fun getInventory(): ResponseEntity> { @@ -80,7 +82,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) suspend fun getOrderById( @@ -99,7 +102,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt index 48d01df2a018..d677e66a952f 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -44,7 +44,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) suspend fun createUser( @@ -63,7 +64,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) suspend fun createUsersWithArrayInput( @@ -82,7 +84,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) suspend fun createUsersWithListInput( @@ -102,7 +105,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) suspend fun deleteUser( @Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -121,7 +125,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) suspend fun getUserByName( @@ -140,7 +145,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) suspend fun loginUser( @@ -160,7 +166,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) suspend fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -177,7 +184,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) suspend fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeApi.kt index 1f89ef3b569f..da934bebc324 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeApi.kt @@ -48,7 +48,8 @@ interface FakeApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FAKE_COOKIE_SUGGESTION /* "/fake/cookie-suggestion" */], + // "/fake/cookie-suggestion" + value = [PATH_FAKE_COOKIE_SUGGESTION], produces = ["application/json"] ) fun fakeCookieSuggestion( diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeClassnameTestApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeClassnameTestApi.kt index b5a471ed4960..cce4b9078c60 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeClassnameTestApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FakeClassnameTestApi.kt @@ -49,7 +49,8 @@ interface FakeClassnameTestApi { ) @RequestMapping( method = [RequestMethod.PATCH], - value = [PATH_TEST_CLASSNAME /* "/fake_classname_test" */], + // "/fake_classname_test" + value = [PATH_TEST_CLASSNAME], produces = ["application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FooApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FooApi.kt index f672483512d7..56b5e25b356e 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FooApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/FooApi.kt @@ -48,7 +48,8 @@ interface FooApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FOO_GET /* "/foo" */], + // "/foo" + value = [PATH_FOO_GET], produces = ["application/json"] ) fun fooGet(): ResponseEntity { diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt index b19867026c97..38649dcde612 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -51,7 +51,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json", "application/xml"] ) fun addPet( @@ -73,7 +74,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -95,7 +97,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -117,7 +120,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -140,7 +144,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -164,7 +169,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json", "application/xml"] ) fun updatePet( @@ -186,7 +192,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -209,7 +216,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/StoreApi.kt index 5265b326406a..aae03d0c190d 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -49,7 +49,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{order_id}" */] + // "/store/order/{order_id}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") orderId: kotlin.String @@ -69,7 +70,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -89,7 +91,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{order_id}" */], + // "/store/order/{order_id}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -110,7 +113,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/UserApi.kt index 2f55ec7dff2f..db9f7cfbb8d5 100644 --- a/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-request-cookie/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -48,7 +48,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) fun createUser( @@ -68,7 +69,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) fun createUsersWithArrayInput( @@ -88,7 +90,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) fun createUsersWithListInput( @@ -109,7 +112,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -130,7 +134,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -151,7 +156,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -172,7 +178,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(HttpStatus.NOT_IMPLEMENTED) @@ -190,7 +197,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt index 099241453b95..0a32254f2f27 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -47,7 +47,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json", "application/xml"] ) fun addPet( @@ -66,7 +67,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 400, message = "Invalid pet value")]) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -87,7 +89,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -108,7 +111,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -128,7 +132,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -147,7 +152,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json", "application/xml"] ) fun updatePet( @@ -166,7 +172,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -188,7 +195,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 9e7f0a56f8d5..2fcff50b5a80 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -45,7 +45,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String @@ -65,7 +66,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -82,7 +84,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -101,7 +104,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"] ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/UserApiController.kt index 876614ba9063..14338953a646 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger1/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -45,7 +45,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */] + // "/user" + value = [PATH_CREATE_USER] ) fun createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody body: User @@ -62,7 +63,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */] + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT] ) fun createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List @@ -79,7 +81,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */] + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT] ) fun createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List @@ -96,7 +99,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -114,7 +118,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -133,7 +138,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -152,7 +158,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -167,7 +174,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_UPDATE_USER] ) fun updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt index 962ade8e3edd..9fb28de9e854 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -44,7 +44,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json", "application/xml"] ) fun addPet( @@ -63,7 +64,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @Parameter(description = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -83,7 +85,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -103,7 +106,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -124,7 +128,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -145,7 +150,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json", "application/xml"] ) fun updatePet( @@ -164,7 +170,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -185,7 +192,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 4f33be22d54a..1884db667f9c 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -43,7 +43,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @Parameter(description = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String @@ -61,7 +62,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -79,7 +81,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -98,7 +101,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"] ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/UserApiController.kt index da1123a59ed3..7dd168a5cf20 100644 --- a/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-source-swagger2/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -42,7 +42,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */] + // "/user" + value = [PATH_CREATE_USER] ) fun createUser( @Parameter(description = "Created user object", required = true) @Valid @RequestBody body: User @@ -59,7 +60,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */] + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT] ) fun createUsersWithArrayInput( @Parameter(description = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List @@ -76,7 +78,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */] + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT] ) fun createUsersWithListInput( @Parameter(description = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List @@ -94,7 +97,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @Parameter(description = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -113,7 +117,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -132,7 +137,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -151,7 +157,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -167,7 +174,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_UPDATE_USER] ) fun updateUser( @Parameter(description = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt index 099241453b95..0a32254f2f27 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -47,7 +47,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json", "application/xml"] ) fun addPet( @@ -66,7 +67,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 400, message = "Invalid pet value")]) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -87,7 +89,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -108,7 +111,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -128,7 +132,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -147,7 +152,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json", "application/xml"] ) fun updatePet( @@ -166,7 +172,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -188,7 +195,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 9e7f0a56f8d5..2fcff50b5a80 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -45,7 +45,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") orderId: kotlin.String @@ -65,7 +66,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -82,7 +84,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -101,7 +104,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"] ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/UserApiController.kt index 876614ba9063..14338953a646 100644 --- a/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot-springfox/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -45,7 +45,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */] + // "/user" + value = [PATH_CREATE_USER] ) fun createUser( @ApiParam(value = "Created user object", required = true) @Valid @RequestBody body: User @@ -62,7 +63,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */] + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT] ) fun createUsersWithArrayInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List @@ -79,7 +81,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */] + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT] ) fun createUsersWithListInput( @ApiParam(value = "List of user object", required = true) @Valid @RequestBody body: kotlin.collections.List @@ -96,7 +99,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") username: kotlin.String @@ -114,7 +118,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -133,7 +138,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -152,7 +158,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -167,7 +174,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_UPDATE_USER] ) fun updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") username: kotlin.String, diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/PetApi.kt index d65732eeaae9..d30df48a2e47 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -53,7 +53,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json"] ) fun addPet( @@ -73,7 +74,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") petId: kotlin.Long, @@ -95,7 +97,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/json"] ) fun findPetsByStatus( @@ -117,7 +120,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/json"] ) fun findPetsByTags( @@ -138,7 +142,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/json"] ) fun getPetById( @@ -158,7 +163,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json"] ) fun updatePet( @@ -178,7 +184,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -201,7 +208,8 @@ interface PetApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/StoreApi.kt index 4ed2f7c7b8be..78e540eb2b09 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -51,7 +51,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @ApiParam(value = "", required = true) @PathVariable("orderId") orderId: kotlin.String, @@ -72,7 +73,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(@ApiParam(hidden = true) request: javax.servlet.http.HttpServletRequest): ResponseEntity> @@ -89,7 +91,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/json"] ) fun getOrderById( @@ -109,7 +112,8 @@ interface StoreApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/json"], consumes = ["application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/UserApi.kt index ed1b8ef18da3..31bc5c1776a7 100644 --- a/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-x-kotlin-implements/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -51,7 +51,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */], + // "/user" + value = [PATH_CREATE_USER], consumes = ["application/json"] ) fun createUser( @@ -70,7 +71,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */], + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT], consumes = ["application/json"] ) fun createUsersWithArrayInput( @@ -89,7 +91,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */], + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT], consumes = ["application/json"] ) fun createUsersWithListInput( @@ -108,7 +111,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @ApiParam(value = "", required = true) @PathVariable("username") username: kotlin.String, @@ -127,7 +131,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/json"] ) fun getUserByName( @@ -147,7 +152,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/json"] ) fun loginUser( @@ -167,7 +173,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(@ApiParam(hidden = true) request: javax.servlet.http.HttpServletRequest): ResponseEntity @@ -182,7 +189,8 @@ interface UserApi { ) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_UPDATE_USER], consumes = ["application/json"] ) fun updateUser( diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt index dd0753a9e436..f2ff1fb47490 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -32,7 +32,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_ADD_PET /* "/pet" */], + // "/pet" + value = [PATH_ADD_PET], consumes = ["application/json", "application/xml"] ) fun addPet( @@ -44,7 +45,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_PET /* "/pet/{petId}" */] + // "/pet/{petId}" + value = [PATH_DELETE_PET] ) fun deletePet( @PathVariable("petId") petId: kotlin.Long, @@ -56,7 +58,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_STATUS /* "/pet/findByStatus" */], + // "/pet/findByStatus" + value = [PATH_FIND_PETS_BY_STATUS], produces = ["application/xml", "application/json"] ) fun findPetsByStatus( @@ -68,7 +71,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_FIND_PETS_BY_TAGS /* "/pet/findByTags" */], + // "/pet/findByTags" + value = [PATH_FIND_PETS_BY_TAGS], produces = ["application/xml", "application/json"] ) fun findPetsByTags( @@ -80,7 +84,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_PET_BY_ID /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_GET_PET_BY_ID], produces = ["application/xml", "application/json"] ) fun getPetById( @@ -92,7 +97,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_PET /* "/pet" */], + // "/pet" + value = [PATH_UPDATE_PET], consumes = ["application/json", "application/xml"] ) fun updatePet( @@ -104,7 +110,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPDATE_PET_WITH_FORM /* "/pet/{petId}" */], + // "/pet/{petId}" + value = [PATH_UPDATE_PET_WITH_FORM], consumes = ["application/x-www-form-urlencoded"] ) fun updatePetWithForm( @@ -118,7 +125,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { @RequestMapping( method = [RequestMethod.POST], - value = [PATH_UPLOAD_FILE /* "/pet/{petId}/uploadImage" */], + // "/pet/{petId}/uploadImage" + value = [PATH_UPLOAD_FILE], produces = ["application/json"], consumes = ["multipart/form-data"] ) diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt index bf0cd50235f9..e11f5598499b 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -31,7 +31,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_ORDER /* "/store/order/{orderId}" */] + // "/store/order/{orderId}" + value = [PATH_DELETE_ORDER] ) fun deleteOrder( @PathVariable("orderId") orderId: kotlin.String @@ -42,7 +43,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_INVENTORY /* "/store/inventory" */], + // "/store/inventory" + value = [PATH_GET_INVENTORY], produces = ["application/json"] ) fun getInventory(): ResponseEntity> { @@ -52,7 +54,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_ORDER_BY_ID /* "/store/order/{orderId}" */], + // "/store/order/{orderId}" + value = [PATH_GET_ORDER_BY_ID], produces = ["application/xml", "application/json"] ) fun getOrderById( @@ -64,7 +67,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic @RequestMapping( method = [RequestMethod.POST], - value = [PATH_PLACE_ORDER /* "/store/order" */], + // "/store/order" + value = [PATH_PLACE_ORDER], produces = ["application/xml", "application/json"] ) fun placeOrder( diff --git a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt index 8d2a5a070cb2..e89af2c7254b 100644 --- a/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt +++ b/samples/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -31,7 +31,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USER /* "/user" */] + // "/user" + value = [PATH_CREATE_USER] ) fun createUser( @Valid @RequestBody body: User @@ -42,7 +43,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT /* "/user/createWithArray" */] + // "/user/createWithArray" + value = [PATH_CREATE_USERS_WITH_ARRAY_INPUT] ) fun createUsersWithArrayInput( @Valid @RequestBody body: kotlin.collections.List @@ -53,7 +55,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.POST], - value = [PATH_CREATE_USERS_WITH_LIST_INPUT /* "/user/createWithList" */] + // "/user/createWithList" + value = [PATH_CREATE_USERS_WITH_LIST_INPUT] ) fun createUsersWithListInput( @Valid @RequestBody body: kotlin.collections.List @@ -64,7 +67,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.DELETE], - value = [PATH_DELETE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_DELETE_USER] ) fun deleteUser( @PathVariable("username") username: kotlin.String @@ -75,7 +79,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_GET_USER_BY_NAME /* "/user/{username}" */], + // "/user/{username}" + value = [PATH_GET_USER_BY_NAME], produces = ["application/xml", "application/json"] ) fun getUserByName( @@ -87,7 +92,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGIN_USER /* "/user/login" */], + // "/user/login" + value = [PATH_LOGIN_USER], produces = ["application/xml", "application/json"] ) fun loginUser( @@ -100,7 +106,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.GET], - value = [PATH_LOGOUT_USER /* "/user/logout" */] + // "/user/logout" + value = [PATH_LOGOUT_USER] ) fun logoutUser(): ResponseEntity { return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) @@ -109,7 +116,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) @RequestMapping( method = [RequestMethod.PUT], - value = [PATH_UPDATE_USER /* "/user/{username}" */] + // "/user/{username}" + value = [PATH_UPDATE_USER] ) fun updateUser( @PathVariable("username") username: kotlin.String, From cfcbda5cd262d49873ca434cfbc53240836a3026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Fri, 30 Jan 2026 09:56:08 +0100 Subject: [PATCH 17/21] revert unrelated formatting changes --- .../java/spring/SpringCodegenTest.java | 263 ++++++++++-------- 1 file changed, 141 insertions(+), 122 deletions(-) diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index ea9ce1bac41c..89631cb09619 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -64,7 +64,9 @@ import static org.openapitools.codegen.languages.SpringCodegen.*; import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.ANNOTATION_LIBRARY; import static org.openapitools.codegen.languages.features.DocumentationProviderFeatures.DOCUMENTATION_PROVIDER; -import static org.testng.Assert.*; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.fail; public class SpringCodegenTest { @@ -646,31 +648,31 @@ public void testInitialConfigValues() throws Exception { openAPI.setInfo(new Info()); codegen.preprocessOpenAPI(openAPI); - // Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); - // Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); +// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.HIDE_GENERATION_TIMESTAMP), Boolean.FALSE); +// Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); ConfigAssert configAssert = new ConfigAssert(codegen.additionalProperties()); - // configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); - // Assert.assertEquals(codegen.modelPackage(), "org.openapitools.model"); - // Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model"); +// configAssert.assertValue(CodegenConstants.HIDE_GENERATION_TIMESTAMP, codegen::isHideGenerationTimestamp, Boolean.FALSE); +// Assert.assertEquals(codegen.modelPackage(), "org.openapitools.model"); +// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.MODEL_PACKAGE), "org.openapitools.model"); configAssert.assertValue(CodegenConstants.MODEL_PACKAGE, codegen::modelPackage, "org.openapitools.model"); - // Assert.assertEquals(codegen.apiPackage(), "org.openapitools.api"); - // Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); +// Assert.assertEquals(codegen.apiPackage(), "org.openapitools.api"); +// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.API_PACKAGE), "org.openapitools.api"); configAssert.assertValue(CodegenConstants.API_PACKAGE, codegen::apiPackage, "org.openapitools.api"); - // Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); - // Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); +// Assert.assertEquals(codegen.getInvokerPackage(), "org.openapitools.api"); +// Assert.assertEquals(codegen.additionalProperties().get(CodegenConstants.INVOKER_PACKAGE), "org.openapitools.api"); configAssert.assertValue(CodegenConstants.INVOKER_PACKAGE, codegen::getInvokerPackage, "org.openapitools.api"); - // Assert.assertEquals(codegen.getBasePackage(), "org.openapitools"); - // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.BASE_PACKAGE), "org.openapitools"); +// Assert.assertEquals(codegen.getBasePackage(), "org.openapitools"); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.BASE_PACKAGE), "org.openapitools"); configAssert.assertValue(SpringCodegen.BASE_PACKAGE, "org.openapitools"); - // Assert.assertEquals(codegen.getConfigPackage(), "org.openapitools.configuration"); - // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.CONFIG_PACKAGE), "org.openapitools.configuration"); +// Assert.assertEquals(codegen.getConfigPackage(), "org.openapitools.configuration"); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.CONFIG_PACKAGE), "org.openapitools.configuration"); configAssert.assertValue(SpringCodegen.CONFIG_PACKAGE, "org.openapitools.configuration"); - // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.SERVER_PORT), "8082"); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.SERVER_PORT), "8082"); configAssert.assertValue(SpringCodegen.SERVER_PORT, "8082"); - // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING), false); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING), false); configAssert.assertValue(SpringCodegen.UNHANDLED_EXCEPTION_HANDLING, false); configAssert.assertValue(SpringCodegen.USE_RESPONSE_ENTITY, true); - // Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.USE_RESPONSE_ENTITY), true); +// Assert.assertEquals(codegen.additionalProperties().get(SpringCodegen.USE_RESPONSE_ENTITY), true); } @Test @@ -744,16 +746,16 @@ public void testReactiveMultipartBoot() throws IOException { // Check that the delegate handles the array JavaFileAssert.assertThat(files.get("MultipartArrayApiDelegate.java")) - .assertMethod("multipartArray", "Flux", "ServerWebExchange") - .assertParameter("files").hasType("Flux"); + .assertMethod("multipartArray", "Flux", "ServerWebExchange") + .assertParameter("files").hasType("Flux"); // Check that the api handles the array JavaFileAssert.assertThat(files.get("MultipartArrayApi.java")) - .assertMethod("multipartArray", "Flux", "ServerWebExchange") - .assertParameter("files").hasType("Flux") - .assertParameterAnnotations() - .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"Many files\"")) - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"files\"", "required", "false")); + .assertMethod("multipartArray", "Flux", "ServerWebExchange") + .assertParameter("files").hasType("Flux") + .assertParameterAnnotations() + .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"Many files\"")) + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"files\"", "required", "false")); // UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ // We will contact the contributor of the following test to see if the fix will break their use cases and @@ -764,32 +766,32 @@ public void testReactiveMultipartBoot() throws IOException { // Check that the api handles the single file JavaFileAssert.assertThat(files.get("MultipartSingleApi.java")) - .assertMethod("multipartSingle", "Part", "ServerWebExchange") - .assertParameter("file").hasType("Part") - .assertParameterAnnotations() - .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"One file\"")) - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "false")); + .assertMethod("multipartSingle", "Part", "ServerWebExchange") + .assertParameter("file").hasType("Part") + .assertParameterAnnotations() + .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"One file\"")) + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "false")); // Check that api validates mixed multipart request JavaFileAssert.assertThat(files.get("MultipartMixedApi.java")) - .assertMethod("multipartMixed", "MultipartMixedStatus", "Part", "MultipartMixedRequestMarker", "List", "ServerWebExchange") - .assertParameter("status").hasType("MultipartMixedStatus") - .assertParameterAnnotations() - .containsWithName("Valid") - .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"\"")) - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"status\"", "required", "true")) - .toParameter().toMethod() - .assertParameter("file").hasType("Part") - .assertParameterAnnotations() - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "true")) - .toParameter().toMethod() - .assertParameter("marker").hasType("MultipartMixedRequestMarker") - .assertParameterAnnotations() - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"marker\"", "required", "false")) - .toParameter().toMethod() - .assertParameter("statusArray").hasType("List") - .assertParameterAnnotations() - .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"statusArray\"", "required", "false")); + .assertMethod("multipartMixed", "MultipartMixedStatus", "Part", "MultipartMixedRequestMarker", "List", "ServerWebExchange") + .assertParameter("status").hasType("MultipartMixedStatus") + .assertParameterAnnotations() + .containsWithName("Valid") + .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"\"")) + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"status\"", "required", "true")) + .toParameter().toMethod() + .assertParameter("file").hasType("Part") + .assertParameterAnnotations() + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "true")) + .toParameter().toMethod() + .assertParameter("marker").hasType("MultipartMixedRequestMarker") + .assertParameterAnnotations() + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"marker\"", "required", "false")) + .toParameter().toMethod() + .assertParameter("statusArray").hasType("List") + .assertParameterAnnotations() + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"statusArray\"", "required", "false")); } @Test @@ -915,6 +917,7 @@ public void shouldApiNameSuffixForApiClassname() throws IOException { codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); + ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -947,6 +950,7 @@ public void shouldUseTagsForClassname() throws IOException { codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); + ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -980,6 +984,7 @@ public void shouldNotUseTagsForClassname() throws IOException { codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); + ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -1167,7 +1172,7 @@ private Map generateFiles(SpringCodegen codegen, String filePath) generator.setGenerateMetadata(false); // skip metadata generation List files = generator.opts(input).generate(); - return files.stream().sorted().collect(Collectors.toMap(e -> e.getName().replace(outputPath, ""), i -> i)); + return files.stream().collect(Collectors.toMap(e -> e.getName().replace(outputPath, ""), i -> i)); } /* @@ -1300,6 +1305,7 @@ public void testGenerationOfClientPropertiesConfigurationForOAuth() throws Excep Path filePath = Paths.get(output.getAbsolutePath(), "src/main/java/org/openapitools/configuration/ClientPropertiesConfiguration.java"); + assertFileContains(filePath, "oAuth2AccessCode.put(\"spring.security.oauth2.client.registration.oAuth2AccessCode.redirect-uri\", \"set-oAuth2AccessCode-redirect-uri\" );", "oAuth2AccessCode.put(\"spring.security.oauth2.client.registration.oAuth2AccessCode.authorization-grant-type\", \"authorization_code\" );", @@ -1308,6 +1314,7 @@ public void testGenerationOfClientPropertiesConfigurationForOAuth() throws Excep "oAuth2AccessCode.put(\"spring.security.oauth2.client.provider.oAuth2AccessCode.token-uri\", \"${tokenUrl}\" );", "oAuth2AccessCode.put(\"spring.security.oauth2.client.provider.oAuth2AccessCode.authorization-uri\", \"${authorizationUrl}\" );", + "oAuth2Application.put(\"spring.security.oauth2.client.registration.oAuth2Application.client-id\", \"set-oAuth2Application-client-id\" );", "oAuth2Application.put(\"spring.security.oauth2.client.registration.oAuth2Application.authorization-grant-type\", \"client_credentials\" );", "oAuth2Application.put(\"spring.security.oauth2.client.provider.oAuth2Application.token-uri\", \"/openid-connect/token\" );" @@ -1367,8 +1374,7 @@ private void beanValidationForFormatEmail(boolean useBeanValidation, boolean per JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(files.get("PersonWithEmail.java")); if (useBeanValidation) javaFileAssert.hasImports((useJakarta ? "jakarta" : "javax") + ".validation.constraints"); - if (performBeanValidation) - javaFileAssert.hasImports("org.hibernate.validator.constraints"); + if (performBeanValidation) javaFileAssert.hasImports("org.hibernate.validator.constraints"); JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/PersonWithEmail.java")) .fileContains(contains) .fileDoesNotContain(notContains); @@ -1843,6 +1849,7 @@ public void testDiscriminatorWithMappingIssue14731() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); + codegen.setUseOneOfInterfaces(true); codegen.setLegacyDiscriminatorBehavior(false); codegen.setUseSpringBoot3(true); @@ -1879,6 +1886,7 @@ public void testDiscriminatorWithoutMappingIssue14731() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.setGeneratorPropertyDefault(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "false"); + codegen.setUseOneOfInterfaces(true); codegen.setLegacyDiscriminatorBehavior(false); codegen.setUseSpringBoot3(true); @@ -1886,6 +1894,7 @@ public void testDiscriminatorWithoutMappingIssue14731() throws IOException { generator.opts(input).generate(); + assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/ChildWithoutMappingADTO.java"), "@JsonTypeName"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/ChildWithoutMappingBDTO.java"), "@JsonTypeName"); } @@ -1982,23 +1991,23 @@ public void shouldGenerateOneTagAttributeForMultipleTags_Regression11464(String @DataProvider public Object[][] issue11464TestCases() { - return new Object[][] { - { DocumentationProviderFeatures.DocumentationProvider.SPRINGDOC.name(), (Consumer) outputPath -> { + return new Object[][]{ + {DocumentationProviderFeatures.DocumentationProvider.SPRINGDOC.name(), (Consumer) outputPath -> { assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/NoneApi.java"), "@Operation( operationId = \"getNone\", summary = \"No Tag\", responses = {"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SingleApi.java"), "@Operation( operationId = \"getSingleTag\", summary = \"Single Tag\", tags = { \"tag1\" }, responses = {"); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/MultipleApi.java"), "@Operation( operationId = \"getMultipleTags\", summary = \"Multiple Tags\", tags = { \"tag1\", \"tag2\" }, responses = {"); - } }, - { DocumentationProviderFeatures.DocumentationProvider.SPRINGFOX.name(), (Consumer) outputPath -> { + }}, + {DocumentationProviderFeatures.DocumentationProvider.SPRINGFOX.name(), (Consumer) outputPath -> { assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/NoneApi.java"), "@ApiOperation( value = \"No Tag\", nickname = \"getNone\", notes = \"\", response = "); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/SingleApi.java"), "@ApiOperation( tags = { \"tag1\" }, value = \"Single Tag\", nickname = \"getSingleTag\", notes = \"\", response = "); assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/api/MultipleApi.java"), "@ApiOperation( tags = { \"tag1\", \"tag2\" }, value = \"Multiple Tags\", nickname = \"getMultipleTags\", notes = \"\", response = "); - } }, + }}, }; } @@ -2328,6 +2337,7 @@ public void paramObjectImportForDifferentSpringBootVersions_issue14077() throws .assertParameterAnnotations() .containsWithName("ParameterObject"); + // different import for SB3 additionalProperties.put(USE_SPRING_BOOT3, "true"); files = generateFromContract("src/test/resources/2_0/petstore-with-spring-pageable.yaml", SPRING_BOOT, additionalProperties); @@ -2360,43 +2370,43 @@ public void paramPageableIsNotSpringPaginated_issue13052() throws Exception { @DataProvider(name = "sealedScenarios") public static Object[][] sealedScenarios() { - return new Object[][] { - { "oneof_polymorphism_and_inheritance.yaml", Map.of( + return new Object[][]{ + {"oneof_polymorphism_and_inheritance.yaml", Map.of( "Foo.java", "public final class Foo extends Entity implements FooRefOrValue", "FooRef.java", "public final class FooRef extends EntityRef implements FooRefOrValue", "FooRefOrValue.java", "public sealed interface FooRefOrValue permits Foo, FooRef ", - "Entity.java", "public sealed class Entity extends RepresentationModel permits Bar, BarCreate, Foo, Pasta, Pizza {") }, - { "oneOf_additionalProperties.yaml", Map.of( + "Entity.java", "public sealed class Entity extends RepresentationModel permits Bar, BarCreate, Foo, Pasta, Pizza {")}, + {"oneOf_additionalProperties.yaml", Map.of( "SchemaA.java", "public final class SchemaA extends RepresentationModel implements PostRequest {", - "PostRequest.java", "public sealed interface PostRequest permits SchemaA {") }, - { "oneOf_array.yaml", Map.of( - "MyExampleGet200Response.java", "public sealed interface MyExampleGet200Response") }, - { "oneOf_duplicateArray.yaml", Map.of( - "Example.java", "public interface Example {") }, - { "oneOf_nonPrimitive.yaml", Map.of( - "Example.java", "public interface Example {") }, - { "oneOf_primitive.yaml", Map.of( + "PostRequest.java", "public sealed interface PostRequest permits SchemaA {")}, + {"oneOf_array.yaml", Map.of( + "MyExampleGet200Response.java", "public sealed interface MyExampleGet200Response")}, + {"oneOf_duplicateArray.yaml", Map.of( + "Example.java", "public interface Example {")}, + {"oneOf_nonPrimitive.yaml", Map.of( + "Example.java", "public interface Example {")}, + {"oneOf_primitive.yaml", Map.of( "Child.java", "public final class Child extends RepresentationModel implements Example {", - "Example.java", "public sealed interface Example permits Child {") }, - { "oneOf_primitiveAndArray.yaml", Map.of( - "Example.java", "public interface Example {") }, - { "oneOf_reuseRef.yaml", Map.of( + "Example.java", "public sealed interface Example permits Child {")}, + {"oneOf_primitiveAndArray.yaml", Map.of( + "Example.java", "public interface Example {")}, + {"oneOf_reuseRef.yaml", Map.of( "Fruit.java", "public sealed interface Fruit permits Apple, Banana {", "Banana.java", "public final class Banana extends RepresentationModel implements Fruit {", - "Apple.java", "public final class Apple extends RepresentationModel implements Fruit {") }, - { "oneOf_twoPrimitives.yaml", Map.of( - "MyExamplePostRequest.java", "public interface MyExamplePostRequest {") }, - { "oneOfArrayMapImport.yaml", Map.of( + "Apple.java", "public final class Apple extends RepresentationModel implements Fruit {")}, + {"oneOf_twoPrimitives.yaml", Map.of( + "MyExamplePostRequest.java", "public interface MyExamplePostRequest {")}, + {"oneOfArrayMapImport.yaml", Map.of( "Fruit.java", "public interface Fruit {", "Grape.java", "public final class Grape extends RepresentationModel {", - "Apple.java", "public final class Apple extends RepresentationModel {") }, - { "oneOfDiscriminator.yaml", Map.of( + "Apple.java", "public final class Apple extends RepresentationModel {")}, + {"oneOfDiscriminator.yaml", Map.of( "FruitAllOfDisc.java", "public sealed interface FruitAllOfDisc permits AppleAllOfDisc, BananaAllOfDisc {", "AppleAllOfDisc.java", "public final class AppleAllOfDisc extends RepresentationModel implements FruitAllOfDisc {", "BananaAllOfDisc.java", "public final class BananaAllOfDisc extends RepresentationModel implements FruitAllOfDisc {", "FruitReqDisc.java", "public sealed interface FruitReqDisc permits AppleReqDisc, BananaReqDisc {", "AppleReqDisc.java", "public final class AppleReqDisc extends RepresentationModel implements FruitReqDisc {", - "BananaReqDisc.java", "public final class BananaReqDisc extends RepresentationModel implements FruitReqDisc {") } + "BananaReqDisc.java", "public final class BananaReqDisc extends RepresentationModel implements FruitReqDisc {")} }; } @@ -2508,8 +2518,8 @@ public void shouldGenerateDiscriminatorFromAllOfWhenUsingLegacyDiscriminatorBeha String jsonTypeInfo = "@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = \"type\", visible = true)"; String jsonSubType = "@JsonSubTypes({\n" + - " @JsonSubTypes.Type(value = Cat.class, name = \"cat\")" + - "})"; + " @JsonSubTypes.Type(value = Cat.class, name = \"cat\")" + + "})"; assertFileContains(output.get("Pet.java").toPath(), jsonTypeInfo, jsonSubType); } @@ -2581,9 +2591,9 @@ public void requiredFieldShouldIncludeNotNullAnnotation_issue13365() throws IOEx javaFileAssert.assertMethod("getName").assertMethodAnnotations() .containsWithName("NotNull").anyMatch(annotation -> !annotation.getNameAsString().equals("Valid") || - !annotation.getNameAsString().equals("Pattern") || - !annotation.getNameAsString().equals("Email") || - !annotation.getNameAsString().equals("Size")); + !annotation.getNameAsString().equals("Pattern") || + !annotation.getNameAsString().equals("Email") || + !annotation.getNameAsString().equals("Size")); javaFileAssert.hasImports("javax.validation.constraints.NotNull"); } @@ -2610,9 +2620,9 @@ public void requiredFieldShouldIncludeNotNullAnnotationJakarta_issue13365_issue1 javaFileAssert.assertMethod("getName").assertMethodAnnotations() .containsWithName("NotNull").anyMatch(annotation -> !annotation.getNameAsString().equals("Valid") || - !annotation.getNameAsString().equals("Pattern") || - !annotation.getNameAsString().equals("Email") || - !annotation.getNameAsString().equals("Size")); + !annotation.getNameAsString().equals("Pattern") || + !annotation.getNameAsString().equals("Email") || + !annotation.getNameAsString().equals("Size")); javaFileAssert.hasImports("jakarta.validation.constraints.NotNull"); } @@ -2946,7 +2956,7 @@ private Map generateFromContract(String url, String library, Map generateFromContract(String url, String library, Map additionalProperties, - Consumer consumer) throws IOException { + Consumer consumer) throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); output.deleteOnExit(); @@ -3000,8 +3010,8 @@ public void testMappingSubtypesIssue13150() throws IOException { generator.opts(input).generate(); String jsonSubType = "@JsonSubTypes({\n" + - " @JsonSubTypes.Type(value = Foo.class, name = \"foo\")\n" + - "})"; + " @JsonSubTypes.Type(value = Foo.class, name = \"foo\")\n" + + "})"; assertFileContains(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Parent.java"), jsonSubType); } @@ -3691,6 +3701,7 @@ public void doCallFluentParentSettersFromChildModel() throws IOException { generator.setGenerateMetadata(false); // skip metadata generation generator.opts(input).generate(); + JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) // Fluent method assertions .assertMethod("alias") @@ -3747,6 +3758,7 @@ public void testModelsWithNoneOptionalAndJsonNullable() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.opts(input).generate(); + JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") @@ -3962,6 +3974,7 @@ public void testModelsWithOptionalAndJsonNullable() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.opts(input).generate(); + JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") @@ -4177,6 +4190,7 @@ public void testModelsWithOptionalAndNoneJsonNullable() throws IOException { generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); generator.opts(input).generate(); + JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") @@ -4411,6 +4425,7 @@ public void testModelsWithNoneOptionalAndNoneOpenApiNullable() throws IOExceptio generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); generator.opts(input).generate(); + JavaFileAssert javaFileAssert = JavaFileAssert.assertThat(Paths.get(outputPath + "/src/main/java/org/openapitools/model/Animal.java")) .hasImports("jakarta.validation.Valid") .hasImports("jakarta.validation.constraints") @@ -4686,6 +4701,7 @@ private void assertMethod(JavaFileAssert javaFileAssert, Class type, String e assertMethod(javaFileAssert, type.getSimpleName(), expectedName); } + @Test public void multiLineOperationDescription() throws IOException { Map additionalProperties = new HashMap<>(); @@ -5086,6 +5102,7 @@ public void optionalListShouldBeEmpty() throws IOException { codegen.additionalProperties().put(CodegenConstants.API_PACKAGE, "xyz.controller"); codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); + ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -5119,6 +5136,7 @@ public void testCollectionTypesWithDefaults_issue_18102() throws IOException { codegen.additionalProperties().put(CodegenConstants.MODEL_NAME_SUFFIX, "Dto"); codegen.setContainerDefaultToNull(true); + ClientOptInput input = new ClientOptInput() .openAPI(openAPI) .config(codegen); @@ -5377,14 +5395,14 @@ public void shouldAnnotateNonRequiredFieldsAsNullable() throws IOException { JavaFileAssert.assertThat(file) .fileContains( "public Item(" + - "String mandatoryName," + - " @Nullable String optionalDescription," + - " String optionalOneWithDefault," + - " String nullableStr," + - " List mandatoryContainer," + - " List optionalContainer," + - " List optionalContainerWithDefault," + - " List nullableContainer)" + "String mandatoryName," + + " @Nullable String optionalDescription," + + " String optionalOneWithDefault," + + " String nullableStr," + + " List mandatoryContainer," + + " List optionalContainer," + + " List optionalContainerWithDefault," + + " List nullableContainer)" ); } @@ -5413,9 +5431,9 @@ public void shouldAnnotateNonRequiredFieldsAsNullableWhenSetContainerDefaultToNu JavaFileAssert.assertThat(file) .fileContains( ", List mandatoryContainer," + - " @Nullable List optionalContainer," + - " List optionalContainerWithDefault," + - " List nullableContainer)" + " @Nullable List optionalContainer," + + " List optionalContainerWithDefault," + + " List nullableContainer)" ); } @@ -5444,7 +5462,7 @@ public void shouldNotAnnotateNonRequiredFieldsAsNullableWhileUseOptional() throw JavaFileAssert.assertThat(file) .fileContains( "public Item(String mandatoryName, String optionalDescription," + - " String optionalOneWithDefault, String nullableStr" + " String optionalOneWithDefault, String nullableStr" ); } @@ -5487,9 +5505,9 @@ public void shouldAnnotateNonRequiredFieldsAsNullableWhileNotUsingOpenApiNullabl JavaFileAssert.assertThat(file) .fileContains( " List mandatoryContainer," + - " @Nullable List optionalContainer," + - " List optionalContainerWithDefault," + - " @Nullable List nullableContainer)" + " @Nullable List optionalContainer," + + " List optionalContainerWithDefault," + + " @Nullable List nullableContainer)" ); } @@ -5565,6 +5583,7 @@ public void givenMultipartForm_whenGenerateUsingOptional_thenParameterAreCreated input.openAPI(openAPI); input.config(codegen); + DefaultGenerator generator = new DefaultGenerator(); generator.setGenerateMetadata(false); generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); @@ -6081,11 +6100,11 @@ public void testXMinimumMessageAndXMaximumMessage_long() throws IOException { .assertParameter("number") .assertParameterAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of( - "value", "1L", + "value", "1L", "message", "\"Must be positive\"" )) .containsWithNameAndAttributes("Max", ImmutableMap.of( - "value", "99L", + "value", "99L", "message", "\"Must be less than 100\"" )) .toParameter() @@ -6093,11 +6112,11 @@ public void testXMinimumMessageAndXMaximumMessage_long() throws IOException { .assertParameter("token") .assertParameterAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of( - "value", "1L", + "value", "1L", "message", "\"Must be positive\"" )) .containsWithNameAndAttributes("Max", ImmutableMap.of( - "value", "99L", + "value", "99L", "message", "\"Must be less than 100\"" )) .toParameter() @@ -6105,22 +6124,22 @@ public void testXMinimumMessageAndXMaximumMessage_long() throws IOException { .assertParameter("clientNumber") .assertParameterAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of( - "value", "1L", + "value", "1L", "message", "\"Must be positive\"" )) .containsWithNameAndAttributes("Max", ImmutableMap.of( - "value", "99L", + "value", "99L", "message", "\"Must be less than 100\"" )); JavaFileAssert.assertThat(files.get("LongTest.java")) .assertMethod("getField1") .assertMethodAnnotations() .containsWithNameAndAttributes("Min", ImmutableMap.of( - "value", "1L", + "value", "1L", "message", "\"Must be positive\"" )) .containsWithNameAndAttributes("Max", ImmutableMap.of( - "value", "99L", + "value", "99L", "message", "\"Must be less than 100\"" )) .toMethod() @@ -6149,19 +6168,19 @@ public void annotationLibraryDoesNotCauseImportConflictsInSpring() throws IOExce codegen.additionalProperties().putAll(properties); ClientOptInput input = new ClientOptInput() - .openAPI(openAPI) - .config(codegen); + .openAPI(openAPI) + .config(codegen); DefaultGenerator generator = new DefaultGenerator(); Map files = generator.opts(input).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + .collect(Collectors.toMap(File::getName, Function.identity())); File apiFile = files.get("Schema.java"); assertNotNull(apiFile); JavaFileAssert.assertThat(apiFile).fileDoesNotContain( - "import io.swagger.v3.oas.annotations.media.Schema;" + "import io.swagger.v3.oas.annotations.media.Schema;" ); } @@ -6183,19 +6202,19 @@ public void annotationLibraryDoesNotCauseImportConflictsInSpringWithAnnotationLi codegen.additionalProperties().putAll(properties); ClientOptInput input = new ClientOptInput() - .openAPI(openAPI) - .config(codegen); + .openAPI(openAPI) + .config(codegen); DefaultGenerator generator = new DefaultGenerator(); Map files = generator.opts(input).generate().stream() - .collect(Collectors.toMap(File::getName, Function.identity())); + .collect(Collectors.toMap(File::getName, Function.identity())); File apiFile = files.get("Schema.java"); assertNotNull(apiFile); JavaFileAssert.assertThat(apiFile).fileContains( - "import io.swagger.v3.oas.annotations.media.Schema;" + "import io.swagger.v3.oas.annotations.media.Schema;" ); } @@ -6235,7 +6254,7 @@ public void testExtensionsOnSchema_issue9183() throws IOException { .containsWithNameAndAttributes("Pattern", ImmutableMap.of( "regexp", "\"[a-zA-Z]\"", "message", "\"Only letters\"" - )) + )) .toParameter() .toMethod() .assertParameter("token") @@ -6243,7 +6262,7 @@ public void testExtensionsOnSchema_issue9183() throws IOException { .containsWithNameAndAttributes("Pattern", ImmutableMap.of( "regexp", "\"[0-9a-fA-F]\"", "message", "\"Only numbers and letters a-f\"" - )); + )); } } From 46fdca701deb0b09cddcc998446ca22a2d094177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Fri, 30 Jan 2026 10:56:21 +0100 Subject: [PATCH 18/21] nudge test rerun --- bin/configs/spring-boot-x-implements-skip.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/configs/spring-boot-x-implements-skip.yaml b/bin/configs/spring-boot-x-implements-skip.yaml index 517a74bd9959..829c029bc015 100644 --- a/bin/configs/spring-boot-x-implements-skip.yaml +++ b/bin/configs/spring-boot-x-implements-skip.yaml @@ -12,4 +12,4 @@ additionalProperties: xImplementsSkip: [ com.custompackage.InterfaceToSkip ] schemaImplements: Foo: [ com.custompackage.WithBar, com.custompackage.WithDefaultMethod ] - Animal: com.custompackage.WithColor + Animal: com.custompackage.WithColor \ No newline at end of file From 55e519a673f909e0b02eb71fc81aefe432902ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Fri, 30 Jan 2026 13:45:59 +0100 Subject: [PATCH 19/21] implement feedback from CR --- .../openapitools/codegen/DefaultCodegen.java | 16 ++++++++-- .../languages/AbstractJavaCodegen.java | 32 +++++++++++++------ 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index dec9e566da15..d83cdef420cf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -7142,6 +7142,10 @@ public void setIgnoreFilePathOverride(final String ignoreFileOverride) { public List getPropertyAsStringList(String propertyKey) { final Object value = additionalProperties.get(propertyKey); + return getObjectAsStringList(value); + } + + public static List getObjectAsStringList(Object value) { if (value instanceof List) { List list = (List) value; List stringList = new ArrayList<>(); @@ -7159,10 +7163,14 @@ public List getPropertyAsStringList(String propertyKey) { public Map getPropertyAsStringMap(String propertyKey) { final Object value = additionalProperties.get(propertyKey); + return getObjectAsStringMap(value); + } + + public static Map getObjectAsStringMap(Object value) { if (value instanceof Map) { Map rawMap = (Map) value; Map stringMap = new HashMap<>(); - for (Map.Entry entry : rawMap.entrySet()) { + for (Entry entry : rawMap.entrySet()) { stringMap.put(String.valueOf(entry.getKey()), String.valueOf(entry.getValue())); } return stringMap; @@ -7172,10 +7180,14 @@ public Map getPropertyAsStringMap(String propertyKey) { public Map> getPropertyAsStringListMap(String propertyKey) { final Object value = additionalProperties.get(propertyKey); + return getObjectAsStringListMap(value); + } + + public static Map> getObjectAsStringListMap(Object value) { if (value instanceof Map) { Map rawMap = (Map) value; Map> stringMap = new HashMap<>(); - for (Map.Entry entry : rawMap.entrySet()) { + for (Entry entry : rawMap.entrySet()) { Object entryValue = entry.getValue(); if (entryValue instanceof List) { List stringList = ((List) entryValue).stream() diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 6be8566720a9..d4c2f10af78d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -2012,13 +2012,23 @@ public ModelsMap postProcessModels(ModelsMap objs) { listIterator.add(newImportMap); } } + // make sure the x-implements is always a List and always at least empty + for (ModelMap mo : objs.getModels()) { + CodegenModel cm = mo.getModel(); + if (cm.getVendorExtensions().containsKey(X_IMPLEMENTS)) { + List xImplements = getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS)); + cm.getVendorExtensions().replace(X_IMPLEMENTS, xImplements); + } else { + cm.getVendorExtensions().put(X_IMPLEMENTS, new ArrayList()); + } + } // skip interfaces predefined in open api spec in x-implements via additional property xImplementsSkip if (!this.xImplementsSkip.isEmpty()) { for (ModelMap mo : objs.getModels()) { CodegenModel cm = mo.getModel(); - if (cm.getVendorExtensions().containsKey(X_IMPLEMENTS)) { - List xImplementsInModelOriginal = (List) cm.getVendorExtensions().get(X_IMPLEMENTS); + if (!getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS)).isEmpty()) { + List xImplementsInModelOriginal = getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS)); List xImplementsInModelSkipped = xImplementsInModelOriginal .stream() .filter(o -> this.xImplementsSkip.contains(o)) @@ -2040,8 +2050,7 @@ public ModelsMap postProcessModels(ModelsMap objs) { CodegenModel cm = mo.getModel(); if (this.schemaImplements.containsKey(cm.getSchemaName())) { LOGGER.info("Adding interface(s) {} configured via config option '{}' to model {}", this.schemaImplements.get(cm.getSchemaName()), SCHEMA_IMPLEMENTS, cm.classname); - cm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList()); - List xImplementsInModel = (List) cm.getVendorExtensions().get(X_IMPLEMENTS); + List xImplementsInModel = getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS)); List schemaImplements = this.schemaImplements.get(cm.getSchemaName()); List combinedSchemaImplements = Stream.concat(xImplementsInModel.stream(), schemaImplements.stream()) .collect(Collectors.toList()); @@ -2051,12 +2060,15 @@ public ModelsMap postProcessModels(ModelsMap objs) { } } - // add x-implements for serializable to all models - for (ModelMap mo : objs.getModels()) { - CodegenModel cm = mo.getModel(); - if (this.serializableModel) { - cm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList()); - ((ArrayList) cm.getVendorExtensions().get(X_IMPLEMENTS)).add("Serializable"); + // add Serializable to x-implements to all models if configured + if (this.serializableModel) { + for (ModelMap mo : objs.getModels()) { + CodegenModel cm = mo.getModel(); + List xImplements = new ArrayList<>(getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS))); + if (!xImplements.contains("Serializable")) { + xImplements.add("Serializable"); + } + cm.getVendorExtensions().replace(X_IMPLEMENTS, xImplements); } } From 67dd492c116738bd08607e126dffa4952acead58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Fri, 30 Jan 2026 15:04:52 +0100 Subject: [PATCH 20/21] check compilation success --- .github/workflows/samples-jdk17.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/samples-jdk17.yaml b/.github/workflows/samples-jdk17.yaml index c12c38982375..5375c61f6b55 100644 --- a/.github/workflows/samples-jdk17.yaml +++ b/.github/workflows/samples-jdk17.yaml @@ -14,6 +14,7 @@ on: - samples/client/petstore/java/microprofile-rest-client-outer-enum/** # servers - samples/openapi3/server/petstore/springboot-3/** + - samples/server/petstore/springboot-x-implements-skip/** - samples/server/petstore/java-camel/** - samples/server/petstore/java-helidon-server/v3/mp/** - samples/server/petstore/java-helidon-server/v3/se/** @@ -31,6 +32,7 @@ on: - samples/client/petstore/java/microprofile-rest-client-outer-enum/** # servers - samples/openapi3/server/petstore/springboot-3/** + - samples/server/petstore/springboot-x-implements-skip/** - samples/server/petstore/java-camel/** - samples/server/petstore/java-helidon-server/v3/mp/** - samples/server/petstore/java-helidon-server/v3/se/** From 9d6f0822f869083b878b51068acf8085e2541789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Fri, 30 Jan 2026 15:59:43 +0100 Subject: [PATCH 21/21] fix interfaces --- .../com/custompackage/InterfaceToKeep.java | 28 ++---------------- .../main/java/com/custompackage/WithBar.java | 29 ++----------------- .../java/com/custompackage/WithColor.java | 29 ++----------------- .../com/custompackage/WithDefaultMethod.java | 29 ++----------------- 4 files changed, 8 insertions(+), 107 deletions(-) diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/InterfaceToKeep.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/InterfaceToKeep.java index 0de312edd533..a6f5bf03fd0d 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/InterfaceToKeep.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/InterfaceToKeep.java @@ -1,30 +1,6 @@ -package org.openapitools.model; +package com.custompackage; -import java.net.URI; -import java.util.Objects; +public interface InterfaceToKeep { -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import org.springframework.lang.Nullable; - -import org.openapitools.jackson.nullable.JsonNullable; - -import java.time.OffsetDateTime; - -import javax.validation.Valid; -import javax.validation.constraints.*; - -import java.util.*; - -import javax.annotation.Generated; - -interface InterfaceToKeep { } diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithBar.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithBar.java index 3068cf2c900e..e53e7b5adf09 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithBar.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithBar.java @@ -1,31 +1,6 @@ -package org.openapitools.model; +package com.custompackage; -import java.net.URI; -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import org.springframework.lang.Nullable; - -import org.openapitools.jackson.nullable.JsonNullable; - -import java.time.OffsetDateTime; - -import javax.validation.Valid; -import javax.validation.constraints.*; - -import java.util.*; - -import javax.annotation.Generated; - -interface WithBar { +public interface WithBar { public String getBar(); diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithColor.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithColor.java index 4c940fad8653..02a6450c0c17 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithColor.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithColor.java @@ -1,31 +1,6 @@ -package org.openapitools.model; +package com.custompackage; -import java.net.URI; -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import org.springframework.lang.Nullable; - -import org.openapitools.jackson.nullable.JsonNullable; - -import java.time.OffsetDateTime; - -import javax.validation.Valid; -import javax.validation.constraints.*; - -import java.util.*; - -import javax.annotation.Generated; - -interface WithColor { +public interface WithColor { public String getColor(); diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithDefaultMethod.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithDefaultMethod.java index 7666587e7c9c..57c24380ecb1 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithDefaultMethod.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/com/custompackage/WithDefaultMethod.java @@ -1,31 +1,6 @@ -package org.openapitools.model; +package com.custompackage; -import java.net.URI; -import java.util.Objects; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -import org.springframework.lang.Nullable; - -import org.openapitools.jackson.nullable.JsonNullable; - -import java.time.OffsetDateTime; - -import javax.validation.Valid; -import javax.validation.constraints.*; - -import java.util.*; - -import javax.annotation.Generated; - -interface WithDefaultMethod { +public interface WithDefaultMethod { default String greet(String name) { return "Hello, " + name + "!";