[JAVA-SPRING;KOTLIN-SPRING] - add possibility to override x-implements and x-kotlin-implements via config options. (#22839)

* feature/add-skip-x-implements

* feature/add-skip-x-implements

* feature/add-x-implements-overrides support in tooling

* add basic unit test for x-implements and x-implements-overrides

* add implementation and unit test for schemaImplements

* add "java.io.Serializable" directly via x-kotlin-implements

* add schemaImplements and schemaImplementsFields support to kotlin-spring

* add xImplementsSkip additional property

* add xKotlinImplementsSkip and xKotlinImplementsFieldsSkip additional properties

* add unit tests

* add documentation

* commit changes and add missing interface

* add documentation

* add output to samples

* change logs

* fix issue #22756

* revert unrelated formatting changes

* nudge test rerun

* implement feedback from CR

* check compilation success

* fix interfaces
This commit is contained in:
Jachym Metlicka
2026-02-04 08:57:00 +01:00
committed by GitHub
parent 40a0f6f83d
commit 3ecb49060e
293 changed files with 16388 additions and 845 deletions

View File

@@ -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/**
@@ -54,6 +56,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

View File

@@ -13,3 +13,14 @@ 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 ]
xKotlinImplementsSkip: [ com.some.pack.WithPhotoUrls ]
xKotlinImplementsFieldsSkip:
Pet: [ photoUrls ]

View File

@@ -0,0 +1,15 @@
generatorName: spring
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:
documentationProvider: springfox
artifactId: springboot
snapshotVersion: "true"
hideGenerationTimestamp: "true"
camelCaseDollarSign: "true"
modelNameSuffix: 'Dto'
xImplementsSkip: [ com.custompackage.InterfaceToSkip ]
schemaImplements:
Foo: [ com.custompackage.WithBar, com.custompackage.WithDefaultMethod ]
Animal: com.custompackage.WithColor

View File

@@ -87,6 +87,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|
@@ -118,6 +119,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

View File

@@ -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.|<dl><dt>**api_interface**</dt><dd>Generate the @RequestMapping annotation on the generated Api Interface.</dd><dt>**controller**</dt><dd>Generate the @RequestMapping annotation on the generated Api Controller Implementation.</dd><dt>**none**</dt><dd>Do not add a class level @RequestMapping annotation.</dd></dl>|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 &quot;implements Serializable&quot; 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 &ge; 3 (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

View File

@@ -80,6 +80,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|
@@ -111,6 +112,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

View File

@@ -112,6 +112,10 @@ public class CliOption {
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);

View File

@@ -94,8 +94,11 @@ import static org.openapitools.codegen.utils.OnceLogger.once;
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
public static FeatureSet DefaultFeatureSet;
// A cache of sanitized words. The sanitizeName() method is invoked many times with the same
@@ -190,15 +193,20 @@ public class DefaultCodegen implements CodegenConfig {
protected Map<String, String> operationIdNameMapping = new HashMap<>();
// a map to store the rules in OpenAPI Normalizer
protected Map<String, String> 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.
@@ -210,7 +218,8 @@ public class DefaultCodegen implements CodegenConfig {
protected Map<String, String> apiDocTemplateFiles = new HashMap<>();
protected Map<String, String> modelDocTemplateFiles = new HashMap<>();
protected Map<String, String> reservedWordsMappings = new HashMap<>();
@Setter protected String templateDir;
@Setter
protected String templateDir;
protected String embeddedTemplateDir;
protected Map<String, Object> additionalProperties = new HashMap<>();
protected Map<String, String> serverVariables = new HashMap<>();
@@ -225,9 +234,11 @@ public class DefaultCodegen implements CodegenConfig {
protected List<CliOption> 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
@@ -262,13 +273,17 @@ public class DefaultCodegen implements CodegenConfig {
protected boolean supportsMixins;
protected Map<String, String> 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;
@@ -279,7 +294,8 @@ public class DefaultCodegen implements CodegenConfig {
protected Map<String, String> specialCharReplacements = new LinkedHashMap<>();
// When a model is an alias for a simple type
protected Map<String, String> 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;
@@ -302,15 +318,18 @@ public class DefaultCodegen implements CodegenConfig {
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
@@ -333,11 +352,18 @@ public class DefaultCodegen implements CodegenConfig {
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();
@@ -572,7 +598,7 @@ public class DefaultCodegen implements CodegenConfig {
? 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));
}
/**
@@ -716,7 +742,7 @@ public class DefaultCodegen implements CodegenConfig {
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;
}
@@ -758,7 +784,7 @@ public class DefaultCodegen implements CodegenConfig {
}
private void setCircularReferencesOnProperties(final String root,
final Map<String, List<CodegenProperty>> dependencyMap) {
final Map<String, List<CodegenProperty>> dependencyMap) {
dependencyMap.getOrDefault(root, new ArrayList<>())
.forEach(prop -> {
final List<String> unvisited =
@@ -771,9 +797,9 @@ public class DefaultCodegen implements CodegenConfig {
}
private boolean isCircularReference(final String root,
final Set<String> visited,
final List<String> unvisited,
final Map<String, List<CodegenProperty>> dependencyMap) {
final Set<String> visited,
final List<String> unvisited,
final Map<String, List<CodegenProperty>> dependencyMap) {
for (int i = 0; i < unvisited.size(); i++) {
final String next = unvisited.get(i);
if (!visited.contains(next)) {
@@ -1162,7 +1188,6 @@ public class DefaultCodegen implements CodegenConfig {
return escapeText(input).replace("'", "\\'");
}
/**
* Escape characters while allowing new lines
*
@@ -1206,7 +1231,7 @@ public class DefaultCodegen implements CodegenConfig {
@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
@@ -1223,7 +1248,7 @@ public class DefaultCodegen implements CodegenConfig {
@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("\"", "\\\"");
}
@@ -1801,7 +1826,8 @@ public class DefaultCodegen implements CodegenConfig {
CliOption legacyDiscriminatorBehaviorOpt = CliOption.newBoolean(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR_DESC).defaultValue(Boolean.TRUE.toString());
Map<String, String> 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);
@@ -2285,7 +2311,6 @@ public class DefaultCodegen implements CodegenConfig {
}
protected Schema<?> getSchemaAdditionalProperties(Schema schema) {
Schema<?> inner = ModelUtils.getAdditionalProperties(schema);
if (inner == null) {
@@ -2359,7 +2384,7 @@ public class DefaultCodegen implements CodegenConfig {
return ModelUtils.unaliasSchema(this.openAPI, schema, schemaMapping);
}
private List<Map<String, Object>> unaliasExamples(Map<String, Example> examples){
private List<Map<String, Object>> unaliasExamples(Map<String, Example> examples) {
return ExamplesUtils.unaliasExamples(this.openAPI, examples);
}
@@ -2631,6 +2656,7 @@ public class DefaultCodegen implements CodegenConfig {
}
private static class NamedSchema {
private NamedSchema(String name, Schema s, boolean required, boolean schemaIsFromAdditionalProperties) {
this.name = name;
this.schema = s;
@@ -2645,13 +2671,15 @@ public class DefaultCodegen implements CodegenConfig {
@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
@@ -2673,7 +2701,7 @@ public class DefaultCodegen implements CodegenConfig {
if (composed.getProperties() != null && !composed.getProperties().isEmpty()) {
if (composed.getOneOf() != null && !composed.getOneOf().isEmpty()) {
LOGGER.warn("'oneOf' is intended to include only the additional optional OAS extension discriminator object. " +
"For more details, see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'.");
"For more details, see https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.9.2.1.3 and the OAS section on 'Composition and Inheritance'.");
}
addVars(m, unaliasPropertySchema(composed.getProperties()), composed.getRequired(), null, null);
}
@@ -3068,7 +3096,7 @@ public class DefaultCodegen implements CodegenConfig {
m.getVendorExtensions().putAll(schema.getExtensions());
}
m.isAlias = (typeAliases.containsKey(name)
|| isAliasOfSimpleTypes(schema)); // check if the unaliased schema is an alias of simple OAS types
|| isAliasOfSimpleTypes(schema)); // check if the unaliased schema is an alias of simple OAS types
m.setDiscriminator(createDiscriminator(name, schema));
if (schema.getDeprecated() != null) {
@@ -3439,7 +3467,7 @@ public class DefaultCodegen implements CodegenConfig {
}
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());
@@ -3468,7 +3496,7 @@ public class DefaultCodegen implements CodegenConfig {
}
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());
@@ -3667,7 +3695,7 @@ public class DefaultCodegen implements CodegenConfig {
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;
}
@@ -3865,9 +3893,9 @@ public class DefaultCodegen implements CodegenConfig {
}
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;
}
@@ -3943,7 +3971,6 @@ public class DefaultCodegen implements CodegenConfig {
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
@@ -4124,7 +4151,7 @@ public class DefaultCodegen implements CodegenConfig {
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);
}
@@ -4208,9 +4235,9 @@ public class DefaultCodegen implements CodegenConfig {
}
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
@@ -4289,7 +4316,7 @@ public class DefaultCodegen implements CodegenConfig {
* 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) {
@@ -4331,7 +4358,7 @@ public class DefaultCodegen implements CodegenConfig {
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;
@@ -4356,7 +4383,7 @@ public class DefaultCodegen implements CodegenConfig {
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)) {
@@ -4466,7 +4493,7 @@ public class DefaultCodegen implements CodegenConfig {
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;
@@ -4486,7 +4513,7 @@ public class DefaultCodegen implements CodegenConfig {
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) {
@@ -4514,7 +4541,7 @@ public class DefaultCodegen implements CodegenConfig {
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;
}
@@ -4575,9 +4602,9 @@ public class DefaultCodegen implements CodegenConfig {
* @param methodResponse the default ApiResponse for the endpoint
*/
protected void handleMethodResponse(Operation operation,
Map<String, Schema> schemas,
CodegenOperation op,
ApiResponse methodResponse) {
Map<String, Schema> schemas,
CodegenOperation op,
ApiResponse methodResponse) {
handleMethodResponse(operation, schemas, op, methodResponse, Collections.emptyMap());
}
@@ -4591,10 +4618,10 @@ public class DefaultCodegen implements CodegenConfig {
* @param schemaMappings mappings of external types to be omitted by unaliasing
*/
protected void handleMethodResponse(Operation operation,
Map<String, Schema> schemas,
CodegenOperation op,
ApiResponse methodResponse,
Map<String, String> schemaMappings) {
Map<String, Schema> schemas,
CodegenOperation op,
ApiResponse methodResponse,
Map<String, String> schemaMappings) {
ApiResponse response = ModelUtils.getReferencedApiResponse(openAPI, methodResponse);
Schema responseSchema = unaliasSchema(ModelUtils.getSchemaFromResponse(openAPI, response));
@@ -4663,9 +4690,9 @@ public class DefaultCodegen implements CodegenConfig {
*/
@Override
public CodegenOperation fromOperation(String path,
String httpMethod,
Operation operation,
List<Server> servers) {
String httpMethod,
Operation operation,
List<Server> servers) {
LOGGER.debug("fromOperation => operation: {}", operation);
if (operation == null)
throw new RuntimeException("operation cannot be null in fromOperation");
@@ -4733,8 +4760,8 @@ public class DefaultCodegen implements CodegenConfig {
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);
}
@@ -4756,14 +4783,14 @@ public class DefaultCodegen implements CodegenConfig {
// 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;
}
@@ -4836,8 +4863,8 @@ public class DefaultCodegen implements CodegenConfig {
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");
@@ -5027,23 +5054,23 @@ public class DefaultCodegen implements CodegenConfig {
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);
}
}
@@ -5273,7 +5300,6 @@ public class DefaultCodegen implements CodegenConfig {
LOGGER.debug("debugging codegenParameter return: {}", codegenParameter);
}
private void updateParameterForMap(CodegenParameter codegenParameter, Schema parameterSchema, Set<String> imports) {
CodegenProperty codegenProperty = fromProperty("inner", ModelUtils.getAdditionalProperties(parameterSchema), false);
codegenParameter.items = codegenProperty;
@@ -5853,7 +5879,7 @@ public class DefaultCodegen implements CodegenConfig {
*/
protected boolean needToImport(String type) {
return StringUtils.isNotBlank(type) && !defaultIncludes.contains(type)
&& !languageSpecificPrimitives.contains(type);
&& !languageSpecificPrimitives.contains(type);
}
@SuppressWarnings("static-method")
@@ -6062,7 +6088,7 @@ public class DefaultCodegen implements CodegenConfig {
}
protected void addVars(CodegenModel m, Map<String, Schema> properties, List<String> required,
Map<String, Schema> allProperties, List<String> allRequired) {
Map<String, Schema> allProperties, List<String> allRequired) {
m.hasRequired = false;
m.hasReadOnly = false;
@@ -6265,7 +6291,7 @@ public class DefaultCodegen implements CodegenConfig {
// 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);
}
@@ -7040,7 +7066,6 @@ public class DefaultCodegen implements CodegenConfig {
return result;
}
/**
* reads propertyKey from additionalProperties, converts it to a boolean and
* writes it back to additionalProperties to be usable as a boolean in
@@ -7115,6 +7140,69 @@ public class DefaultCodegen implements CodegenConfig {
this.ignoreFilePathOverride = ignoreFileOverride;
}
public List<String> getPropertyAsStringList(String propertyKey) {
final Object value = additionalProperties.get(propertyKey);
return getObjectAsStringList(value);
}
public static List<String> getObjectAsStringList(Object value) {
if (value instanceof List) {
List<?> list = (List<?>) value;
List<String> 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<String, String> getPropertyAsStringMap(String propertyKey) {
final Object value = additionalProperties.get(propertyKey);
return getObjectAsStringMap(value);
}
public static Map<String, String> getObjectAsStringMap(Object value) {
if (value instanceof Map) {
Map<?, ?> rawMap = (Map<?, ?>) value;
Map<String, String> stringMap = new HashMap<>();
for (Entry<?, ?> entry : rawMap.entrySet()) {
stringMap.put(String.valueOf(entry.getKey()), String.valueOf(entry.getValue()));
}
return stringMap;
}
return Collections.emptyMap();
}
public Map<String, List<String>> getPropertyAsStringListMap(String propertyKey) {
final Object value = additionalProperties.get(propertyKey);
return getObjectAsStringListMap(value);
}
public static Map<String, List<String>> getObjectAsStringListMap(Object value) {
if (value instanceof Map) {
Map<?, ?> rawMap = (Map<?, ?>) value;
Map<String, List<String>> stringMap = new HashMap<>();
for (Entry<?, ?> entry : rawMap.entrySet()) {
Object entryValue = entry.getValue();
if (entryValue instanceof List) {
List<String> 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);
boolean result = Boolean.FALSE;
@@ -7218,8 +7306,8 @@ public class DefaultCodegen implements CodegenConfig {
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;
}
}
@@ -7338,7 +7426,7 @@ public class DefaultCodegen implements CodegenConfig {
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);
@@ -7630,9 +7718,9 @@ public class DefaultCodegen implements CodegenConfig {
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";
@@ -7696,7 +7784,6 @@ public class DefaultCodegen implements CodegenConfig {
innerCp = innerCp.items;
}
if (StringUtils.isEmpty(bodyParameterName)) {
codegenParameter.baseName = "request_body";
} else {
@@ -7991,7 +8078,7 @@ public class DefaultCodegen implements CodegenConfig {
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);
@@ -8379,7 +8466,7 @@ public class DefaultCodegen implements CodegenConfig {
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) {
@@ -8548,6 +8635,7 @@ public class DefaultCodegen implements CodegenConfig {
*/
@Getter
private static class SanitizeNameOptions {
public SanitizeNameOptions(String name, String removeCharRegEx, List<String> exceptions) {
this.name = name;
this.removeCharRegEx = removeCharRegEx;
@@ -8564,12 +8652,14 @@ public class DefaultCodegen implements CodegenConfig {
@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
@@ -8675,7 +8765,7 @@ public class DefaultCodegen implements CodegenConfig {
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);

View File

@@ -56,6 +56,7 @@ import org.slf4j.Logger;
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.ZonedDateTime;
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,6 +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 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";
public static final String DISCRIMINATOR_CASE_SENSITIVE = "discriminatorCaseSensitive";
@@ -178,6 +182,12 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
@Setter protected boolean parentOverridden = false;
@Getter @Setter
protected List<String> additionalModelTypeAnnotations = new LinkedList<>();
@Getter
@Setter
protected List<String> xImplementsSkip = new ArrayList<>();
@Getter
@Setter
protected Map<String, List<String>> schemaImplements = new HashMap<>();
protected Map<String, Boolean> lombokAnnotations = null;
@Getter @Setter
protected List<String> additionalOneOfTypeAnnotations = new LinkedList<>();
@@ -450,6 +460,12 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
convertPropertyToTypeAndWriteBack(ADDITIONAL_ENUM_TYPE_ANNOTATIONS,
annotations -> Arrays.asList(annotations.split(";")),
this::setAdditionalEnumTypeAnnotations);
if (additionalProperties.containsKey(X_IMPLEMENTS_SKIP)) {
this.setXImplementsSkip(getPropertyAsStringList(X_IMPLEMENTS_SKIP));
}
if (additionalProperties.containsKey(SCHEMA_IMPLEMENTS)) {
this.setSchemaImplements(getPropertyAsStringListMap(SCHEMA_IMPLEMENTS));
}
if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) {
this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE));
@@ -1998,13 +2014,63 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
listIterator.add(newImportMap);
}
}
// add x-implements for serializable to all models
// make sure the x-implements is always a List and always at least empty
for (ModelMap mo : objs.getModels()) {
CodegenModel cm = mo.getModel();
if (this.serializableModel) {
cm.getVendorExtensions().putIfAbsent(X_IMPLEMENTS, new ArrayList<String>());
((ArrayList<String>) cm.getVendorExtensions().get(X_IMPLEMENTS)).add("Serializable");
if (cm.getVendorExtensions().containsKey(X_IMPLEMENTS)) {
List<String> xImplements = getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS));
cm.getVendorExtensions().replace(X_IMPLEMENTS, xImplements);
} else {
cm.getVendorExtensions().put(X_IMPLEMENTS, new ArrayList<String>());
}
}
// 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 (!getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS)).isEmpty()) {
List<String> xImplementsInModelOriginal = getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS));
List<String> xImplementsInModelSkipped = xImplementsInModelOriginal
.stream()
.filter(o -> this.xImplementsSkip.contains(o))
.collect(Collectors.toList());
if (!xImplementsInModelSkipped.isEmpty()) {
LOGGER.info("Following interfaces configured via config option '{}' will be skipped for model {}: {}", X_IMPLEMENTS_SKIP, cm.classname, xImplementsInModelSkipped);
}
List<String> xImplementsInModelProcessed = xImplementsInModelOriginal.stream()
.filter(Predicate.not(xImplementsInModelSkipped::contains))
.collect(Collectors.toList());
// implement only the non-skipped interfaces
cm.getVendorExtensions().replace(X_IMPLEMENTS, xImplementsInModelProcessed);
}
}
}
// 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 config option '{}' to model {}", this.schemaImplements.get(cm.getSchemaName()), SCHEMA_IMPLEMENTS, cm.classname);
List<String> xImplementsInModel = getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS));
List<String> schemaImplements = this.schemaImplements.get(cm.getSchemaName());
List<String> combinedSchemaImplements = Stream.concat(xImplementsInModel.stream(), schemaImplements.stream())
.collect(Collectors.toList());
// Add all the interfaces combined
cm.getVendorExtensions().replace(X_IMPLEMENTS, combinedSchemaImplements);
}
}
}
// add Serializable to x-implements to all models if configured
if (this.serializableModel) {
for (ModelMap mo : objs.getModels()) {
CodegenModel cm = mo.getModel();
List<String> xImplements = new ArrayList<>(getObjectAsStringList(cm.getVendorExtensions().get(X_IMPLEMENTS)));
if (!xImplements.contains("Serializable")) {
xImplements.add("Serializable");
}
cm.getVendorExtensions().replace(X_IMPLEMENTS, xImplements);
}
}

View File

@@ -56,6 +56,10 @@ 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";
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);
@@ -88,6 +92,18 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
private final Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
@Getter @Setter
protected List<String> additionalModelTypeAnnotations = new LinkedList<>();
@Getter
@Setter
protected Map<String, List<String>> schemaImplements = new HashMap<>();
@Getter
@Setter
protected Map<String, List<String>> schemaImplementsFields = new HashMap<>();
@Getter
@Setter
protected List<String> xKotlinImplementsSkip = new ArrayList<>();
@Getter
@Setter
protected Map<String, List<String>> xKotlinImplementsFieldsSkip = new HashMap<>();
public AbstractKotlinCodegen() {
super();
@@ -513,7 +529,19 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
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())));
}
if (additionalProperties.containsKey(SCHEMA_IMPLEMENTS)) {
this.setSchemaImplements(getPropertyAsStringListMap(SCHEMA_IMPLEMENTS));
}
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());
@@ -839,16 +867,52 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
@Override
public CodegenModel fromModel(String name, Schema schema) {
CodegenModel m = super.fromModel(name, schema);
List<String> implementedInterfacesClasses = (List<String>) m.getVendorExtensions().getOrDefault(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), List.of());
List<String> implementedInterfacesFields = Optional.ofNullable((List<String>) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName()))
m.getVendorExtensions().putIfAbsent(VendorExtension.X_KOTLIN_IMPLEMENTS.getName(), List.of());
List<String> schemaImplementedInterfacesClasses = this.getSchemaImplements().getOrDefault(m.getSchemaName(), List.of());
List<String> schemaImplementedInterfacesFields = this.getSchemaImplementsFields().getOrDefault(m.getSchemaName(), List.of());
List<String> vendorExtensionImplementedInterfacesClasses = (List<String>) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS.getName());
List<String> 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 config option '{}'.",
interfacesToSkip, name, X_KOTLIN_IMPLEMENTS_SKIP);
}
List<String> vendorExtensionImplementedInterfacesClassesFiltered = vendorExtensionImplementedInterfacesClasses.stream()
.filter(interfaceName -> !interfacesToSkip.contains(interfaceName))
.collect(Collectors.toList());
List<String> vendorExtensionImplementedInterfacesFields = Optional.ofNullable((List<String>) m.getVendorExtensions().get(VendorExtension.X_KOTLIN_IMPLEMENTS_FIELDS.getName()))
.map(xKotlinImplementsFields -> {
if (implementedInterfacesClasses.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<String> 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 config option '{}'.",
fieldsToSkip, name, X_KOTLIN_IMPLEMENTS_FIELDS_SKIP);
}
List<String> vendorExtensionImplementedInterfacesFieldsFiltered = vendorExtensionImplementedInterfacesFields.stream()
.filter(interfaceName -> !fieldsToSkip.contains(interfaceName))
.collect(Collectors.toList());
List<String> combinedImplementedInterfacesClasses = Stream.concat(vendorExtensionImplementedInterfacesClassesFiltered.stream(), schemaImplementedInterfacesClasses.stream())
.distinct()
.sorted()
.collect(Collectors.toList());
List<String> 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 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
@@ -865,7 +929,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
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;

View File

@@ -247,6 +247,10 @@ public class KotlinSpringServerCodegen extends AbstractKotlinCodegen
addSwitch(USE_RESPONSE_ENTITY,
"Whether (when false) to return actual type (e.g. List<Fruit>) and handle non-happy path responses via exceptions flow or (when true) return entire ResponseEntity (e.g. ResponseEntity<List<Fruit>>). 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`. 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.");

View File

@@ -249,6 +249,9 @@ public class SpringCodegen extends AbstractJavaCodegen
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.")

View File

@@ -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}},

View File

@@ -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}},

View File

@@ -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}}

View File

@@ -63,7 +63,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}}{{!

View File

@@ -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

View File

@@ -5,6 +5,7 @@ import com.github.javaparser.ast.CompilationUnit;
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.nio.file.Path;
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<JavaFileAssert, CompilationUnit> {
@@ -56,6 +59,36 @@ public class JavaFileAssert extends AbstractAssert<JavaFileAssert, CompilationUn
return this;
}
public JavaFileAssert implementsInterfaces(String... implementedInterfaces) {
Set<String> expectedInterfaces = Stream.of(implementedInterfaces)
.collect(Collectors.toSet());
Set<String> 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<String> forbiddenInterfaces = Stream.of(interfaces).collect(Collectors.toSet());
Set<String> 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())

View File

@@ -822,6 +822,48 @@ public class SpringCodegenTest {
.assertMethod("getAdditionalProperty", "String").hasReturnType("Integer");
}
@Test
public void testXImplements() throws IOException {
final SpringCodegen codegen = new SpringCodegen();
final Map<String, File> 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");
}
@Test
public void testXImplementsSkip() throws IOException {
final SpringCodegen codegen = new SpringCodegen();
String interfaceToSkip = "com.custompackage.InterfaceToSkip";
codegen.additionalProperties().put(X_IMPLEMENTS_SKIP, List.of(interfaceToSkip));
final Map<String, File> 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")
.doesNotImplementInterfaces(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<String, File> 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.InterfaceToKeep", "com.custompackage.InterfaceToSkip")
.doesNotImplementInterfaces("com.custompackage.SubstitutedInterface");
JavaFileAssert.assertThat(files.get("Foo.java"))
.implementsInterfaces(fooInterface, fooAnotherInterface);
}
@Test
public void shouldAddParameterWithInHeaderWhenImplicitHeadersIsTrue_issue14418() throws IOException {
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();

View File

@@ -1003,8 +1003,7 @@ public class KotlinSpringServerCodegenTest {
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,155 @@ public class KotlinSpringServerCodegenTest {
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"
);
}
@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();
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<kotlin.String>,",
"@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<Tag>? = 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, com.some.pack.WithPhotoUrls, java.io.Serializable {",
"override val name: kotlin.String",
"val photoUrls: kotlin.collections.List<kotlin.String>",
"val petType: kotlin.String",
"override val id: kotlin.Long?",
"override val category: Category?",
"val tags: kotlin.collections.List<Tag>?",
"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 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"
);
}
@@ -1076,20 +1221,23 @@ public class KotlinSpringServerCodegenTest {
"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<ResponseEntity<Map<String, kotlin.Int>>>",
" @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<ResponseEntity<Unit>>",
" @HttpExchange(\n"
+ " url = PATH_PLACE_ORDER /* \"/store/order\" */,\n"
+ " // \"/store/order\"\n"
+ " url = PATH_PLACE_ORDER,\n"
+ " method = \"POST\"\n"
+ " )\n"
+ " fun placeOrder(\n"
@@ -1367,8 +1515,9 @@ public class KotlinSpringServerCodegenTest {
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"
);
}
@@ -2796,7 +2945,7 @@ public class KotlinSpringServerCodegenTest {
+ " @PathVariable(\"petId\") petId: kotlin.Long"
+ " ): ResponseEntity<Pet>"),
root.resolve("src/main/kotlin/org/openapitools/api/UserApi.kt"), List.of(
"fun logoutUser(): ResponseEntity<Unit>"
"fun logoutUser(): ResponseEntity<Unit>"
),
root.resolve("src/main/kotlin/org/openapitools/api/StoreApi.kt"), List.of(
"fun getInventory(): ResponseEntity<Map<String, kotlin.Int>>")

View File

@@ -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

View File

@@ -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"]
)

View File

@@ -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<Map<String, kotlin.Int>> {
@@ -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"]
)

View File

@@ -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<Unit> {
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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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(

View File

@@ -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(

View File

@@ -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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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(

View File

@@ -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"]
)

View File

@@ -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<Map<String, kotlin.Int>> {
@@ -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"]
)

View File

@@ -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<Unit> {
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(

View File

@@ -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"]
)

View File

@@ -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<Map<String, kotlin.Int>> {
@@ -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"]
)

View File

@@ -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<Unit> {
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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"]
)

View File

@@ -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<Map<String, kotlin.Int>> {
@@ -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"]
)

View File

@@ -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<Unit> {
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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"]
)

View File

@@ -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<Map<String, kotlin.Int>> {
@@ -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"]
)

View File

@@ -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<Unit> {
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(

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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<String, kotlin.Any>(), Serializable {
) : kotlin.collections.HashMap<String, kotlin.Any>(), java.io.Serializable {
/**
* pet status in the store

View File

@@ -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

View File

@@ -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

View File

@@ -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(

View File

@@ -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"]
)

Some files were not shown because too many files have changed in this diff Show More