diff --git a/.github/.test/samples.json b/.github/.test/samples.json
index 6272fb28cc67..6520d1fbf09c 100644
--- a/.github/.test/samples.json
+++ b/.github/.test/samples.json
@@ -920,24 +920,6 @@
"Server: Spring"
]
},
- {
- "input": "spring-mvc-petstore-j8-async-server.sh",
- "matches": [
- "Server: Spring"
- ]
- },
- {
- "input": "spring-mvc-petstore-j8-localdatetime.sh",
- "matches": [
- "Server: Spring"
- ]
- },
- {
- "input": "spring-mvc-petstore-server.sh",
- "matches": [
- "Server: Spring"
- ]
- },
{
"input": "spring-stubs.sh",
"matches": [
diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml
index 6f8ac8537980..328052970b31 100644
--- a/.github/workflows/samples-spring.yaml
+++ b/.github/workflows/samples-spring.yaml
@@ -26,10 +26,6 @@ jobs:
- samples/openapi3/client/petstore/spring-stubs
- samples/openapi3/client/petstore/spring-stubs-skip-default-interface
# servers
- - samples/server/petstore/spring-mvc
- - samples/server/petstore/spring-mvc-default-value
- - samples/server/petstore/spring-mvc-j8-async
- - samples/server/petstore/spring-mvc-j8-localdatetime
- samples/server/petstore/springboot
- samples/openapi3/server/petstore/springboot
- samples/server/petstore/springboot-beanvalidation
diff --git a/bin/configs/spring-boot-beanvalidation.yaml b/bin/configs/spring-boot-beanvalidation.yaml
index dd4ea561c849..4a5daef58453 100644
--- a/bin/configs/spring-boot-beanvalidation.yaml
+++ b/bin/configs/spring-boot-beanvalidation.yaml
@@ -5,6 +5,7 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-e
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox
+ useSwaggerUI: false
java8: true
useBeanValidation: true
artifactId: spring-boot-beanvalidation
diff --git a/bin/configs/spring-boot-source.yaml b/bin/configs/spring-boot-source.yaml
new file mode 100644
index 000000000000..a1572c0e19c4
--- /dev/null
+++ b/bin/configs/spring-boot-source.yaml
@@ -0,0 +1,10 @@
+generatorName: spring
+outputDir: samples/openapi3/server/petstore/springboot-source
+inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
+templateDir: modules/openapi-generator/src/main/resources/JavaSpring
+additionalProperties:
+ groupId: org.openapitools.openapi3
+ documentationProvider: source
+ artifactId: springboot
+ snapshotVersion: "true"
+ hideGenerationTimestamp: "true"
diff --git a/bin/configs/spring-boot-springdoc.yaml b/bin/configs/spring-boot-springdoc.yaml
index 47b1c195c36f..fe479cd21e7f 100644
--- a/bin/configs/spring-boot-springdoc.yaml
+++ b/bin/configs/spring-boot-springdoc.yaml
@@ -5,6 +5,7 @@ templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springdoc
+ useSwaggerUI: false
artifactId: spring-boot-springdoc
snapshotVersion: "true"
hideGenerationTimestamp: "true"
diff --git a/bin/configs/spring-mvc-default-values.yaml b/bin/configs/spring-mvc-default-values.yaml
deleted file mode 100644
index e25aa41b503d..000000000000
--- a/bin/configs/spring-mvc-default-values.yaml
+++ /dev/null
@@ -1,8 +0,0 @@
-generatorName: spring
-outputDir: samples/server/petstore/spring-mvc-default-value
-inputSpec: modules/openapi-generator/src/test/resources/3_0/issue_8535.yaml
-templateDir: modules/openapi-generator/src/main/resources/JavaSpring
-additionalProperties:
- documentationProvider: springfox
- hideGenerationTimestamp: "true"
- artifactId: spring-mvc-default-value
\ No newline at end of file
diff --git a/bin/configs/spring-mvc-j8-async.yaml b/bin/configs/spring-mvc-j8-async.yaml
deleted file mode 100644
index 287d05993ee4..000000000000
--- a/bin/configs/spring-mvc-j8-async.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-generatorName: spring
-outputDir: samples/server/petstore/spring-mvc-j8-async
-library: spring-mvc
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
-templateDir: modules/openapi-generator/src/main/resources/JavaSpring
-additionalProperties:
- documentationProvider: springfox
- async: "true"
- java8: true
- artifactId: spring-mvc-server-j8-async
- hideGenerationTimestamp: "true"
- serverPort: "8002"
diff --git a/bin/configs/spring-mvc-j8-localdatetime.yaml b/bin/configs/spring-mvc-j8-localdatetime.yaml
deleted file mode 100644
index c1e66bf80a63..000000000000
--- a/bin/configs/spring-mvc-j8-localdatetime.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-generatorName: spring
-outputDir: samples/server/petstore/spring-mvc-j8-localdatetime
-library: spring-mvc
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
-templateDir: modules/openapi-generator/src/main/resources/JavaSpring
-additionalProperties:
- documentationProvider: springfox
- booleanGetterPrefix: get
- artifactId: spring-mvc-j8-localdatetime
- hideGenerationTimestamp: "true"
- serverPort: "8002"
- dateLibrary: java8-localdatetime
diff --git a/bin/configs/spring-mvc-no-nullable.yaml b/bin/configs/spring-mvc-no-nullable.yaml
deleted file mode 100644
index 76cefce348f2..000000000000
--- a/bin/configs/spring-mvc-no-nullable.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-generatorName: spring
-outputDir: samples/server/petstore/spring-mvc-no-nullable
-library: spring-mvc
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
-templateDir: modules/openapi-generator/src/main/resources/JavaSpring
-additionalProperties:
- documentationProvider: springfox
- artifactId: spring-mvc-server-no-nullable
- openApiNullable: "false"
- serverPort: "8002"
- hideGenerationTimestamp: "true"
diff --git a/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml b/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml
deleted file mode 100644
index 027a98cbff47..000000000000
--- a/bin/configs/spring-mvc-petstore-server-spring-pageable.yaml
+++ /dev/null
@@ -1,9 +0,0 @@
-generatorName: spring
-outputDir: samples/server/petstore/spring-mvc-spring-pageable
-library: spring-mvc
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing-with-spring-pageable.yaml
-templateDir: modules/openapi-generator/src/main/resources/JavaSpring
-additionalProperties:
- documentationProvider: springfox
- artifactId: spring-mvc-spring-pageable
- hideGenerationTimestamp: 'true'
diff --git a/bin/configs/spring-mvc.yaml b/bin/configs/spring-mvc.yaml
deleted file mode 100644
index 9093bb518c8f..000000000000
--- a/bin/configs/spring-mvc.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-generatorName: spring
-outputDir: samples/server/petstore/spring-mvc
-library: spring-mvc
-inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
-templateDir: modules/openapi-generator/src/main/resources/JavaSpring
-additionalProperties:
- documentationProvider: springfox
- java8: true
- booleanGetterPrefix: get
- artifactId: spring-mvc-server
- hideGenerationTimestamp: "true"
- serverPort: "8002"
- additionalModelTypeAnnotations: '@com.fasterxml.jackson.annotation.JsonFilter(value = "filter-name");@com.fasterxml.jackson.annotation.JsonIgnoreProperties(value = "id")'
- additionalEnumTypeAnnotations: '@com.fasterxml.jackson.annotation.JsonFormat'
diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md
index 9813b1b4dd08..57f0a58f855a 100644
--- a/docs/generators/java-camel.md
+++ b/docs/generators/java-camel.md
@@ -49,7 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
**false** The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. **true** Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
-|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springfox** Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
+|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springfox** Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|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.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
@@ -61,7 +61,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|**true** The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. **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. |true|
-|library|library template (sub-template)|**spring-boot** Spring-boot Server application using the SpringFox integration. **spring-mvc** Spring-MVC Server application using the SpringFox integration. **spring-cloud** Spring-Cloud-Feign client with Spring-Boot auto-configured settings. |spring-boot|
+|library|library template (sub-template)|**spring-boot** Spring-boot Server application. **spring-cloud** Spring-Cloud-Feign client with Spring-Boot auto-configured settings. |spring-boot|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|modelPackage|package for generated models| |org.openapitools.model|
@@ -84,13 +84,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/main/java|
-|swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|title|server title name or client service name| |OpenAPI Spring|
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useOptional|Use Optional container for optional parameters| |false|
|useSpringController|Annotate the generated API as a Spring Controller| |false|
+|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
|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|
diff --git a/docs/generators/spring.md b/docs/generators/spring.md
index 8f244c07e9c1..f63fea0e35c2 100644
--- a/docs/generators/spring.md
+++ b/docs/generators/spring.md
@@ -42,7 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|disableHtmlEscaping|Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)| |false|
|disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|**false** The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications. **true** Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default. |true|
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
-|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springfox** Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
+|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springfox** Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|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.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
|fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false|
@@ -54,7 +54,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|interfaceOnly|Whether to generate only API interface stubs without the server files.| |false|
|invokerPackage|root package for generated code| |org.openapitools.api|
|legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|**true** The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document. **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. |true|
-|library|library template (sub-template)|**spring-boot** Spring-boot Server application using the SpringFox integration. **spring-mvc** Spring-MVC Server application using the SpringFox integration. **spring-cloud** Spring-Cloud-Feign client with Spring-Boot auto-configured settings. |spring-boot|
+|library|library template (sub-template)|**spring-boot** Spring-boot Server application. **spring-cloud** Spring-Cloud-Feign client with Spring-Boot auto-configured settings. |spring-boot|
|licenseName|The name of the license| |Unlicense|
|licenseUrl|The URL of the license| |http://unlicense.org|
|modelPackage|package for generated models| |org.openapitools.model|
@@ -77,13 +77,13 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
|sourceFolder|source folder for generated code| |src/main/java|
-|swaggerDocketConfig|Generate Spring OpenAPI Docket configuration class.| |false|
|testOutput|Set output folder for models and APIs tests| |${project.build.directory}/generated-test-sources/openapi|
|title|server title name or client service name| |OpenAPI Spring|
|unhandledException|Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).| |false|
|useBeanValidation|Use BeanValidation API annotations| |true|
|useOptional|Use Optional container for optional parameters| |false|
|useSpringController|Annotate the generated API as a Spring Controller| |false|
+|useSwaggerUI|Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies| |true|
|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|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java
index 40d17458e1f4..305a9038ffe7 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaCamelServerCodegen.java
@@ -119,7 +119,7 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("README.mustache", "", "README.md"));
supportingFiles.add(new SupportingFile("openapi2SpringBoot.mustache",
(sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator),
- "OpenAPI2SpringBoot.java"));
+ "OpenApiGeneratorApplication.java"));
if (!interfaceOnly) {
apiTemplateFiles.put("routesImpl.mustache", "RoutesImpl.java");
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
index 336f9ed05887..93cb9dcf0ccf 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
@@ -20,6 +20,12 @@
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import static org.openapitools.codegen.utils.StringUtils.camelize;
+import com.samskivert.mustache.Mustache;
+import io.swagger.v3.oas.models.OpenAPI;
+import io.swagger.v3.oas.models.Operation;
+import io.swagger.v3.oas.models.PathItem;
+import io.swagger.v3.oas.models.media.Schema;
+import io.swagger.v3.oas.models.servers.Server;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
@@ -31,13 +37,6 @@
import java.util.Map;
import java.util.regex.Matcher;
import java.util.stream.Collectors;
-
-import com.samskivert.mustache.Mustache;
-import io.swagger.v3.oas.models.OpenAPI;
-import io.swagger.v3.oas.models.Operation;
-import io.swagger.v3.oas.models.PathItem;
-import io.swagger.v3.oas.models.media.Schema;
-import io.swagger.v3.oas.models.servers.Server;
import org.apache.commons.lang3.tuple.Pair;
import org.openapitools.codegen.CliOption;
import org.openapitools.codegen.CodegenConstants;
@@ -50,8 +49,10 @@
import org.openapitools.codegen.CodegenType;
import org.openapitools.codegen.SupportingFile;
import org.openapitools.codegen.languages.features.BeanValidationFeatures;
+import org.openapitools.codegen.languages.features.DocumentationProviderFeatures;
import org.openapitools.codegen.languages.features.OptionalFeatures;
import org.openapitools.codegen.languages.features.PerformBeanValidationFeatures;
+import org.openapitools.codegen.languages.features.SwaggerUIFeatures;
import org.openapitools.codegen.meta.features.DocumentationFeature;
import org.openapitools.codegen.meta.features.GlobalFeature;
import org.openapitools.codegen.meta.features.ParameterFeature;
@@ -65,7 +66,7 @@
import org.slf4j.LoggerFactory;
public class SpringCodegen extends AbstractJavaCodegen
- implements BeanValidationFeatures, PerformBeanValidationFeatures, OptionalFeatures {
+ implements BeanValidationFeatures, PerformBeanValidationFeatures, OptionalFeatures, SwaggerUIFeatures {
private final Logger LOGGER = LoggerFactory.getLogger(SpringCodegen.class);
public static final String TITLE = "title";
@@ -83,11 +84,9 @@ public class SpringCodegen extends AbstractJavaCodegen
public static final String REACTIVE = "reactive";
public static final String RESPONSE_WRAPPER = "responseWrapper";
public static final String USE_TAGS = "useTags";
- public static final String SPRING_MVC_LIBRARY = "spring-mvc";
public static final String SPRING_BOOT = "spring-boot";
public static final String SPRING_CLOUD_LIBRARY = "spring-cloud";
public static final String IMPLICIT_HEADERS = "implicitHeaders";
- public static final String OPENAPI_DOCKET_CONFIG = "swaggerDocketConfig";
public static final String API_FIRST = "apiFirst";
public static final String SPRING_CONTROLLER = "useSpringController";
public static final String HATEOAS = "hateoas";
@@ -113,7 +112,6 @@ public class SpringCodegen extends AbstractJavaCodegen
protected boolean useBeanValidation = true;
protected boolean performBeanValidation = false;
protected boolean implicitHeaders = false;
- protected boolean openapiDocketConfig = false;
protected boolean apiFirst = false;
protected boolean useOptional = false;
protected boolean virtualService = false;
@@ -121,6 +119,7 @@ public class SpringCodegen extends AbstractJavaCodegen
protected boolean returnSuccessCode = false;
protected boolean unhandledException = false;
protected boolean useSpringController = false;
+ protected boolean useSwaggerUI = true;
public SpringCodegen() {
super();
@@ -185,8 +184,6 @@ public SpringCodegen() {
cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS,
"Skip header parameters in the generated API methods using @ApiImplicitParams annotation.",
implicitHeaders));
- cliOptions.add(CliOption.newBoolean(OPENAPI_DOCKET_CONFIG,
- "Generate Spring OpenAPI Docket configuration class.", openapiDocketConfig));
cliOptions.add(CliOption.newBoolean(API_FIRST,
"Generate the API from the OAI spec at server compile time (API first approach)", apiFirst));
cliOptions
@@ -199,11 +196,13 @@ public SpringCodegen() {
cliOptions.add(CliOption.newBoolean(UNHANDLED_EXCEPTION_HANDLING,
"Declare operation methods to throw a generic exception and allow unhandled exceptions (useful for Spring `@ControllerAdvice` directives).",
unhandledException));
+ cliOptions.add(CliOption.newBoolean(USE_SWAGGER_UI,
+ "Open the OpenApi specification in swagger-ui. Will also import and configure needed dependencies",
+ useSwaggerUI));
- supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application using the SpringFox integration.");
- supportedLibraries.put(SPRING_MVC_LIBRARY, "Spring-MVC Server application using the SpringFox integration.");
+ supportedLibraries.put(SPRING_BOOT, "Spring-boot Server application.");
supportedLibraries.put(SPRING_CLOUD_LIBRARY,
- "Spring-Cloud-Feign client with Spring-Boot auto-configured settings.");
+ "Spring-Cloud-Feign client with Spring-Boot auto-configured settings.");
setLibrary(SPRING_BOOT);
final CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC)
.defaultValue(SPRING_BOOT);
@@ -250,6 +249,16 @@ public List supportedAnnotationLibraries() {
return supportedLibraries;
}
+ /**
+ * Whether the selected {@link DocumentationProviderFeatures.DocumentationProvider} requires us to bootstrap and
+ * configure swagger-ui by ourselves. Springdoc, for example ships its own swagger-ui integration.
+ *
+ * @return true if the selected DocumentationProvider requires us to bootstrap swagger-ui.
+ */
+ private boolean selectedDocumentationProviderRequiresSwaggerUiBootstrap() {
+ return getDocumentationProvider().equals(DocumentationProvider.SPRINGFOX) || getDocumentationProvider().equals(DocumentationProvider.SOURCE);
+ }
+
@Override
public void processOpts() {
final List> configOptions = additionalProperties.entrySet().stream()
@@ -285,6 +294,10 @@ public void processOpts() {
super.processOpts();
+ if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider())) {
+ LOGGER.warn("The springfox documentation provider is deprecated for removal. Use the springdoc provider instead.");
+ }
+
// clear model and api doc template as this codegen
// does not support auto-generated markdown doc at the moment
// TODO: add doc templates
@@ -367,11 +380,6 @@ public void processOpts() {
this.setImplicitHeaders(Boolean.parseBoolean(additionalProperties.get(IMPLICIT_HEADERS).toString()));
}
- if (additionalProperties.containsKey(OPENAPI_DOCKET_CONFIG)) {
- this.setOpenapiDocketConfig(
- Boolean.parseBoolean(additionalProperties.get(OPENAPI_DOCKET_CONFIG).toString()));
- }
-
if (additionalProperties.containsKey(API_FIRST)) {
this.setApiFirst(Boolean.parseBoolean(additionalProperties.get(API_FIRST).toString()));
}
@@ -389,6 +397,16 @@ public void processOpts() {
this.setReturnSuccessCode(Boolean.parseBoolean(additionalProperties.get(RETURN_SUCCESS_CODE).toString()));
}
+ if (additionalProperties.containsKey(USE_SWAGGER_UI)) {
+ this.setUseSwaggerUI(convertPropertyToBoolean(USE_SWAGGER_UI));
+ }
+
+ if (getDocumentationProvider().equals(DocumentationProvider.NONE)) {
+ this.setUseSwaggerUI(false);
+ }
+
+ writePropertyBack(USE_SWAGGER_UI, useSwaggerUI);
+
if (additionalProperties.containsKey(UNHANDLED_EXCEPTION_HANDLING)) {
this.setUnhandledException(
Boolean.parseBoolean(additionalProperties.get(UNHANDLED_EXCEPTION_HANDLING).toString()));
@@ -422,27 +440,20 @@ public void processOpts() {
if (!interfaceOnly) {
if (SPRING_BOOT.equals(library)) {
+ if (useSwaggerUI && selectedDocumentationProviderRequiresSwaggerUiBootstrap()) {
+ supportingFiles.add(new SupportingFile("swagger-ui.mustache", "src/main/resources/static", "swagger-ui.html"));
+ }
+ // rename template to SpringBootApplication.mustache
supportingFiles.add(new SupportingFile("openapi2SpringBoot.mustache",
(sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator),
- "OpenAPI2SpringBoot.java"));
+ "OpenApiGeneratorApplication.java"));
+ supportingFiles.add(new SupportingFile("SpringBootTest.mustache",
+ (testFolder + File.separator + basePackage).replace(".", java.io.File.separator),
+ "OpenApiGeneratorApplicationTests.java"));
supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache",
(sourceFolder + File.separator + basePackage).replace(".", java.io.File.separator),
"RFC3339DateFormat.java"));
}
- if (SPRING_MVC_LIBRARY.equals(library)) {
- supportingFiles.add(new SupportingFile("webApplication.mustache",
- (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
- "WebApplication.java"));
- supportingFiles.add(new SupportingFile("webMvcConfiguration.mustache",
- (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
- "WebMvcConfiguration.java"));
- supportingFiles.add(new SupportingFile("openapiUiConfiguration.mustache",
- (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
- "OpenAPIUiConfiguration.java"));
- supportingFiles.add(new SupportingFile("RFC3339DateFormat.mustache",
- (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
- "RFC3339DateFormat.java"));
- }
if (SPRING_CLOUD_LIBRARY.equals(library)) {
supportingFiles.add(new SupportingFile("apiKeyRequestInterceptor.mustache",
(sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
@@ -462,19 +473,14 @@ public void processOpts() {
supportingFiles.add(new SupportingFile("homeController.mustache",
(sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
"HomeController.java"));
- if (!reactive && !apiFirst && this.openapiDocketConfig) {
+ supportingFiles.add(new SupportingFile("openapi.mustache",
+ ("src/main/resources").replace("/", java.io.File.separator), "openapi.yaml"));
+ if (DocumentationProvider.SPRINGFOX.equals(getDocumentationProvider()) && !reactive && !apiFirst) {
supportingFiles.add(new SupportingFile("openapiDocumentationConfig.mustache",
- (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
- "OpenAPIDocumentationConfig.java"));
- } else {
- supportingFiles.add(new SupportingFile("openapi.mustache",
- ("src/main/resources").replace("/", java.io.File.separator), "openapi.yaml"));
+ (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
+ "SpringFoxConfiguration.java"));
}
}
- } else if (openapiDocketConfig && !SPRING_CLOUD_LIBRARY.equals(library) && !reactive && !apiFirst) {
- supportingFiles.add(new SupportingFile("openapiDocumentationConfig.mustache",
- (sourceFolder + File.separator + configPackage).replace(".", java.io.File.separator),
- "OpenAPIDocumentationConfig.java"));
}
if (!SPRING_CLOUD_LIBRARY.equals(library)) {
@@ -570,7 +576,7 @@ public void processOpts() {
@Override
public void addOperationToGroup(String tag, String resourcePath, Operation operation, CodegenOperation co,
Map> operations) {
- if ((SPRING_BOOT.equals(library) || SPRING_MVC_LIBRARY.equals(library)) && !useTags) {
+ if ((SPRING_BOOT.equals(library) && !useTags)) {
String basePath = resourcePath;
if (basePath.startsWith("/")) {
basePath = basePath.substring(1);
@@ -868,10 +874,6 @@ public void setImplicitHeaders(boolean implicitHeaders) {
this.implicitHeaders = implicitHeaders;
}
- public void setOpenapiDocketConfig(boolean openapiDocketConfig) {
- this.openapiDocketConfig = openapiDocketConfig;
- }
-
public void setApiFirst(boolean apiFirst) {
this.apiFirst = apiFirst;
}
@@ -1008,4 +1010,9 @@ public void setPerformBeanValidation(boolean performBeanValidation) {
public void setUseOptional(boolean useOptional) {
this.useOptional = useOptional;
}
+
+ @Override
+ public void setUseSwaggerUI(boolean useSwaggerUI) {
+ this.useSwaggerUI = useSwaggerUI;
+ }
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java
index 172ac8f025c3..adfa20dc46d6 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationExtendedFeatures.java
@@ -20,9 +20,9 @@
public interface BeanValidationExtendedFeatures {
// Language (implementing Client/Server) supports automatic BeanValidation (1.1)
- public static final String USE_BEANVALIDATION_FEATURE = "useBeanValidationFeature";
+ String USE_BEANVALIDATION_FEATURE = "useBeanValidationFeature";
- public void setUseBeanValidationFeature(boolean useBeanValidationFeature);
+ void setUseBeanValidationFeature(boolean useBeanValidationFeature);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java
index 44ded47f71b8..cc895613bc98 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/BeanValidationFeatures.java
@@ -20,8 +20,8 @@
public interface BeanValidationFeatures {
// Language supports generating BeanValidation-Annotations
- public static final String USE_BEANVALIDATION = "useBeanValidation";
+ String USE_BEANVALIDATION = "useBeanValidation";
- public void setUseBeanValidation(boolean useBeanValidation);
+ void setUseBeanValidation(boolean useBeanValidation);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java
index d009595e20c5..ff6561f3f807 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/CXFServerFeatures.java
@@ -23,25 +23,25 @@
public interface CXFServerFeatures
extends CXFFeatures, SwaggerFeatures, SpringFeatures, JbossFeature, BeanValidationExtendedFeatures, SwaggerUIFeatures {
- public static final String USE_WADL_FEATURE = "useWadlFeature";
+ String USE_WADL_FEATURE = "useWadlFeature";
- public static final String USE_MULTIPART_FEATURE = "useMultipartFeature";
+ String USE_MULTIPART_FEATURE = "useMultipartFeature";
- public static final String ADD_CONSUMES_PRODUCES_JSON = "addConsumesProducesJson";
+ String ADD_CONSUMES_PRODUCES_JSON = "addConsumesProducesJson";
- public static final String USE_ANNOTATED_BASE_PATH = "useAnnotatedBasePath";
+ String USE_ANNOTATED_BASE_PATH = "useAnnotatedBasePath";
- public static final String GENERATE_NON_SPRING_APPLICATION = "generateNonSpringApplication";
+ String GENERATE_NON_SPRING_APPLICATION = "generateNonSpringApplication";
- public static final String LOAD_TEST_DATA_FROM_FILE = "loadTestDataFromFile";
+ String LOAD_TEST_DATA_FROM_FILE = "loadTestDataFromFile";
- public void setUseWadlFeature(boolean useWadlFeature);
+ void setUseWadlFeature(boolean useWadlFeature);
- public void setUseMultipartFeature(boolean useMultipartFeature);
+ void setUseMultipartFeature(boolean useMultipartFeature);
- public void setAddConsumesProducesJson(boolean addConsumesProducesJson);
+ void setAddConsumesProducesJson(boolean addConsumesProducesJson);
- public void setUseAnnotatedBasePath(boolean useAnnotatedBasePath);
+ void setUseAnnotatedBasePath(boolean useAnnotatedBasePath);
- public void setGenerateNonSpringApplication(boolean generateNonSpringApplication);
+ void setGenerateNonSpringApplication(boolean generateNonSpringApplication);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java
index b658ea0e4d9e..b4edcaea5df8 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/DocumentationProviderFeatures.java
@@ -72,7 +72,7 @@ enum DocumentationProvider {
SWAGGER2("swagger2DocumentationProvider", "Generate an OpenAPI 3 specification using Swagger-Core 2.x.",
AnnotationLibrary.SWAGGER2, AnnotationLibrary.SWAGGER2),
- SPRINGFOX("springFoxDocumentationProvider", "Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x.",
+ SPRINGFOX("springFoxDocumentationProvider", "Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.",
AnnotationLibrary.SWAGGER1, AnnotationLibrary.SWAGGER1),
SPRINGDOC("springDocDocumentationProvider", "Generate an OpenAPI 3 specification using SpringDoc.",
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java
index 683d23f25857..f86832330945 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipFeatures.java
@@ -19,8 +19,8 @@
public interface GzipFeatures {
- public static final String USE_GZIP_FEATURE = "useGzipFeature";
+ String USE_GZIP_FEATURE = "useGzipFeature";
- public void setUseGzipFeature(boolean useGzipFeature);
+ void setUseGzipFeature(boolean useGzipFeature);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java
index 26a6f93aef8c..5f036dd6880e 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/GzipTestFeatures.java
@@ -19,8 +19,8 @@
public interface GzipTestFeatures {
- public static final String USE_GZIP_FEATURE_FOR_TESTS = "useGzipFeatureForTests";
+ String USE_GZIP_FEATURE_FOR_TESTS = "useGzipFeatureForTests";
- public void setUseGzipFeatureForTests(boolean useGzipFeatureForTests);
+ void setUseGzipFeatureForTests(boolean useGzipFeatureForTests);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java
index 463075836a94..c022ef8cea62 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/JbossFeature.java
@@ -19,8 +19,8 @@
public interface JbossFeature {
- public static final String GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR = "generateJbossDeploymentDescriptor";
+ String GENERATE_JBOSS_DEPLOYMENT_DESCRIPTOR = "generateJbossDeploymentDescriptor";
- public void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor);
+ void setGenerateJbossDeploymentDescriptor(boolean generateJbossDeploymentDescriptor);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java
index 795854481236..e7b75a898dde 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingFeatures.java
@@ -19,8 +19,8 @@
public interface LoggingFeatures extends BeanValidationFeatures {
- public static final String USE_LOGGING_FEATURE = "useLoggingFeature";
+ String USE_LOGGING_FEATURE = "useLoggingFeature";
- public void setUseLoggingFeature(boolean useLoggingFeature);
+ void setUseLoggingFeature(boolean useLoggingFeature);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java
index cef8873cdcad..c342f127c2c5 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/LoggingTestFeatures.java
@@ -18,8 +18,9 @@
package org.openapitools.codegen.languages.features;
public interface LoggingTestFeatures {
- public static final String USE_LOGGING_FEATURE_FOR_TESTS = "useLoggingFeatureForTests";
- public void setUseLoggingFeatureForTests(boolean useLoggingFeatureForTests);
+ String USE_LOGGING_FEATURE_FOR_TESTS = "useLoggingFeatureForTests";
+
+ void setUseLoggingFeatureForTests(boolean useLoggingFeatureForTests);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java
index a09e00815ed8..f2b5369f5442 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/PerformBeanValidationFeatures.java
@@ -20,8 +20,8 @@
public interface PerformBeanValidationFeatures {
// Language supports performing BeanValidation
- public static final String PERFORM_BEANVALIDATION = "performBeanValidation";
+ String PERFORM_BEANVALIDATION = "performBeanValidation";
- public void setPerformBeanValidation(boolean performBeanValidation);
+ void setPerformBeanValidation(boolean performBeanValidation);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java
index 78ff54738ee8..7976b39c2722 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SpringFeatures.java
@@ -19,17 +19,16 @@
public interface SpringFeatures extends BeanValidationFeatures {
- public static final String GENERATE_SPRING_APPLICATION = "generateSpringApplication";
+ String GENERATE_SPRING_APPLICATION = "generateSpringApplication";
- public static final String GENERATE_SPRING_BOOT_APPLICATION = "generateSpringBootApplication";
+ String GENERATE_SPRING_BOOT_APPLICATION = "generateSpringBootApplication";
- public static final String USE_SPRING_ANNOTATION_CONFIG = "useSpringAnnotationConfig";
+ String USE_SPRING_ANNOTATION_CONFIG = "useSpringAnnotationConfig";
- public void setGenerateSpringApplication(boolean useGenerateSpringApplication);
+ void setGenerateSpringApplication(boolean useGenerateSpringApplication);
- public void setGenerateSpringBootApplication(boolean generateSpringBootApplication);
-
- public void setUseSpringAnnotationConfig(boolean useSpringAnnotationConfig);
+ void setGenerateSpringBootApplication(boolean generateSpringBootApplication);
+ void setUseSpringAnnotationConfig(boolean useSpringAnnotationConfig);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java
index 0487bcef88a2..c37135d29585 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerFeatures.java
@@ -19,8 +19,8 @@
public interface SwaggerFeatures {
- public static final String USE_SWAGGER_FEATURE = "useSwaggerFeature";
+ String USE_SWAGGER_FEATURE = "useSwaggerFeature";
- public void setUseSwaggerFeature(boolean useSwaggerFeature);
+ void setUseSwaggerFeature(boolean useSwaggerFeature);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java
index 27483bce2d26..e3e73d29ea21 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/SwaggerUIFeatures.java
@@ -17,10 +17,10 @@
package org.openapitools.codegen.languages.features;
-public interface SwaggerUIFeatures extends CXFFeatures {
+public interface SwaggerUIFeatures {
- public static final String USE_SWAGGER_UI = "useSwaggerUI";
+ String USE_SWAGGER_UI = "useSwaggerUI";
- public void setUseSwaggerUI(boolean useSwaggerUI);
+ void setUseSwaggerUI(boolean useSwaggerUI);
}
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java
index 713e349e3af0..c035bffc432f 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/features/UseGenericResponseFeatures.java
@@ -20,7 +20,7 @@
public interface UseGenericResponseFeatures {
// Language supports generating generic Jaxrs or native return types
- public static final String USE_GENERIC_RESPONSE = "useGenericResponse";
+ String USE_GENERIC_RESPONSE = "useGenericResponse";
- public void setUseGenericResponse(boolean useGenericResponse);
+ void setUseGenericResponse(boolean useGenericResponse);
}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache
index 189eccefbc83..258392223cd6 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache
@@ -1,36 +1,34 @@
package {{configPackage}};
-{{^springFoxDocumentationProvider}}
import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+{{#sourceDocumentationProvider}}
import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
-{{/springFoxDocumentationProvider}}
-import org.springframework.stereotype.Controller;
-{{^springFoxDocumentationProvider}}
import org.springframework.util.StreamUtils;
+import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.GetMapping;
-{{/springFoxDocumentationProvider}}
-import org.springframework.web.bind.annotation.RequestMapping;
-{{^springFoxDocumentationProvider}}
+{{/sourceDocumentationProvider}}
+{{#useSwaggerUI}}
import org.springframework.web.bind.annotation.ResponseBody;
-{{/springFoxDocumentationProvider}}
+import org.springframework.web.bind.annotation.GetMapping;
+{{/useSwaggerUI}}
{{#reactive}}
-import org.springframework.context.annotation.Bean;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;
{{/reactive}}
-
-{{^springFoxDocumentationProvider}}
+{{#sourceDocumentationProvider}}
import java.io.IOException;
import java.io.InputStream;
-{{/springFoxDocumentationProvider}}
+{{/sourceDocumentationProvider}}
{{#reactive}}
import java.net.URI;
{{/reactive}}
-{{^springFoxDocumentationProvider}}
+{{#sourceDocumentationProvider}}
import java.nio.charset.Charset;
-{{/springFoxDocumentationProvider}}
+{{/sourceDocumentationProvider}}
{{#reactive}}
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
@@ -42,8 +40,8 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r
*/
@Controller
public class HomeController {
+{{#sourceDocumentationProvider}}
-{{^springFoxDocumentationProvider}}
private static YAMLMapper yamlMapper = new YAMLMapper();
@Value("classpath:/openapi.yaml")
@@ -67,23 +65,40 @@ public class HomeController {
public Object openapiJson() throws IOException {
return yamlMapper.readValue(openapiContent(), Object.class);
}
+{{/sourceDocumentationProvider}}
+{{#useSwaggerUI}}
+{{^springDocDocumentationProvider}}
+{{#sourceDocumentationProvider}}
+ static final String API_DOCS_PATH = "/openapi.json";
+{{/sourceDocumentationProvider}}
+{{#springFoxDocumentationProvider}}
+ static final String API_DOCS_PATH = "/v2/api-docs";
{{/springFoxDocumentationProvider}}
+
+ @GetMapping(value = "/swagger-config.yaml", produces = "text/plain")
+ @ResponseBody
+ public String swaggerConfig() {
+ return "url: " + API_DOCS_PATH + "\n";
+ }
+{{/springDocDocumentationProvider}}
{{#reactive}}
+
@Bean
RouterFunction index() {
return route(
GET("/"),
- req -> ServerResponse.temporaryRedirect(URI.create("{{#springFoxDocumentationProvider}}swagger-ui.html{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}swagger-ui/index.html?url=../openapi.json{{/springFoxDocumentationProvider}}")).build()
+ req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui.html")).build()
);
}
{{/reactive}}
{{^reactive}}
+
@RequestMapping("/")
public String index() {
- return "redirect:{{#springFoxDocumentationProvider}}swagger-ui.html{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}swagger-ui/index.html?url=../openapi.json{{/springFoxDocumentationProvider}}";
+ return "redirect:swagger-ui.html";
}
{{/reactive}}
+{{/useSwaggerUI}}
-
-}
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache
index b304cb8866d8..75b663946562 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/README.mustache
@@ -2,23 +2,44 @@
Spring Boot Server
-
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
-
{{#springFoxDocumentationProvider}}
-The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox)
+
+The underlying library integrating OpenAPI to Spring Boot is [springfox](https://github.com/springfox/springfox).
+Springfox will generate an OpenAPI v2 (fka Swagger RESTful API Documentation Specification) specification based on the
+generated Controller and Model classes. The specification is available to download using the following url:
+http://localhost:{{serverPort}}/v2/api-docs/
+
+**HEADS-UP**: Springfox is deprecated for removal in version 6.0.0 of openapi-generator. The project seems to be no longer
+maintained (last commit is of Oct 14, 2020). It works with Spring Boot 2.5.x but not with 2.6. Spring Boot 2.5 is
+supported until 2022-05-19. Users of openapi-generator should migrate to the springdoc documentation provider which is,
+as an added bonus, OpenAPI v3 compatible.
{{/springFoxDocumentationProvider}}
+
+{{#springDocDocumentationProvider}}
+
+The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:{{serverPort}}/v3/api-docs/
+{{/springDocDocumentationProvider}}
+{{#sourceDocumentationProvider}}
+
+The OpenAPI specification used to generate this project is available to download using the following url:
+http://localhost:{{serverPort}}/openapi.json
+{{/sourceDocumentationProvider}}
+
Start your server as a simple java application
+{{#useSwaggerUI}}
-{{^reactive}}
You can view the api documentation in swagger-ui by pointing to
-http://localhost:{{serverPort}}/
+http://localhost:{{serverPort}}/swagger-ui.html
-{{/reactive}}
+{{/useSwaggerUI}}
Change default port value in application.properties{{/interfaceOnly}}{{#interfaceOnly}}
# OpenAPI generated API stub
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/SpringBootTest.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/SpringBootTest.mustache
new file mode 100644
index 000000000000..f8d9032c6032
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/SpringBootTest.mustache
@@ -0,0 +1,13 @@
+package {{basePackage}};
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OpenApiGeneratorApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache
index 06f041051b96..f8740df9541d 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/application.mustache
@@ -1,6 +1,3 @@
-{{#springFoxDocumentationProvider}}
-springfox.documentation.swagger.v2.path=/api-docs
-{{/springFoxDocumentationProvider}}
server.port={{serverPort}}
spring.jackson.date-format={{basePackage}}.RFC3339DateFormat
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache
index 5649aaa99dbc..01725be2d207 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/openapi2SpringBoot.mustache
@@ -1,73 +1,20 @@
package {{basePackage}};
-import com.fasterxml.jackson.databind.Module;
{{#openApiNullable}}
+import com.fasterxml.jackson.databind.Module;
import org.openapitools.jackson.nullable.JsonNullableModule;
{{/openApiNullable}}
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
-{{^reactive}}
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
- {{^springFoxDocumentationProvider}}
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
- {{/springFoxDocumentationProvider}}
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-{{/reactive}}
-{{#reactive}}
-import org.springframework.web.reactive.config.CorsRegistry;
- {{^springFoxDocumentationProvider}}
-import org.springframework.web.reactive.config.ResourceHandlerRegistry;
- {{/springFoxDocumentationProvider}}
-import org.springframework.web.reactive.config.WebFluxConfigurer;
-{{/reactive}}
@SpringBootApplication
@ComponentScan(basePackages = {"{{basePackage}}", "{{apiPackage}}" , "{{configPackage}}"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public Web{{^reactive}}Mvc{{/reactive}}{{#reactive}}Flux{{/reactive}}Configurer webConfigurer() {
- return new Web{{^reactive}}Mvc{{/reactive}}{{#reactive}}Flux{{/reactive}}Configurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-{{^springFoxDocumentationProvider}}
+public class OpenApiGeneratorApplication {
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
-{{/springFoxDocumentationProvider}}
- };
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
}
{{#openApiNullable}}
@@ -77,4 +24,4 @@ public class OpenAPI2SpringBoot implements CommandLineRunner {
}
{{/openApiNullable}}
-}
+}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache
index 9fc6b89ca756..ccdd99326ace 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache
@@ -25,6 +25,9 @@
{{/swagger2AnnotationLibrary}}
{{/springDocDocumentationProvider}}
{{/springFoxDocumentationProvider}}
+ {{#useSwaggerUI}}
+ 4.4.1-1
+ {{/useSwaggerUI}}
{{#parentOverridden}}
@@ -37,7 +40,7 @@
org.springframework.boot
spring-boot-starter-parent
- {{#springFoxDocumentationProvider}}2.5.8{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}2.6.2{{/springFoxDocumentationProvider}}
+ {{#springFoxDocumentationProvider}}2.5.8{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}2.6.3{{/springFoxDocumentationProvider}}
{{/parentOverridden}}
@@ -94,11 +97,20 @@
{{#springDocDocumentationProvider}}
+ {{#useSwaggerUI}}
org.springdoc
- springdoc-openapi-ui
+ springdoc-openapi-{{#reactive}}webflux-{{/reactive}}ui
${springdoc.version}
+ {{/useSwaggerUI}}
+ {{^useSwaggerUI}}
+
+ org.springdoc
+ springdoc-openapi-{{#reactive}}webflux{{/reactive}}{{^reactive}}webmvc{{/reactive}}-core
+ ${springdoc.version}
+
+ {{/useSwaggerUI}}
{{/springDocDocumentationProvider}}
{{#springFoxDocumentationProvider}}
@@ -108,6 +120,19 @@
${springfox.version}
{{/springFoxDocumentationProvider}}
+ {{#useSwaggerUI}}
+ {{^springDocDocumentationProvider}}
+
+ org.webjars
+ swagger-ui
+ ${swagger-ui.version}
+
+
+ org.webjars
+ webjars-locator-core
+
+ {{/springDocDocumentationProvider}}
+ {{/useSwaggerUI}}
{{^springFoxDocumentationProvider}}
{{^springDocDocumentationProvider}}
{{#swagger1AnnotationLibrary}}
@@ -204,5 +229,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/swagger-ui.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/swagger-ui.mustache
new file mode 100644
index 000000000000..f85b6654f67d
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-boot/swagger-ui.mustache
@@ -0,0 +1,60 @@
+
+
+
+
+
+ Swagger UI
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache
deleted file mode 100644
index bdd21d95a70d..000000000000
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/README.mustache
+++ /dev/null
@@ -1,14 +0,0 @@
-# OpenAPI generated server
-
-Spring MVC Server
-
-
-## Overview
-This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the Spring MVC framework.
-
-{{#springFoxDocumentationProvider}}
-The underlying library integrating OpenAPI to Spring-MVC is [springfox](https://github.com/springfox/springfox)
-
-{{/springFoxDocumentationProvider}}
-You can view the server in swagger-ui by pointing to
-http://localhost:{{serverPort}}{{contextPath}}{{^contextPath}}/{{/contextPath}}/
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/RFC3339DateFormat.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/RFC3339DateFormat.mustache
deleted file mode 100644
index 84897b70d400..000000000000
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/RFC3339DateFormat.mustache
+++ /dev/null
@@ -1,38 +0,0 @@
-package {{configPackage}};
-
-import com.fasterxml.jackson.databind.util.StdDateFormat;
-
-import java.text.DateFormat;
-import java.text.FieldPosition;
-import java.text.ParsePosition;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
-
-public class RFC3339DateFormat extends DateFormat {
- private static final long serialVersionUID = 1L;
- private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
-
- private final StdDateFormat fmt = new StdDateFormat()
- .withTimeZone(TIMEZONE_Z)
- .withColonInTimeZone(true);
-
- public RFC3339DateFormat() {
- this.calendar = new GregorianCalendar();
- }
-
- @Override
- public Date parse(String source, ParsePosition pos) {
- return fmt.parse(source, pos);
- }
-
- @Override
- public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
- return fmt.format(date, toAppendTo, fieldPosition);
- }
-
- @Override
- public Object clone() {
- return this;
- }
-}
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache
deleted file mode 100644
index 655c870be613..000000000000
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/application.mustache
+++ /dev/null
@@ -1,3 +0,0 @@
-{{#springFoxDocumentationProvider}}
-springfox.documentation.swagger.v2.path=/api-docs
-{{/springFoxDocumentationProvider}}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/defaultBasePath.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/defaultBasePath.mustache
deleted file mode 100644
index 35ec3b9d7586..000000000000
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/defaultBasePath.mustache
+++ /dev/null
@@ -1 +0,0 @@
-/
\ No newline at end of file
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache
deleted file mode 100644
index a9b5410403d2..000000000000
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/openapiUiConfiguration.mustache
+++ /dev/null
@@ -1,126 +0,0 @@
-package {{configPackage}};
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-{{#threetenbp}}
-import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule;
-{{/threetenbp}}
-{{#openApiNullable}}
-import org.openapitools.jackson.nullable.JsonNullableModule;
-{{/openApiNullable}}
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-{{#springFoxDocumentationProvider}}
-import org.springframework.context.annotation.Import;
-{{/springFoxDocumentationProvider}}
-import org.springframework.context.annotation.Bean;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.converter.StringHttpMessageConverter;
-import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
-import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
-{{#threetenbp}}
-import org.threeten.bp.Instant;
-import org.threeten.bp.OffsetDateTime;
-import org.threeten.bp.ZonedDateTime;
-{{/threetenbp}}
-
-import org.springframework.web.method.support.HandlerMethodArgumentResolver;
-import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
-
-import java.util.List;
-import javax.annotation.Generated;
-
-{{>generatedAnnotation}}
-@Configuration
-@ComponentScan(basePackages = {"{{apiPackage}}", "{{configPackage}}"})
-@EnableWebMvc
-@PropertySource("classpath:application.properties")
-{{#springFoxDocumentationProvider}}
-@Import(OpenAPIDocumentationConfig.class)
-{{/springFoxDocumentationProvider}}
-public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter {
- private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" };
-
- private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
- "classpath:/META-INF/resources/", "classpath:/resources/",
- "classpath:/static/", "classpath:/public/" };
-
- private static final String[] RESOURCE_LOCATIONS;
- static {
- RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length
- + SERVLET_RESOURCE_LOCATIONS.length];
- System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0,
- SERVLET_RESOURCE_LOCATIONS.length);
- System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS,
- SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length);
- }
-
- private static final String[] STATIC_INDEX_HTML_RESOURCES;
- static {
- STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length];
- for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) {
- STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html";
- }
- }
-
- @Override
- public void addArgumentResolvers(List argumentResolvers) {
- argumentResolvers.add(new PageableHandlerMethodArgumentResolver());
- super.addArgumentResolvers(argumentResolvers);
- }
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- if (!registry.hasMappingForPattern("/webjars/**")) {
- registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
- }
- if (!registry.hasMappingForPattern("/**")) {
- registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS);
- }
- {{^springFoxDocumentationProvider}}
- if (!registry.hasMappingForPattern("/swagger-ui/**")) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
- {{/springFoxDocumentationProvider}}
- }
-
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Bean
- public Jackson2ObjectMapperBuilder builder() {
- {{#threetenbp}}
- ThreeTenModule module = new ThreeTenModule();
- module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT);
- module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME);
- module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME);
- {{/threetenbp}}
- return new Jackson2ObjectMapperBuilder()
- .indentOutput(true)
- .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
- {{#openApiNullable}}.modulesToInstall({{#threetenbp}}module, {{/threetenbp}}new JsonNullableModule()){{/openApiNullable}}
- {{^openApiNullable}}{{#threetenbp}}.modulesToInstall(module){{/threetenbp}}{{/openApiNullable}}
- .dateFormat(new RFC3339DateFormat());
- }
-
- @Override
- public void configureMessageConverters(List> converters) {
- converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));
- converters.add(new StringHttpMessageConverter());
- super.configureMessageConverters(converters);
- }
-
- @Bean
- public ObjectMapper objectMapper(){
- return builder().build();
- }
-}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache
deleted file mode 100644
index a1cd9ae20857..000000000000
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache
+++ /dev/null
@@ -1,303 +0,0 @@
-
- 4.0.0
- {{groupId}}
- {{artifactId}}
- jar
- {{artifactId}}
- {{artifactVersion}}
-{{#parentOverridden}}
-
- {{{parentGroupId}}}
- {{{parentArtifactId}}}
- {{{parentVersion}}}
-
-{{/parentOverridden}}
-
- src/main/java
-
-
- org.apache.maven.plugins
- maven-war-plugin
- 3.1.0
-
-
- maven-failsafe-plugin
- 2.6
-
-
-
- integration-test
- verify
-
-
-
-
-
- org.eclipse.jetty
- jetty-maven-plugin
- ${jetty-version}
-
-
- {{contextPath}}{{^contextPath}}/{{/contextPath}}
-
- target/${project.artifactId}-${project.version}
- 8079
- stopit
- 10
-
- {{serverPort}}
- 60000
-
-
-{{#useBeanValidation}}
-
-
- jakarta.validation
- jakarta.validation-api
- ${beanvalidation-version}
-
-
-{{/useBeanValidation}}
-
-
- start-jetty
- pre-integration-test
-
- start
-
-
- 0
- true
-
-
-
- stop-jetty
- post-integration-test
-
- stop
-
-
-
-
- {{#apiFirst}}
-
- org.openapitools
- openapi-generator-maven-plugin
- {{{generatorVersion}}}
-
-
-
- generate
-
-
- src/main/resources/openapi.yaml
- spring
- spring-mvc
- {{{apiPackage}}}
- {{{modelPackage}}}
- false
- {{#modelNamePrefix}}
- {{{.}}}
- {{/modelNamePrefix}}
- {{#modelNameSuffix}}
- {{{.}}}
- {{/modelNameSuffix}}
-
- {{#configOptions}}
- <{{left}}>{{right}}{{left}}>
- {{/configOptions}}
-
-
-
-
-
- {{/apiFirst}}
-
-
-
-
- org.slf4j
- slf4j-log4j12
- ${slf4j-version}
-
-
-
-
- org.springframework
- spring-core
- ${spring-version}
-
-
- org.springframework
- spring-webmvc
- ${spring-version}
-
-
- org.springframework
- spring-web
- ${spring-version}
-
-
- jakarta.annotation
- jakarta.annotation-api
- ${jakarta-annotation-version}
-
-
- jakarta.xml.bind
- jakarta.xml.bind-api
- ${jakarta.xml.bind-version}
-
- {{#springFoxDocumentationProvider}}
-
-
- io.springfox
- springfox-swagger2
- ${springfox-version}
-
-
- com.fasterxml.jackson.core
- jackson-annotations
-
-
-
-
- io.springfox
- springfox-swagger-ui
- ${springfox-version}
-
- {{/springFoxDocumentationProvider}}
- {{^springFoxDocumentationProvider}}
-
- io.springfox
- springfox-swagger2
- ${springfox-version}
-
-
- com.fasterxml.jackson.core
- jackson-annotations
-
-
-
-
- org.webjars
- swagger-ui
- 3.14.2
-
- {{#oas3}}
-
- io.swagger.core.v3
- swagger-annotations
- ${swagger-core-version}
-
- {{/oas3}}
- {{^oas3}}
-
- io.swagger
- swagger-annotations
- ${swagger-core-version}
-
- {{/oas3}}
-
-
- com.google.code.findbugs
- jsr305
- 3.0.2
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-yaml
- ${jackson-version}
-
- {{/springFoxDocumentationProvider}}
- {{#withXml}}
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-xml
- ${jackson-version}
-
- {{/withXml}}
- {{#joda}}
-
- com.fasterxml.jackson.datatype
- jackson-datatype-joda
- ${jackson-version}
-
- {{/joda}}
- {{#threetenbp}}
-
- com.github.joschi.jackson
- jackson-datatype-threetenbp
- ${jackson-threetenbp-version}
-
- {{/threetenbp}}
- {{#openApiNullable}}
-
- org.openapitools
- jackson-databind-nullable
- ${jackson-databind-nullable-version}
-
- {{/openApiNullable}}
-
- junit
- junit
- ${junit-version}
- test
-
-
- jakarta.servlet
- jakarta.servlet-api
- ${servlet-api-version}
-
-{{#useBeanValidation}}
-
-
- jakarta.validation
- jakarta.validation-api
- ${beanvalidation-version}
- provided
-
-{{/useBeanValidation}}
-{{#hateoas}}
-
-
- org.springframework.hateoas
- spring-hateoas
- 1.0.1.RELEASE
-
-{{/hateoas}}
-
- org.springframework.data
- spring-data-commons
- 2.0.11.RELEASE
-
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson-databind-version}
-
-
-
- 1.8
- ${java.version}
- ${java.version}
- 1.3.5
- 2.3.3
- 9.2.15.v20160210
- 1.7.21
- 4.13.1
- 4.0.4
- 2.9.2
- 2.9.9
- 2.8.4
-{{#useBeanValidation}}
- 2.0.2
-{{/useBeanValidation}}
- 4.3.20.RELEASE
- {{#openApiNullable}}
- 0.2.2
- {{/openApiNullable}}
- 2.9.8
- {{#oas3}}2.1.11{{/oas3}}{{^oas3}}1.6.3{{/oas3}}
-
-
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webApplication.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webApplication.mustache
deleted file mode 100644
index ff18a53cdaca..000000000000
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webApplication.mustache
+++ /dev/null
@@ -1,23 +0,0 @@
-package {{configPackage}};
-
-import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
-import javax.annotation.Generated;
-
-{{>generatedAnnotation}}
-public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer {
-
- @Override
- protected Class>[] getRootConfigClasses() {
- return new Class[] { OpenAPIUiConfiguration.class };
- }
-
- @Override
- protected Class>[] getServletConfigClasses() {
- return new Class>[] { WebMvcConfiguration.class };
- }
-
- @Override
- protected String[] getServletMappings() {
- return new String[] { "/" };
- }
-}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webMvcConfiguration.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webMvcConfiguration.mustache
deleted file mode 100644
index a77ca1552b9e..000000000000
--- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/webMvcConfiguration.mustache
+++ /dev/null
@@ -1,13 +0,0 @@
-package {{configPackage}};
-
-import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
-import javax.annotation.Generated;
-
-{{>generatedAnnotation}}
-public class WebMvcConfiguration extends WebMvcConfigurationSupport {
- @Override
- public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
- configurer.enable();
- }
-}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache
index f240b38c05e1..eabd41caf918 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/openapiDocumentationConfig.mustache
@@ -24,7 +24,7 @@ import javax.servlet.ServletContext;
{{>generatedAnnotation}}
@Configuration
@EnableSwagger2
-public class OpenAPIDocumentationConfig {
+public class SpringFoxConfiguration {
ApiInfo apiInfo() {
return new ApiInfoBuilder()
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java
index 5868af8466da..997a1a2ab0c0 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java
@@ -775,7 +775,7 @@ public void shouldGenerateDefaultValueForEnumRequestParameter() throws IOExcepti
}
/**define the destinationFilename*/
- private final static String DESTINATIONFILE = "OpenAPIDocumentationConfig.java";
+ private final static String DESTINATIONFILE = "SpringFoxConfiguration.java";
/**define the templateFile*/
private final static String TEMPLATEFILE = "openapiDocumentationConfig.mustache";
@@ -787,14 +787,14 @@ public void shouldGenerateDefaultValueForEnumRequestParameter() throws IOExcepti
public void testConfigFileGeneration() {
final SpringCodegen codegen = new SpringCodegen();
-
+ codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox");
codegen.additionalProperties().put(SpringCodegen.INTERFACE_ONLY, false);
codegen.additionalProperties().put(SpringCodegen.SPRING_CLOUD_LIBRARY, "spring-cloud");
- codegen.additionalProperties().put(SpringCodegen.OPENAPI_DOCKET_CONFIG, true);
codegen.additionalProperties().put(SpringCodegen.REACTIVE, false);
codegen.additionalProperties().put(SpringCodegen.API_FIRST, false);
codegen.processOpts();
+
final List supList = codegen.supportingFiles();
String tmpFile;
String desFile;
diff --git a/pom.xml b/pom.xml
index 643d5b98329e..d719aa806de4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1036,18 +1036,6 @@
samples/client/petstore/go
-
- spring-mvc
-
-
- env
- java
-
-
-
- samples/server/petstore/spring-mvc
-
-
springboot-beanvalidation
@@ -1186,10 +1174,6 @@
samples/server/petstore/jaxrs/jersey2
samples/server/petstore/jaxrs/jersey2-useTags
- samples/server/petstore/spring-mvc
- samples/server/petstore/spring-mvc-default-value
- samples/server/petstore/spring-mvc-j8-async
- samples/server/petstore/spring-mvc-j8-localdatetime
samples/server/petstore/java-camel
samples/server/petstore/jaxrs-jersey
diff --git a/samples/client/petstore/spring-stubs/pom.xml b/samples/client/petstore/spring-stubs/pom.xml
index ef22a9c572a8..6a65cedf99b7 100644
--- a/samples/client/petstore/spring-stubs/pom.xml
+++ b/samples/client/petstore/spring-stubs/pom.xml
@@ -10,6 +10,7 @@
${java.version}
${java.version}
2.9.2
+ 4.4.1-1
org.springframework.boot
@@ -34,6 +35,15 @@
springfox-swagger2
${springfox.version}
+
+ org.webjars
+ swagger-ui
+ ${swagger-ui.version}
+
+
+ org.webjars
+ webjars-locator-core
+
com.google.code.findbugs
@@ -62,5 +72,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml
index b2890ab9d519..5a357f4fd888 100644
--- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml
+++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/pom.xml
@@ -10,11 +10,12 @@
${java.version}
${java.version}
1.6.4
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -62,5 +63,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/client/petstore/spring-stubs/pom.xml b/samples/openapi3/client/petstore/spring-stubs/pom.xml
index b2890ab9d519..5a357f4fd888 100644
--- a/samples/openapi3/client/petstore/spring-stubs/pom.xml
+++ b/samples/openapi3/client/petstore/spring-stubs/pom.xml
@@ -10,11 +10,12 @@
${java.version}
${java.version}
1.6.4
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -62,5 +63,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES b/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES
index 7de4a0d86c09..baf10ab6b83b 100644
--- a/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES
+++ b/samples/openapi3/server/petstore/spring-boot-springdoc/.openapi-generator/FILES
@@ -1,6 +1,6 @@
README.md
pom.xml
-src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
src/main/java/org/openapitools/RFC3339DateFormat.java
src/main/java/org/openapitools/api/ApiUtil.java
src/main/java/org/openapitools/api/PetApi.java
@@ -18,3 +18,4 @@ src/main/java/org/openapitools/model/Tag.java
src/main/java/org/openapitools/model/User.java
src/main/resources/application.properties
src/main/resources/openapi.yaml
+src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/README.md b/samples/openapi3/server/petstore/spring-boot-springdoc/README.md
index 5bbe4a495d99..28079dcd2a86 100644
--- a/samples/openapi3/server/petstore/spring-boot-springdoc/README.md
+++ b/samples/openapi3/server/petstore/spring-boot-springdoc/README.md
@@ -2,15 +2,16 @@
Spring Boot Server
-
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
-Start your server as a simple java application
-You can view the api documentation in swagger-ui by pointing to
-http://localhost:8080/
+The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:8080/v3/api-docs/
+Start your server as a simple java application
Change default port value in application.properties
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml
index 8cc169fadddd..dd6b400eb7a3 100644
--- a/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml
+++ b/samples/openapi3/server/petstore/spring-boot-springdoc/pom.xml
@@ -14,7 +14,7 @@
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -37,7 +37,7 @@
org.springdoc
- springdoc-openapi-ui
+ springdoc-openapi-webmvc-core
${springdoc.version}
@@ -68,5 +68,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index cb088f451935..000000000000
--- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.Module;
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebMvcConfigurer webConfigurer() {
- return new WebMvcConfigurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
- };
- }
-
- @Bean
- public Module jsonNullableModule() {
- return new JsonNullableModule();
- }
-
-}
diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..f62fd6d91797
--- /dev/null
+++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
@@ -0,0 +1,23 @@
+package org.openapitools;
+
+import com.fasterxml.jackson.databind.Module;
+import org.openapitools.jackson.nullable.JsonNullableModule;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
+public class OpenApiGeneratorApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
+ }
+
+ @Bean
+ public Module jsonNullableModule() {
+ return new JsonNullableModule();
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java
index 61d4ebb31830..707313504790 100644
--- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java
+++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/configuration/HomeController.java
@@ -1,18 +1,8 @@
package org.openapitools.configuration;
import org.springframework.context.annotation.Bean;
-import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
-import org.springframework.util.StreamUtils;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
/**
* Home redirection to OpenAPI api documentation
@@ -20,34 +10,4 @@
@Controller
public class HomeController {
- private static YAMLMapper yamlMapper = new YAMLMapper();
-
- @Value("classpath:/openapi.yaml")
- private Resource openapi;
-
- @Bean
- public String openapiContent() throws IOException {
- try(InputStream is = openapi.getInputStream()) {
- return StreamUtils.copyToString(is, Charset.defaultCharset());
- }
- }
-
- @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi")
- @ResponseBody
- public String openapiYaml() throws IOException {
- return openapiContent();
- }
-
- @GetMapping(value = "/openapi.json", produces = "application/json")
- @ResponseBody
- public Object openapiJson() throws IOException {
- return yamlMapper.readValue(openapiContent(), Object.class);
- }
-
- @RequestMapping("/")
- public String index() {
- return "redirect:swagger-ui/index.html?url=../openapi.json";
- }
-
-
-}
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
new file mode 100644
index 000000000000..3681f67e7705
--- /dev/null
+++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
@@ -0,0 +1,13 @@
+package org.openapitools;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OpenApiGeneratorApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES
index 6d8d3656155a..dcc247ba165c 100644
--- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES
+++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES
@@ -1,6 +1,6 @@
README.md
pom.xml
-src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
src/main/java/org/openapitools/RFC3339DateFormat.java
src/main/java/org/openapitools/api/AnotherFakeApi.java
src/main/java/org/openapitools/api/AnotherFakeApiController.java
@@ -66,3 +66,4 @@ src/main/java/org/openapitools/model/User.java
src/main/java/org/openapitools/model/XmlItem.java
src/main/resources/application.properties
src/main/resources/openapi.yaml
+src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md
index befc961488ae..e6de7e038cea 100644
--- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md
+++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md
@@ -2,15 +2,20 @@
Spring Boot Server
-
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
+
+The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:80/v3/api-docs/
+
Start your server as a simple java application
You can view the api documentation in swagger-ui by pointing to
-http://localhost:80/
+http://localhost:80/swagger-ui.html
Change default port value in application.properties
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml
index 81e608be23ab..fe0cd0c3a1de 100644
--- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml
+++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml
@@ -10,11 +10,12 @@
${java.version}
${java.version}
1.6.4
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -63,5 +64,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index f265e75c51b3..000000000000
--- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.Module;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebMvcConfigurer webConfigurer() {
- return new WebMvcConfigurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
- };
- }
-
-
-}
diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..1ebe51cb901d
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
@@ -0,0 +1,17 @@
+package org.openapitools;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
+public class OpenApiGeneratorApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
+ }
+
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java
index 61d4ebb31830..9aa29284ab5f 100644
--- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java
+++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java
@@ -1,18 +1,10 @@
package org.openapitools.configuration;
import org.springframework.context.annotation.Bean;
-import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
-import org.springframework.util.StreamUtils;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
+import org.springframework.web.bind.annotation.GetMapping;
/**
* Home redirection to OpenAPI api documentation
@@ -20,34 +12,9 @@
@Controller
public class HomeController {
- private static YAMLMapper yamlMapper = new YAMLMapper();
-
- @Value("classpath:/openapi.yaml")
- private Resource openapi;
-
- @Bean
- public String openapiContent() throws IOException {
- try(InputStream is = openapi.getInputStream()) {
- return StreamUtils.copyToString(is, Charset.defaultCharset());
- }
- }
-
- @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi")
- @ResponseBody
- public String openapiYaml() throws IOException {
- return openapiContent();
- }
-
- @GetMapping(value = "/openapi.json", produces = "application/json")
- @ResponseBody
- public Object openapiJson() throws IOException {
- return yamlMapper.readValue(openapiContent(), Object.class);
- }
-
@RequestMapping("/")
public String index() {
- return "redirect:swagger-ui/index.html?url=../openapi.json";
+ return "redirect:swagger-ui.html";
}
-
-}
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
new file mode 100644
index 000000000000..3681f67e7705
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
@@ -0,0 +1,13 @@
+package org.openapitools;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OpenApiGeneratorApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES
index bd5a0e2c0574..0ed351e7bdaf 100644
--- a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES
+++ b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES
@@ -1,6 +1,6 @@
README.md
pom.xml
-src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
src/main/java/org/openapitools/RFC3339DateFormat.java
src/main/java/org/openapitools/api/AnotherFakeApi.java
src/main/java/org/openapitools/api/AnotherFakeApiController.java
@@ -72,3 +72,4 @@ src/main/java/org/openapitools/model/User.java
src/main/java/org/openapitools/model/XmlItem.java
src/main/resources/application.properties
src/main/resources/openapi.yaml
+src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/openapi3/server/petstore/springboot-delegate/README.md b/samples/openapi3/server/petstore/springboot-delegate/README.md
index befc961488ae..e6de7e038cea 100644
--- a/samples/openapi3/server/petstore/springboot-delegate/README.md
+++ b/samples/openapi3/server/petstore/springboot-delegate/README.md
@@ -2,15 +2,20 @@
Spring Boot Server
-
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
+
+The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:80/v3/api-docs/
+
Start your server as a simple java application
You can view the api documentation in swagger-ui by pointing to
-http://localhost:80/
+http://localhost:80/swagger-ui.html
Change default port value in application.properties
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-delegate/pom.xml b/samples/openapi3/server/petstore/springboot-delegate/pom.xml
index 8edd9579ef5c..3817b6421c0b 100644
--- a/samples/openapi3/server/petstore/springboot-delegate/pom.xml
+++ b/samples/openapi3/server/petstore/springboot-delegate/pom.xml
@@ -10,11 +10,12 @@
${java.version}
${java.version}
1.6.4
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -68,5 +69,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index cb088f451935..000000000000
--- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.Module;
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebMvcConfigurer webConfigurer() {
- return new WebMvcConfigurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
- };
- }
-
- @Bean
- public Module jsonNullableModule() {
- return new JsonNullableModule();
- }
-
-}
diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..f62fd6d91797
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
@@ -0,0 +1,23 @@
+package org.openapitools;
+
+import com.fasterxml.jackson.databind.Module;
+import org.openapitools.jackson.nullable.JsonNullableModule;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
+public class OpenApiGeneratorApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
+ }
+
+ @Bean
+ public Module jsonNullableModule() {
+ return new JsonNullableModule();
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java
index 61d4ebb31830..9aa29284ab5f 100644
--- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java
+++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/configuration/HomeController.java
@@ -1,18 +1,10 @@
package org.openapitools.configuration;
import org.springframework.context.annotation.Bean;
-import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
-import org.springframework.util.StreamUtils;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
+import org.springframework.web.bind.annotation.GetMapping;
/**
* Home redirection to OpenAPI api documentation
@@ -20,34 +12,9 @@
@Controller
public class HomeController {
- private static YAMLMapper yamlMapper = new YAMLMapper();
-
- @Value("classpath:/openapi.yaml")
- private Resource openapi;
-
- @Bean
- public String openapiContent() throws IOException {
- try(InputStream is = openapi.getInputStream()) {
- return StreamUtils.copyToString(is, Charset.defaultCharset());
- }
- }
-
- @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi")
- @ResponseBody
- public String openapiYaml() throws IOException {
- return openapiContent();
- }
-
- @GetMapping(value = "/openapi.json", produces = "application/json")
- @ResponseBody
- public Object openapiJson() throws IOException {
- return yamlMapper.readValue(openapiContent(), Object.class);
- }
-
@RequestMapping("/")
public String index() {
- return "redirect:swagger-ui/index.html?url=../openapi.json";
+ return "redirect:swagger-ui.html";
}
-
-}
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
new file mode 100644
index 000000000000..3681f67e7705
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-delegate/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
@@ -0,0 +1,13 @@
+package org.openapitools;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OpenApiGeneratorApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES
index 6d8d3656155a..dcc247ba165c 100644
--- a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES
+++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES
@@ -1,6 +1,6 @@
README.md
pom.xml
-src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
src/main/java/org/openapitools/RFC3339DateFormat.java
src/main/java/org/openapitools/api/AnotherFakeApi.java
src/main/java/org/openapitools/api/AnotherFakeApiController.java
@@ -66,3 +66,4 @@ src/main/java/org/openapitools/model/User.java
src/main/java/org/openapitools/model/XmlItem.java
src/main/resources/application.properties
src/main/resources/openapi.yaml
+src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/README.md b/samples/openapi3/server/petstore/springboot-implicitHeaders/README.md
index befc961488ae..e6de7e038cea 100644
--- a/samples/openapi3/server/petstore/springboot-implicitHeaders/README.md
+++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/README.md
@@ -2,15 +2,20 @@
Spring Boot Server
-
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
+
+The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:80/v3/api-docs/
+
Start your server as a simple java application
You can view the api documentation in swagger-ui by pointing to
-http://localhost:80/
+http://localhost:80/swagger-ui.html
Change default port value in application.properties
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml
index 7759fcc3928a..072919a92260 100644
--- a/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml
+++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/pom.xml
@@ -10,11 +10,12 @@
${java.version}
${java.version}
1.6.4
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -68,5 +69,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index cb088f451935..000000000000
--- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.Module;
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebMvcConfigurer webConfigurer() {
- return new WebMvcConfigurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
- };
- }
-
- @Bean
- public Module jsonNullableModule() {
- return new JsonNullableModule();
- }
-
-}
diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..f62fd6d91797
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
@@ -0,0 +1,23 @@
+package org.openapitools;
+
+import com.fasterxml.jackson.databind.Module;
+import org.openapitools.jackson.nullable.JsonNullableModule;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
+public class OpenApiGeneratorApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
+ }
+
+ @Bean
+ public Module jsonNullableModule() {
+ return new JsonNullableModule();
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java
index 61d4ebb31830..9aa29284ab5f 100644
--- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java
+++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/configuration/HomeController.java
@@ -1,18 +1,10 @@
package org.openapitools.configuration;
import org.springframework.context.annotation.Bean;
-import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
-import org.springframework.util.StreamUtils;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
+import org.springframework.web.bind.annotation.GetMapping;
/**
* Home redirection to OpenAPI api documentation
@@ -20,34 +12,9 @@
@Controller
public class HomeController {
- private static YAMLMapper yamlMapper = new YAMLMapper();
-
- @Value("classpath:/openapi.yaml")
- private Resource openapi;
-
- @Bean
- public String openapiContent() throws IOException {
- try(InputStream is = openapi.getInputStream()) {
- return StreamUtils.copyToString(is, Charset.defaultCharset());
- }
- }
-
- @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi")
- @ResponseBody
- public String openapiYaml() throws IOException {
- return openapiContent();
- }
-
- @GetMapping(value = "/openapi.json", produces = "application/json")
- @ResponseBody
- public Object openapiJson() throws IOException {
- return yamlMapper.readValue(openapiContent(), Object.class);
- }
-
@RequestMapping("/")
public String index() {
- return "redirect:swagger-ui/index.html?url=../openapi.json";
+ return "redirect:swagger-ui.html";
}
-
-}
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
new file mode 100644
index 000000000000..3681f67e7705
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
@@ -0,0 +1,13 @@
+package org.openapitools;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OpenApiGeneratorApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES
index bd5a0e2c0574..0ed351e7bdaf 100644
--- a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES
+++ b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES
@@ -1,6 +1,6 @@
README.md
pom.xml
-src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
src/main/java/org/openapitools/RFC3339DateFormat.java
src/main/java/org/openapitools/api/AnotherFakeApi.java
src/main/java/org/openapitools/api/AnotherFakeApiController.java
@@ -72,3 +72,4 @@ src/main/java/org/openapitools/model/User.java
src/main/java/org/openapitools/model/XmlItem.java
src/main/resources/application.properties
src/main/resources/openapi.yaml
+src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/openapi3/server/petstore/springboot-reactive/README.md b/samples/openapi3/server/petstore/springboot-reactive/README.md
index 55dc732c1b00..e6de7e038cea 100644
--- a/samples/openapi3/server/petstore/springboot-reactive/README.md
+++ b/samples/openapi3/server/petstore/springboot-reactive/README.md
@@ -2,12 +2,20 @@
Spring Boot Server
-
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
+
+The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:80/v3/api-docs/
+
Start your server as a simple java application
+You can view the api documentation in swagger-ui by pointing to
+http://localhost:80/swagger-ui.html
+
Change default port value in application.properties
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-reactive/pom.xml b/samples/openapi3/server/petstore/springboot-reactive/pom.xml
index 098af25f1834..417ecda3e692 100644
--- a/samples/openapi3/server/petstore/springboot-reactive/pom.xml
+++ b/samples/openapi3/server/petstore/springboot-reactive/pom.xml
@@ -10,11 +10,12 @@
${java.version}
${java.version}
1.6.4
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -37,7 +38,7 @@
org.springdoc
- springdoc-openapi-ui
+ springdoc-openapi-webflux-ui
${springdoc.version}
@@ -68,5 +69,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index 254af0225142..000000000000
--- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.Module;
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.reactive.config.CorsRegistry;
-import org.springframework.web.reactive.config.ResourceHandlerRegistry;
-import org.springframework.web.reactive.config.WebFluxConfigurer;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebFluxConfigurer webConfigurer() {
- return new WebFluxConfigurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
- };
- }
-
- @Bean
- public Module jsonNullableModule() {
- return new JsonNullableModule();
- }
-
-}
diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..f62fd6d91797
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
@@ -0,0 +1,23 @@
+package org.openapitools;
+
+import com.fasterxml.jackson.databind.Module;
+import org.openapitools.jackson.nullable.JsonNullableModule;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
+public class OpenApiGeneratorApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
+ }
+
+ @Bean
+ public Module jsonNullableModule() {
+ return new JsonNullableModule();
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java
index fadcaeb03c60..cf658246a9de 100644
--- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java
+++ b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java
@@ -1,22 +1,13 @@
package org.openapitools.configuration;
import org.springframework.context.annotation.Bean;
-import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
-import org.springframework.util.StreamUtils;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.context.annotation.Bean;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;
-
-import java.io.IOException;
-import java.io.InputStream;
import java.net.URI;
-import java.nio.charset.Charset;
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
@@ -27,37 +18,12 @@
@Controller
public class HomeController {
- private static YAMLMapper yamlMapper = new YAMLMapper();
-
- @Value("classpath:/openapi.yaml")
- private Resource openapi;
-
- @Bean
- public String openapiContent() throws IOException {
- try(InputStream is = openapi.getInputStream()) {
- return StreamUtils.copyToString(is, Charset.defaultCharset());
- }
- }
-
- @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi")
- @ResponseBody
- public String openapiYaml() throws IOException {
- return openapiContent();
- }
-
- @GetMapping(value = "/openapi.json", produces = "application/json")
- @ResponseBody
- public Object openapiJson() throws IOException {
- return yamlMapper.readValue(openapiContent(), Object.class);
- }
-
@Bean
RouterFunction index() {
return route(
GET("/"),
- req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui/index.html?url=../openapi.json")).build()
+ req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui.html")).build()
);
}
-
-}
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
new file mode 100644
index 000000000000..3681f67e7705
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
@@ -0,0 +1,13 @@
+package org.openapitools;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OpenApiGeneratorApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator-ignore b/samples/openapi3/server/petstore/springboot-source/.openapi-generator-ignore
similarity index 100%
rename from samples/server/petstore/spring-mvc-default-value/.openapi-generator-ignore
rename to samples/openapi3/server/petstore/springboot-source/.openapi-generator-ignore
diff --git a/samples/openapi3/server/petstore/springboot-source/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-source/.openapi-generator/FILES
new file mode 100644
index 000000000000..3a114308838f
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-source/.openapi-generator/FILES
@@ -0,0 +1,22 @@
+README.md
+pom.xml
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
+src/main/java/org/openapitools/RFC3339DateFormat.java
+src/main/java/org/openapitools/api/ApiUtil.java
+src/main/java/org/openapitools/api/PetApi.java
+src/main/java/org/openapitools/api/PetApiController.java
+src/main/java/org/openapitools/api/StoreApi.java
+src/main/java/org/openapitools/api/StoreApiController.java
+src/main/java/org/openapitools/api/UserApi.java
+src/main/java/org/openapitools/api/UserApiController.java
+src/main/java/org/openapitools/configuration/HomeController.java
+src/main/java/org/openapitools/model/Category.java
+src/main/java/org/openapitools/model/ModelApiResponse.java
+src/main/java/org/openapitools/model/Order.java
+src/main/java/org/openapitools/model/Pet.java
+src/main/java/org/openapitools/model/Tag.java
+src/main/java/org/openapitools/model/User.java
+src/main/resources/application.properties
+src/main/resources/openapi.yaml
+src/main/resources/static/swagger-ui.html
+src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION b/samples/openapi3/server/petstore/springboot-source/.openapi-generator/VERSION
similarity index 100%
rename from samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION
rename to samples/openapi3/server/petstore/springboot-source/.openapi-generator/VERSION
diff --git a/samples/server/petstore/spring-mvc-default-value/README.md b/samples/openapi3/server/petstore/springboot-source/README.md
similarity index 73%
rename from samples/server/petstore/spring-mvc-default-value/README.md
rename to samples/openapi3/server/petstore/springboot-source/README.md
index 1ff91b81b2ec..2649bbca9eb0 100644
--- a/samples/server/petstore/spring-mvc-default-value/README.md
+++ b/samples/openapi3/server/petstore/springboot-source/README.md
@@ -2,17 +2,18 @@
Spring Boot Server
-
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
-The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox)
+
+The OpenAPI specification used to generate this project is available to download using the following url:
+http://localhost:8080/openapi.json
Start your server as a simple java application
You can view the api documentation in swagger-ui by pointing to
-http://localhost:8080/
+http://localhost:8080/swagger-ui.html
Change default port value in application.properties
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc-default-value/pom.xml b/samples/openapi3/server/petstore/springboot-source/pom.xml
similarity index 77%
rename from samples/server/petstore/spring-mvc-default-value/pom.xml
rename to samples/openapi3/server/petstore/springboot-source/pom.xml
index dc8d196bfaf2..62a892cfbaa9 100644
--- a/samples/server/petstore/spring-mvc-default-value/pom.xml
+++ b/samples/openapi3/server/petstore/springboot-source/pom.xml
@@ -1,20 +1,20 @@
4.0.0
- org.openapitools
- spring-mvc-default-value
+ org.openapitools.openapi3
+ springboot
jar
- spring-mvc-default-value
- 1.0.0
+ springboot
+ 1.0.0-SNAPSHOT
1.8
${java.version}
${java.version}
- 2.9.2
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.5.8
+ 2.6.3
src/main/java
@@ -34,11 +34,14 @@
org.springframework.data
spring-data-commons
-
- io.springfox
- springfox-swagger2
- ${springfox.version}
+ org.webjars
+ swagger-ui
+ ${swagger-ui.version}
+
+
+ org.webjars
+ webjars-locator-core
@@ -68,5 +71,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..f62fd6d91797
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
@@ -0,0 +1,23 @@
+package org.openapitools;
+
+import com.fasterxml.jackson.databind.Module;
+import org.openapitools.jackson.nullable.JsonNullableModule;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
+public class OpenApiGeneratorApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
+ }
+
+ @Bean
+ public Module jsonNullableModule() {
+ return new JsonNullableModule();
+ }
+
+}
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/RFC3339DateFormat.java
similarity index 100%
rename from samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/RFC3339DateFormat.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/RFC3339DateFormat.java
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/ApiUtil.java
similarity index 100%
rename from samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/ApiUtil.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/ApiUtil.java
diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java
similarity index 52%
rename from samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java
index 864173ded4fc..c29de936952a 100644
--- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java
@@ -7,8 +7,6 @@
import org.openapitools.model.ModelApiResponse;
import org.openapitools.model.Pet;
-import java.util.Set;
-import io.swagger.annotations.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -26,7 +24,6 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
-@Api(value = "pet", description = "the pet API")
public interface PetApi {
default Optional getRequest() {
@@ -36,34 +33,33 @@ default Optional getRequest() {
/**
* POST /pet : Add a new pet to the store
*
- * @param body Pet object that needs to be added to the store (required)
+ * @param pet Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid input (status code 405)
*/
- @ApiOperation(
- tags = { "pet" },
- value = "Add a new pet to the store",
- nickname = "addPet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = "/pet",
+ produces = { "application/xml", "application/json" },
consumes = { "application/json", "application/xml" }
)
- default ResponseEntity addPet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
+ default ResponseEntity addPet(
+ @Valid @RequestBody Pet pet
) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 doggie aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@@ -74,32 +70,15 @@ default ResponseEntity addPet(
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
- * @return successful operation (status code 200)
- * or Invalid pet value (status code 400)
+ * @return Invalid pet value (status code 400)
*/
- @ApiOperation(
- tags = { "pet" },
- value = "Deletes a pet",
- nickname = "deletePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid pet value")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = "/pet/{petId}"
)
default ResponseEntity deletePet(
- @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey
+ @PathVariable("petId") Long petId,
+ @RequestHeader(value = "api_key", required = false) String apiKey
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -114,36 +93,18 @@ default ResponseEntity deletePet(
* @return successful operation (status code 200)
* or Invalid status value (status code 400)
*/
- @ApiOperation(
- tags = { "pet" },
- value = "Finds Pets by status",
- nickname = "findPetsByStatus",
- notes = "Multiple status values can be provided with comma separated strings",
- response = Pet.class,
- responseContainer = "List",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid status value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/findByStatus",
produces = { "application/xml", "application/json" }
)
default ResponseEntity> findPetsByStatus(
- @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status
+ @NotNull @Valid @RequestParam(value = "status", required = true) List status
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
+ String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
@@ -168,36 +129,18 @@ default ResponseEntity> findPetsByStatus(
* or Invalid tag value (status code 400)
* @deprecated
*/
- @ApiOperation(
- tags = { "pet" },
- value = "Finds Pets by tags",
- nickname = "findPetsByTags",
- notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
- response = Pet.class,
- responseContainer = "Set",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"),
- @ApiResponse(code = 400, message = "Invalid tag value")
- })
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/findByTags",
produces = { "application/xml", "application/json" }
)
- default ResponseEntity> findPetsByTags(
- @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags
+ default ResponseEntity> findPetsByTags(
+ @NotNull @Valid @RequestParam(value = "tags", required = true) List tags
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
+ String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
@@ -222,33 +165,18 @@ default ResponseEntity> findPetsByTags(
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
*/
- @ApiOperation(
- tags = { "pet" },
- value = "Find pet by ID",
- nickname = "getPetById",
- notes = "Returns a single pet",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "api_key")
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = "/pet/{petId}",
produces = { "application/xml", "application/json" }
)
default ResponseEntity getPetById(
- @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
+ @PathVariable("petId") Long petId
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
+ String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
ApiUtil.setExampleResponse(request, "application/json", exampleString);
break;
}
@@ -267,38 +195,35 @@ default ResponseEntity getPetById(
/**
* PUT /pet : Update an existing pet
*
- * @param body Pet object that needs to be added to the store (required)
+ * @param pet Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
* or Validation exception (status code 405)
*/
- @ApiOperation(
- tags = { "pet" },
- value = "Update an existing pet",
- nickname = "updatePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found"),
- @ApiResponse(code = 405, message = "Validation exception")
- })
@RequestMapping(
method = RequestMethod.PUT,
value = "/pet",
+ produces = { "application/xml", "application/json" },
consumes = { "application/json", "application/xml" }
)
- default ResponseEntity updatePet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
+ default ResponseEntity updatePet(
+ @Valid @RequestBody Pet pet
) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
+ ApiUtil.setExampleResponse(request, "application/json", exampleString);
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ String exampleString = " 123456789 doggie aeiou aeiou ";
+ ApiUtil.setExampleResponse(request, "application/xml", exampleString);
+ break;
+ }
+ }
+ });
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
@@ -312,30 +237,15 @@ default ResponseEntity updatePet(
* @param status Updated status of the pet (optional)
* @return Invalid input (status code 405)
*/
- @ApiOperation(
- tags = { "pet" },
- value = "Updates a pet in the store with form data",
- nickname = "updatePetWithForm",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 405, message = "Invalid input")
- })
@RequestMapping(
method = RequestMethod.POST,
value = "/pet/{petId}",
consumes = { "application/x-www-form-urlencoded" }
)
default ResponseEntity updatePetWithForm(
- @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,
- @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status
+ @PathVariable("petId") Long petId,
+ @Valid @RequestPart(value = "name", required = false) String name,
+ @Valid @RequestPart(value = "status", required = false) String status
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -350,22 +260,6 @@ default ResponseEntity updatePetWithForm(
* @param file file to upload (optional)
* @return successful operation (status code 200)
*/
- @ApiOperation(
- tags = { "pet" },
- value = "uploads an image",
- nickname = "uploadFile",
- notes = "",
- response = ModelApiResponse.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
- })
@RequestMapping(
method = RequestMethod.POST,
value = "/pet/{petId}/uploadImage",
@@ -373,9 +267,9 @@ default ResponseEntity updatePetWithForm(
consumes = { "multipart/form-data" }
)
default ResponseEntity uploadFile(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,
- @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
+ @PathVariable("petId") Long petId,
+ @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,
+ @RequestPart(value = "file", required = false) MultipartFile file
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java
similarity index 92%
rename from samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java
index 57cbf21bde71..4ad9ef06158b 100644
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApiController.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApiController.java
@@ -9,7 +9,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Controller
-@RequestMapping("${openapi.openAPIPetstore.base-path:/}")
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
public class PetApiController implements PetApi {
private final NativeWebRequest request;
diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java
similarity index 66%
rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java
index 1292cf4edaa2..577b14c1ad5d 100644
--- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java
@@ -7,7 +7,6 @@
import java.util.Map;
import org.openapitools.model.Order;
-import io.swagger.annotations.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -25,7 +24,6 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
-@Api(value = "store", description = "the store API")
public interface StoreApi {
default Optional getRequest() {
@@ -33,29 +31,19 @@ default Optional getRequest() {
}
/**
- * DELETE /store/order/{order_id} : Delete purchase order by ID
+ * DELETE /store/order/{orderId} : Delete purchase order by ID
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
*
* @param orderId ID of the order that needs to be deleted (required)
* @return Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
- tags = { "store" },
- value = "Delete purchase order by ID",
- nickname = "deleteOrder",
- notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
- value = "/store/order/{order_id}"
+ value = "/store/order/{orderId}"
)
default ResponseEntity deleteOrder(
- @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId
+ @PathVariable("orderId") String orderId
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -68,20 +56,6 @@ default ResponseEntity deleteOrder(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
- tags = { "store" },
- value = "Returns pet inventories by status",
- nickname = "getInventory",
- notes = "Returns a map of status codes to quantities",
- response = Integer.class,
- responseContainer = "Map",
- authorizations = {
- @Authorization(value = "api_key")
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
- })
@RequestMapping(
method = RequestMethod.GET,
value = "/store/inventory",
@@ -96,7 +70,7 @@ default ResponseEntity> getInventory(
/**
- * GET /store/order/{order_id} : Find purchase order by ID
+ * GET /store/order/{orderId} : Find purchase order by ID
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
*
* @param orderId ID of pet that needs to be fetched (required)
@@ -104,25 +78,13 @@ default ResponseEntity> getInventory(
* or Invalid ID supplied (status code 400)
* or Order not found (status code 404)
*/
- @ApiOperation(
- tags = { "store" },
- value = "Find purchase order by ID",
- nickname = "getOrderById",
- notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
- response = Order.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
@RequestMapping(
method = RequestMethod.GET,
- value = "/store/order/{order_id}",
+ value = "/store/order/{orderId}",
produces = { "application/xml", "application/json" }
)
default ResponseEntity getOrderById(
- @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId
+ @Min(1L) @Max(5L) @PathVariable("orderId") Long orderId
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -146,28 +108,18 @@ default ResponseEntity getOrderById(
/**
* POST /store/order : Place an order for a pet
*
- * @param body order placed for purchasing the pet (required)
+ * @param order order placed for purchasing the pet (required)
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
- @ApiOperation(
- tags = { "store" },
- value = "Place an order for a pet",
- nickname = "placeOrder",
- notes = "",
- response = Order.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid Order")
- })
@RequestMapping(
method = RequestMethod.POST,
value = "/store/order",
- produces = { "application/xml", "application/json" }
+ produces = { "application/xml", "application/json" },
+ consumes = { "application/json" }
)
default ResponseEntity placeOrder(
- @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
+ @Valid @RequestBody Order order
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java
similarity index 92%
rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java
index a1f02f844bf3..293d3035f805 100644
--- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApiController.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApiController.java
@@ -9,7 +9,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Controller
-@RequestMapping("${openapi.openAPIPetstore.base-path:/}")
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
public class StoreApiController implements StoreApi {
private final NativeWebRequest request;
diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java
similarity index 58%
rename from samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java
index 8b7791294a9b..d8c777c16eb2 100644
--- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java
@@ -8,7 +8,6 @@
import java.util.List;
import java.time.OffsetDateTime;
import org.openapitools.model.User;
-import io.swagger.annotations.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
@@ -26,7 +25,6 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
-@Api(value = "user", description = "the user API")
public interface UserApi {
default Optional getRequest() {
@@ -37,24 +35,16 @@ default Optional getRequest() {
* POST /user : Create user
* This can only be done by the logged in user.
*
- * @param body Created user object (required)
+ * @param user Created user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
- tags = { "user" },
- value = "Create user",
- nickname = "createUser",
- notes = "This can only be done by the logged in user."
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
- value = "/user"
+ value = "/user",
+ consumes = { "application/json" }
)
default ResponseEntity createUser(
- @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body
+ @Valid @RequestBody User user
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -64,24 +54,16 @@ default ResponseEntity createUser(
/**
* POST /user/createWithArray : Creates list of users with given input array
*
- * @param body List of user object (required)
+ * @param user List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
- tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithArrayInput",
- notes = ""
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
- value = "/user/createWithArray"
+ value = "/user/createWithArray",
+ consumes = { "application/json" }
)
default ResponseEntity createUsersWithArrayInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body
+ @Valid @RequestBody List user
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -91,24 +73,16 @@ default ResponseEntity createUsersWithArrayInput(
/**
* POST /user/createWithList : Creates list of users with given input array
*
- * @param body List of user object (required)
+ * @param user List of user object (required)
* @return successful operation (status code 200)
*/
- @ApiOperation(
- tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithListInput",
- notes = ""
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.POST,
- value = "/user/createWithList"
+ value = "/user/createWithList",
+ consumes = { "application/json" }
)
default ResponseEntity createUsersWithListInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body
+ @Valid @RequestBody List user
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -123,22 +97,12 @@ default ResponseEntity createUsersWithListInput(
* @return Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
- tags = { "user" },
- value = "Delete user",
- nickname = "deleteUser",
- notes = "This can only be done by the logged in user."
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.DELETE,
value = "/user/{username}"
)
default ResponseEntity deleteUser(
- @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
+ @PathVariable("username") String username
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -153,25 +117,13 @@ default ResponseEntity deleteUser(
* or Invalid username supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
- tags = { "user" },
- value = "Get user by user name",
- nickname = "getUserByName",
- notes = "",
- response = User.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = User.class),
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.GET,
value = "/user/{username}",
produces = { "application/xml", "application/json" }
)
default ResponseEntity getUserByName(
- @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
+ @PathVariable("username") String username
) {
getRequest().ifPresent(request -> {
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
@@ -200,25 +152,14 @@ default ResponseEntity getUserByName(
* @return successful operation (status code 200)
* or Invalid username/password supplied (status code 400)
*/
- @ApiOperation(
- tags = { "user" },
- value = "Logs user into the system",
- nickname = "loginUser",
- notes = "",
- response = String.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = String.class),
- @ApiResponse(code = 400, message = "Invalid username/password supplied")
- })
@RequestMapping(
method = RequestMethod.GET,
value = "/user/login",
produces = { "application/xml", "application/json" }
)
default ResponseEntity loginUser(
- @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
- @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
+ @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username,
+ @NotNull @Valid @RequestParam(value = "password", required = true) String password
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
@@ -230,15 +171,6 @@ default ResponseEntity loginUser(
*
* @return successful operation (status code 200)
*/
- @ApiOperation(
- tags = { "user" },
- value = "Logs out current logged in user session",
- nickname = "logoutUser",
- notes = ""
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
@RequestMapping(
method = RequestMethod.GET,
value = "/user/logout"
@@ -256,27 +188,18 @@ default ResponseEntity logoutUser(
* This can only be done by the logged in user.
*
* @param username name that need to be deleted (required)
- * @param body Updated user object (required)
+ * @param user Updated user object (required)
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
- @ApiOperation(
- tags = { "user" },
- value = "Updated user",
- nickname = "updateUser",
- notes = "This can only be done by the logged in user."
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid user supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
@RequestMapping(
method = RequestMethod.PUT,
- value = "/user/{username}"
+ value = "/user/{username}",
+ consumes = { "application/json" }
)
default ResponseEntity updateUser(
- @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
- @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body
+ @PathVariable("username") String username,
+ @Valid @RequestBody User user
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java
similarity index 92%
rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java
index 8efc6418c2e8..aab4767a50d0 100644
--- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApiController.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApiController.java
@@ -9,7 +9,7 @@
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Controller
-@RequestMapping("${openapi.openAPIPetstore.base-path:/}")
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
public class UserApiController implements UserApi {
private final NativeWebRequest request;
diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/configuration/HomeController.java
new file mode 100644
index 000000000000..f773286ac450
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/configuration/HomeController.java
@@ -0,0 +1,61 @@
+package org.openapitools.configuration;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.core.io.Resource;
+import org.springframework.util.StreamUtils;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.GetMapping;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+
+/**
+ * Home redirection to OpenAPI api documentation
+ */
+@Controller
+public class HomeController {
+
+ private static YAMLMapper yamlMapper = new YAMLMapper();
+
+ @Value("classpath:/openapi.yaml")
+ private Resource openapi;
+
+ @Bean
+ public String openapiContent() throws IOException {
+ try(InputStream is = openapi.getInputStream()) {
+ return StreamUtils.copyToString(is, Charset.defaultCharset());
+ }
+ }
+
+ @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi")
+ @ResponseBody
+ public String openapiYaml() throws IOException {
+ return openapiContent();
+ }
+
+ @GetMapping(value = "/openapi.json", produces = "application/json")
+ @ResponseBody
+ public Object openapiJson() throws IOException {
+ return yamlMapper.readValue(openapiContent(), Object.class);
+ }
+
+ static final String API_DOCS_PATH = "/openapi.json";
+
+ @GetMapping(value = "/swagger-config.yaml", produces = "text/plain")
+ @ResponseBody
+ public String swaggerConfig() {
+ return "url: " + API_DOCS_PATH + "\n";
+ }
+
+ @RequestMapping("/")
+ public String index() {
+ return "redirect:swagger-ui.html";
+ }
+
+}
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java
similarity index 89%
rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java
index 8adf35c2fa00..6218e1d3e171 100644
--- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Category.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Category.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
@@ -16,7 +14,7 @@
import javax.annotation.Generated;
/**
- * Category
+ * A category for a pet
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@@ -26,7 +24,7 @@ public class Category {
private Long id;
@JsonProperty("name")
- private String name = "default-name";
+ private String name;
public Category id(Long id) {
this.id = id;
@@ -38,7 +36,6 @@ public Category id(Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
public Long getId() {
return id;
}
@@ -56,8 +53,7 @@ public Category name(String name) {
* Get name
* @return name
*/
- @NotNull
- @ApiModelProperty(required = true, value = "")
+ @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")
public String getName() {
return name;
}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java
similarity index 93%
rename from samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java
index 131e671e9160..279de49b2ce0 100644
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelApiResponse.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/ModelApiResponse.java
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
@@ -17,7 +15,7 @@
import javax.annotation.Generated;
/**
- * ModelApiResponse
+ * Describes the result of uploading an image resource
*/
@JsonTypeName("ApiResponse")
@@ -43,7 +41,6 @@ public ModelApiResponse code(Integer code) {
* @return code
*/
- @ApiModelProperty(value = "")
public Integer getCode() {
return code;
}
@@ -62,7 +59,6 @@ public ModelApiResponse type(String type) {
* @return type
*/
- @ApiModelProperty(value = "")
public String getType() {
return type;
}
@@ -81,7 +77,6 @@ public ModelApiResponse message(String message) {
* @return message
*/
- @ApiModelProperty(value = "")
public String getMessage() {
return message;
}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java
similarity index 94%
rename from samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java
index 6bd55e5a1548..13ec59e549c9 100644
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Order.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Order.java
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.time.OffsetDateTime;
import org.springframework.format.annotation.DateTimeFormat;
import org.openapitools.jackson.nullable.JsonNullable;
@@ -19,7 +17,7 @@
import javax.annotation.Generated;
/**
- * Order
+ * An order for a pets from the pet store
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@@ -91,7 +89,6 @@ public Order id(Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
public Long getId() {
return id;
}
@@ -110,7 +107,6 @@ public Order petId(Long petId) {
* @return petId
*/
- @ApiModelProperty(value = "")
public Long getPetId() {
return petId;
}
@@ -129,7 +125,6 @@ public Order quantity(Integer quantity) {
* @return quantity
*/
- @ApiModelProperty(value = "")
public Integer getQuantity() {
return quantity;
}
@@ -148,7 +143,6 @@ public Order shipDate(OffsetDateTime shipDate) {
* @return shipDate
*/
@Valid
- @ApiModelProperty(value = "")
public OffsetDateTime getShipDate() {
return shipDate;
}
@@ -167,7 +161,6 @@ public Order status(StatusEnum status) {
* @return status
*/
- @ApiModelProperty(value = "Order Status")
public StatusEnum getStatus() {
return status;
}
@@ -186,7 +179,6 @@ public Order complete(Boolean complete) {
* @return complete
*/
- @ApiModelProperty(value = "")
public Boolean getComplete() {
return complete;
}
diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java
similarity index 93%
rename from samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java
index d330c28e6791..05a9ea718d7a 100644
--- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/Pet.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java
@@ -5,8 +5,6 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.model.Category;
@@ -21,7 +19,7 @@
import javax.annotation.Generated;
/**
- * Pet
+ * A pet for sale in the pet store
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@@ -94,7 +92,6 @@ public Pet id(Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
public Long getId() {
return id;
}
@@ -113,7 +110,6 @@ public Pet category(Category category) {
* @return category
*/
@Valid
- @ApiModelProperty(value = "")
public Category getCategory() {
return category;
}
@@ -132,7 +128,6 @@ public Pet name(String name) {
* @return name
*/
@NotNull
- @ApiModelProperty(example = "doggie", required = true, value = "")
public String getName() {
return name;
}
@@ -156,7 +151,6 @@ public Pet addPhotoUrlsItem(String photoUrlsItem) {
* @return photoUrls
*/
@NotNull
- @ApiModelProperty(required = true, value = "")
public List getPhotoUrls() {
return photoUrls;
}
@@ -183,7 +177,6 @@ public Pet addTagsItem(Tag tagsItem) {
* @return tags
*/
@Valid
- @ApiModelProperty(value = "")
public List getTags() {
return tags;
}
@@ -202,7 +195,6 @@ public Pet status(StatusEnum status) {
* @return status
*/
- @ApiModelProperty(value = "pet status in the store")
public StatusEnum getStatus() {
return status;
}
diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java
similarity index 92%
rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java
index 03b4ffcdadca..e3ba0c6d29a8 100644
--- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/Tag.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Tag.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
@@ -16,7 +14,7 @@
import javax.annotation.Generated;
/**
- * Tag
+ * A tag for a pet
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@@ -38,7 +36,6 @@ public Tag id(Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
public Long getId() {
return id;
}
@@ -57,7 +54,6 @@ public Tag name(String name) {
* @return name
*/
- @ApiModelProperty(value = "")
public String getName() {
return name;
}
diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java
similarity index 93%
rename from samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java
rename to samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java
index cff62427bf1a..8a27d52814ab 100644
--- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/User.java
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/User.java
@@ -4,8 +4,6 @@
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
@@ -16,7 +14,7 @@
import javax.annotation.Generated;
/**
- * User
+ * A User who is purchasing from the pet store
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@@ -56,7 +54,6 @@ public User id(Long id) {
* @return id
*/
- @ApiModelProperty(value = "")
public Long getId() {
return id;
}
@@ -75,7 +72,6 @@ public User username(String username) {
* @return username
*/
- @ApiModelProperty(value = "")
public String getUsername() {
return username;
}
@@ -94,7 +90,6 @@ public User firstName(String firstName) {
* @return firstName
*/
- @ApiModelProperty(value = "")
public String getFirstName() {
return firstName;
}
@@ -113,7 +108,6 @@ public User lastName(String lastName) {
* @return lastName
*/
- @ApiModelProperty(value = "")
public String getLastName() {
return lastName;
}
@@ -132,7 +126,6 @@ public User email(String email) {
* @return email
*/
- @ApiModelProperty(value = "")
public String getEmail() {
return email;
}
@@ -151,7 +144,6 @@ public User password(String password) {
* @return password
*/
- @ApiModelProperty(value = "")
public String getPassword() {
return password;
}
@@ -170,7 +162,6 @@ public User phone(String phone) {
* @return phone
*/
- @ApiModelProperty(value = "")
public String getPhone() {
return phone;
}
@@ -189,7 +180,6 @@ public User userStatus(Integer userStatus) {
* @return userStatus
*/
- @ApiModelProperty(value = "User Status")
public Integer getUserStatus() {
return userStatus;
}
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/resources/application.properties b/samples/openapi3/server/petstore/springboot-source/src/main/resources/application.properties
similarity index 73%
rename from samples/server/petstore/spring-mvc-default-value/src/main/resources/application.properties
rename to samples/openapi3/server/petstore/springboot-source/src/main/resources/application.properties
index b80025e1aa33..7e90813e59b2 100644
--- a/samples/server/petstore/spring-mvc-default-value/src/main/resources/application.properties
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/resources/application.properties
@@ -1,4 +1,3 @@
-springfox.documentation.swagger.v2.path=/api-docs
server.port=8080
spring.jackson.date-format=org.openapitools.RFC3339DateFormat
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml
new file mode 100644
index 000000000000..5fc39a2ce2a4
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/resources/openapi.yaml
@@ -0,0 +1,893 @@
+openapi: 3.0.0
+info:
+ description: "This is a sample server Petstore server. For this sample, you can\
+ \ use the api key `special-key` to test the authorization filters."
+ license:
+ name: Apache-2.0
+ url: https://www.apache.org/licenses/LICENSE-2.0.html
+ title: OpenAPI Petstore
+ version: 1.0.0
+externalDocs:
+ description: Find out more about Swagger
+ url: http://swagger.io
+servers:
+- url: http://petstore.swagger.io/v2
+tags:
+- description: Everything about your Pets
+ name: pet
+- description: Access to Petstore orders
+ name: store
+- description: Operations about user
+ name: user
+paths:
+ /pet:
+ post:
+ operationId: addPet
+ requestBody:
+ $ref: '#/components/requestBodies/Pet'
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ description: successful operation
+ "405":
+ description: Invalid input
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Add a new pet to the store
+ tags:
+ - pet
+ x-contentType: application/json
+ x-accepts: application/json
+ x-tags:
+ - tag: pet
+ put:
+ operationId: updatePet
+ requestBody:
+ $ref: '#/components/requestBodies/Pet'
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ description: successful operation
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Pet not found
+ "405":
+ description: Validation exception
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Update an existing pet
+ tags:
+ - pet
+ x-contentType: application/json
+ x-accepts: application/json
+ x-tags:
+ - tag: pet
+ /pet/findByStatus:
+ get:
+ description: Multiple status values can be provided with comma separated strings
+ operationId: findPetsByStatus
+ parameters:
+ - deprecated: true
+ description: Status values that need to be considered for filter
+ explode: false
+ in: query
+ name: status
+ required: true
+ schema:
+ items:
+ default: available
+ enum:
+ - available
+ - pending
+ - sold
+ type: string
+ type: array
+ style: form
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ application/json:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ description: successful operation
+ "400":
+ description: Invalid status value
+ security:
+ - petstore_auth:
+ - read:pets
+ summary: Finds Pets by status
+ tags:
+ - pet
+ x-accepts: application/json
+ x-tags:
+ - tag: pet
+ /pet/findByTags:
+ get:
+ deprecated: true
+ description: "Multiple tags can be provided with comma separated strings. Use\
+ \ tag1, tag2, tag3 for testing."
+ operationId: findPetsByTags
+ parameters:
+ - description: Tags to filter by
+ explode: false
+ in: query
+ name: tags
+ required: true
+ schema:
+ items:
+ type: string
+ type: array
+ style: form
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ application/json:
+ schema:
+ items:
+ $ref: '#/components/schemas/Pet'
+ type: array
+ description: successful operation
+ "400":
+ description: Invalid tag value
+ security:
+ - petstore_auth:
+ - read:pets
+ summary: Finds Pets by tags
+ tags:
+ - pet
+ x-accepts: application/json
+ x-tags:
+ - tag: pet
+ /pet/{petId}:
+ delete:
+ operationId: deletePet
+ parameters:
+ - explode: false
+ in: header
+ name: api_key
+ required: false
+ schema:
+ type: string
+ style: simple
+ - description: Pet id to delete
+ explode: false
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: simple
+ responses:
+ "400":
+ description: Invalid pet value
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Deletes a pet
+ tags:
+ - pet
+ x-accepts: application/json
+ x-tags:
+ - tag: pet
+ get:
+ description: Returns a single pet
+ operationId: getPetById
+ parameters:
+ - description: ID of pet to return
+ explode: false
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: simple
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ description: successful operation
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Pet not found
+ security:
+ - api_key: []
+ summary: Find pet by ID
+ tags:
+ - pet
+ x-accepts: application/json
+ x-tags:
+ - tag: pet
+ post:
+ operationId: updatePetWithForm
+ parameters:
+ - description: ID of pet that needs to be updated
+ explode: false
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: simple
+ requestBody:
+ $ref: '#/components/requestBodies/inline_object'
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ type: object
+ responses:
+ "405":
+ description: Invalid input
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: Updates a pet in the store with form data
+ tags:
+ - pet
+ x-contentType: application/x-www-form-urlencoded
+ x-accepts: application/json
+ x-tags:
+ - tag: pet
+ /pet/{petId}/uploadImage:
+ post:
+ operationId: uploadFile
+ parameters:
+ - description: ID of pet to update
+ explode: false
+ in: path
+ name: petId
+ required: true
+ schema:
+ format: int64
+ type: integer
+ style: simple
+ requestBody:
+ $ref: '#/components/requestBodies/inline_object_1'
+ content:
+ multipart/form-data:
+ schema:
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ file:
+ description: file to upload
+ format: binary
+ type: string
+ type: object
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ApiResponse'
+ description: successful operation
+ security:
+ - petstore_auth:
+ - write:pets
+ - read:pets
+ summary: uploads an image
+ tags:
+ - pet
+ x-contentType: multipart/form-data
+ x-accepts: application/json
+ x-tags:
+ - tag: pet
+ /store/inventory:
+ get:
+ description: Returns a map of status codes to quantities
+ operationId: getInventory
+ responses:
+ "200":
+ content:
+ application/json:
+ schema:
+ additionalProperties:
+ format: int32
+ type: integer
+ type: object
+ description: successful operation
+ security:
+ - api_key: []
+ summary: Returns pet inventories by status
+ tags:
+ - store
+ x-accepts: application/json
+ x-tags:
+ - tag: store
+ /store/order:
+ post:
+ operationId: placeOrder
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: order placed for purchasing the pet
+ required: true
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Order'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: successful operation
+ "400":
+ description: Invalid Order
+ summary: Place an order for a pet
+ tags:
+ - store
+ x-contentType: application/json
+ x-accepts: application/json
+ x-tags:
+ - tag: store
+ /store/order/{orderId}:
+ delete:
+ description: For valid response try integer IDs with value < 1000. Anything
+ above 1000 or nonintegers will generate API errors
+ operationId: deleteOrder
+ parameters:
+ - description: ID of the order that needs to be deleted
+ explode: false
+ in: path
+ name: orderId
+ required: true
+ schema:
+ type: string
+ style: simple
+ responses:
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Order not found
+ summary: Delete purchase order by ID
+ tags:
+ - store
+ x-accepts: application/json
+ x-tags:
+ - tag: store
+ get:
+ description: For valid response try integer IDs with value <= 5 or > 10. Other
+ values will generated exceptions
+ operationId: getOrderById
+ parameters:
+ - description: ID of pet that needs to be fetched
+ explode: false
+ in: path
+ name: orderId
+ required: true
+ schema:
+ format: int64
+ maximum: 5
+ minimum: 1
+ type: integer
+ style: simple
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Order'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Order'
+ description: successful operation
+ "400":
+ description: Invalid ID supplied
+ "404":
+ description: Order not found
+ summary: Find purchase order by ID
+ tags:
+ - store
+ x-accepts: application/json
+ x-tags:
+ - tag: store
+ /user:
+ post:
+ description: This can only be done by the logged in user.
+ operationId: createUser
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ description: Created user object
+ required: true
+ responses:
+ default:
+ description: successful operation
+ security:
+ - api_key: []
+ summary: Create user
+ tags:
+ - user
+ x-contentType: application/json
+ x-accepts: application/json
+ x-tags:
+ - tag: user
+ /user/createWithArray:
+ post:
+ operationId: createUsersWithArrayInput
+ requestBody:
+ $ref: '#/components/requestBodies/UserArray'
+ responses:
+ default:
+ description: successful operation
+ security:
+ - api_key: []
+ summary: Creates list of users with given input array
+ tags:
+ - user
+ x-contentType: application/json
+ x-accepts: application/json
+ x-tags:
+ - tag: user
+ /user/createWithList:
+ post:
+ operationId: createUsersWithListInput
+ requestBody:
+ $ref: '#/components/requestBodies/UserArray'
+ responses:
+ default:
+ description: successful operation
+ security:
+ - api_key: []
+ summary: Creates list of users with given input array
+ tags:
+ - user
+ x-contentType: application/json
+ x-accepts: application/json
+ x-tags:
+ - tag: user
+ /user/login:
+ get:
+ operationId: loginUser
+ parameters:
+ - description: The user name for login
+ explode: true
+ in: query
+ name: username
+ required: true
+ schema:
+ pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"
+ type: string
+ style: form
+ - description: The password for login in clear text
+ explode: true
+ in: query
+ name: password
+ required: true
+ schema:
+ type: string
+ style: form
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ type: string
+ application/json:
+ schema:
+ type: string
+ description: successful operation
+ headers:
+ Set-Cookie:
+ description: Cookie authentication key for use with the `api_key` apiKey
+ authentication.
+ explode: false
+ schema:
+ example: AUTH_KEY=abcde12345; Path=/; HttpOnly
+ type: string
+ style: simple
+ X-Rate-Limit:
+ description: calls per hour allowed by the user
+ explode: false
+ schema:
+ format: int32
+ type: integer
+ style: simple
+ X-Expires-After:
+ description: date in UTC when token expires
+ explode: false
+ schema:
+ format: date-time
+ type: string
+ style: simple
+ "400":
+ description: Invalid username/password supplied
+ summary: Logs user into the system
+ tags:
+ - user
+ x-accepts: application/json
+ x-tags:
+ - tag: user
+ /user/logout:
+ get:
+ operationId: logoutUser
+ responses:
+ default:
+ description: successful operation
+ security:
+ - api_key: []
+ summary: Logs out current logged in user session
+ tags:
+ - user
+ x-accepts: application/json
+ x-tags:
+ - tag: user
+ /user/{username}:
+ delete:
+ description: This can only be done by the logged in user.
+ operationId: deleteUser
+ parameters:
+ - description: The name that needs to be deleted
+ explode: false
+ in: path
+ name: username
+ required: true
+ schema:
+ type: string
+ style: simple
+ responses:
+ "400":
+ description: Invalid username supplied
+ "404":
+ description: User not found
+ security:
+ - api_key: []
+ summary: Delete user
+ tags:
+ - user
+ x-accepts: application/json
+ x-tags:
+ - tag: user
+ get:
+ operationId: getUserByName
+ parameters:
+ - description: The name that needs to be fetched. Use user1 for testing.
+ explode: false
+ in: path
+ name: username
+ required: true
+ schema:
+ type: string
+ style: simple
+ responses:
+ "200":
+ content:
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/User'
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ description: successful operation
+ "400":
+ description: Invalid username supplied
+ "404":
+ description: User not found
+ summary: Get user by user name
+ tags:
+ - user
+ x-accepts: application/json
+ x-tags:
+ - tag: user
+ put:
+ description: This can only be done by the logged in user.
+ operationId: updateUser
+ parameters:
+ - description: name that need to be deleted
+ explode: false
+ in: path
+ name: username
+ required: true
+ schema:
+ type: string
+ style: simple
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/User'
+ description: Updated user object
+ required: true
+ responses:
+ "400":
+ description: Invalid user supplied
+ "404":
+ description: User not found
+ security:
+ - api_key: []
+ summary: Updated user
+ tags:
+ - user
+ x-contentType: application/json
+ x-accepts: application/json
+ x-tags:
+ - tag: user
+components:
+ requestBodies:
+ UserArray:
+ content:
+ application/json:
+ schema:
+ items:
+ $ref: '#/components/schemas/User'
+ type: array
+ description: List of user object
+ required: true
+ Pet:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ application/xml:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ description: Pet object that needs to be added to the store
+ required: true
+ inline_object:
+ content:
+ application/x-www-form-urlencoded:
+ schema:
+ $ref: '#/components/schemas/inline_object'
+ inline_object_1:
+ content:
+ multipart/form-data:
+ schema:
+ $ref: '#/components/schemas/inline_object_1'
+ schemas:
+ Order:
+ description: An order for a pets from the pet store
+ example:
+ petId: 6
+ quantity: 1
+ id: 0
+ shipDate: 2000-01-23T04:56:07.000+00:00
+ complete: false
+ status: placed
+ properties:
+ id:
+ format: int64
+ type: integer
+ petId:
+ format: int64
+ type: integer
+ quantity:
+ format: int32
+ type: integer
+ shipDate:
+ format: date-time
+ type: string
+ status:
+ description: Order Status
+ enum:
+ - placed
+ - approved
+ - delivered
+ type: string
+ complete:
+ default: false
+ type: boolean
+ title: Pet Order
+ type: object
+ xml:
+ name: Order
+ Category:
+ description: A category for a pet
+ example:
+ name: name
+ id: 6
+ properties:
+ id:
+ format: int64
+ type: integer
+ name:
+ pattern: "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$"
+ type: string
+ title: Pet category
+ type: object
+ xml:
+ name: Category
+ User:
+ description: A User who is purchasing from the pet store
+ example:
+ firstName: firstName
+ lastName: lastName
+ password: password
+ userStatus: 6
+ phone: phone
+ id: 0
+ email: email
+ username: username
+ properties:
+ id:
+ format: int64
+ type: integer
+ username:
+ type: string
+ firstName:
+ type: string
+ lastName:
+ type: string
+ email:
+ type: string
+ password:
+ type: string
+ phone:
+ type: string
+ userStatus:
+ description: User Status
+ format: int32
+ type: integer
+ title: a User
+ type: object
+ xml:
+ name: User
+ Tag:
+ description: A tag for a pet
+ example:
+ name: name
+ id: 1
+ properties:
+ id:
+ format: int64
+ type: integer
+ name:
+ type: string
+ title: Pet Tag
+ type: object
+ xml:
+ name: Tag
+ Pet:
+ description: A pet for sale in the pet store
+ example:
+ photoUrls:
+ - photoUrls
+ - photoUrls
+ name: doggie
+ id: 0
+ category:
+ name: name
+ id: 6
+ tags:
+ - name: name
+ id: 1
+ - name: name
+ id: 1
+ status: available
+ properties:
+ id:
+ format: int64
+ type: integer
+ category:
+ $ref: '#/components/schemas/Category'
+ name:
+ example: doggie
+ type: string
+ photoUrls:
+ items:
+ type: string
+ type: array
+ xml:
+ name: photoUrl
+ wrapped: true
+ tags:
+ items:
+ $ref: '#/components/schemas/Tag'
+ type: array
+ xml:
+ name: tag
+ wrapped: true
+ status:
+ deprecated: true
+ description: pet status in the store
+ enum:
+ - available
+ - pending
+ - sold
+ type: string
+ required:
+ - name
+ - photoUrls
+ title: a Pet
+ type: object
+ xml:
+ name: Pet
+ ApiResponse:
+ description: Describes the result of uploading an image resource
+ example:
+ code: 0
+ type: type
+ message: message
+ properties:
+ code:
+ format: int32
+ type: integer
+ type:
+ type: string
+ message:
+ type: string
+ title: An uploaded response
+ type: object
+ inline_object:
+ properties:
+ name:
+ description: Updated name of the pet
+ type: string
+ status:
+ description: Updated status of the pet
+ type: string
+ type: object
+ inline_object_1:
+ properties:
+ additionalMetadata:
+ description: Additional data to pass to server
+ type: string
+ file:
+ description: file to upload
+ format: binary
+ type: string
+ type: object
+ securitySchemes:
+ petstore_auth:
+ flows:
+ implicit:
+ authorizationUrl: http://petstore.swagger.io/api/oauth/dialog
+ scopes:
+ write:pets: modify pets in your account
+ read:pets: read your pets
+ type: oauth2
+ api_key:
+ in: header
+ name: api_key
+ type: apiKey
diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/resources/static/swagger-ui.html b/samples/openapi3/server/petstore/springboot-source/src/main/resources/static/swagger-ui.html
new file mode 100644
index 000000000000..f85b6654f67d
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-source/src/main/resources/static/swagger-ui.html
@@ -0,0 +1,60 @@
+
+
+
+
+
+ Swagger UI
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/openapi3/server/petstore/springboot-source/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-source/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
new file mode 100644
index 000000000000..3681f67e7705
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-source/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
@@ -0,0 +1,13 @@
+package org.openapitools;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OpenApiGeneratorApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES
index 6d8d3656155a..dcc247ba165c 100644
--- a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES
+++ b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES
@@ -1,6 +1,6 @@
README.md
pom.xml
-src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
src/main/java/org/openapitools/RFC3339DateFormat.java
src/main/java/org/openapitools/api/AnotherFakeApi.java
src/main/java/org/openapitools/api/AnotherFakeApiController.java
@@ -66,3 +66,4 @@ src/main/java/org/openapitools/model/User.java
src/main/java/org/openapitools/model/XmlItem.java
src/main/resources/application.properties
src/main/resources/openapi.yaml
+src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/openapi3/server/petstore/springboot-useoptional/README.md b/samples/openapi3/server/petstore/springboot-useoptional/README.md
index befc961488ae..e6de7e038cea 100644
--- a/samples/openapi3/server/petstore/springboot-useoptional/README.md
+++ b/samples/openapi3/server/petstore/springboot-useoptional/README.md
@@ -2,15 +2,20 @@
Spring Boot Server
-
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
+
+The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:80/v3/api-docs/
+
Start your server as a simple java application
You can view the api documentation in swagger-ui by pointing to
-http://localhost:80/
+http://localhost:80/swagger-ui.html
Change default port value in application.properties
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml b/samples/openapi3/server/petstore/springboot-useoptional/pom.xml
index 975547fc709c..d01f0f5e07f2 100644
--- a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml
+++ b/samples/openapi3/server/petstore/springboot-useoptional/pom.xml
@@ -10,11 +10,12 @@
${java.version}
${java.version}
1.6.4
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -68,5 +69,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index cb088f451935..000000000000
--- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.Module;
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebMvcConfigurer webConfigurer() {
- return new WebMvcConfigurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
- };
- }
-
- @Bean
- public Module jsonNullableModule() {
- return new JsonNullableModule();
- }
-
-}
diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..f62fd6d91797
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
@@ -0,0 +1,23 @@
+package org.openapitools;
+
+import com.fasterxml.jackson.databind.Module;
+import org.openapitools.jackson.nullable.JsonNullableModule;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
+public class OpenApiGeneratorApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
+ }
+
+ @Bean
+ public Module jsonNullableModule() {
+ return new JsonNullableModule();
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java
index 61d4ebb31830..9aa29284ab5f 100644
--- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java
+++ b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java
@@ -1,18 +1,10 @@
package org.openapitools.configuration;
import org.springframework.context.annotation.Bean;
-import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
-import org.springframework.util.StreamUtils;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
+import org.springframework.web.bind.annotation.GetMapping;
/**
* Home redirection to OpenAPI api documentation
@@ -20,34 +12,9 @@
@Controller
public class HomeController {
- private static YAMLMapper yamlMapper = new YAMLMapper();
-
- @Value("classpath:/openapi.yaml")
- private Resource openapi;
-
- @Bean
- public String openapiContent() throws IOException {
- try(InputStream is = openapi.getInputStream()) {
- return StreamUtils.copyToString(is, Charset.defaultCharset());
- }
- }
-
- @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi")
- @ResponseBody
- public String openapiYaml() throws IOException {
- return openapiContent();
- }
-
- @GetMapping(value = "/openapi.json", produces = "application/json")
- @ResponseBody
- public Object openapiJson() throws IOException {
- return yamlMapper.readValue(openapiContent(), Object.class);
- }
-
@RequestMapping("/")
public String index() {
- return "redirect:swagger-ui/index.html?url=../openapi.json";
+ return "redirect:swagger-ui.html";
}
-
-}
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
new file mode 100644
index 000000000000..3681f67e7705
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
@@ -0,0 +1,13 @@
+package org.openapitools;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OpenApiGeneratorApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot/.openapi-generator/FILES
index 7de4a0d86c09..baf10ab6b83b 100644
--- a/samples/openapi3/server/petstore/springboot/.openapi-generator/FILES
+++ b/samples/openapi3/server/petstore/springboot/.openapi-generator/FILES
@@ -1,6 +1,6 @@
README.md
pom.xml
-src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
src/main/java/org/openapitools/RFC3339DateFormat.java
src/main/java/org/openapitools/api/ApiUtil.java
src/main/java/org/openapitools/api/PetApi.java
@@ -18,3 +18,4 @@ src/main/java/org/openapitools/model/Tag.java
src/main/java/org/openapitools/model/User.java
src/main/resources/application.properties
src/main/resources/openapi.yaml
+src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
diff --git a/samples/openapi3/server/petstore/springboot/README.md b/samples/openapi3/server/petstore/springboot/README.md
index 5bbe4a495d99..5cd22b6081a2 100644
--- a/samples/openapi3/server/petstore/springboot/README.md
+++ b/samples/openapi3/server/petstore/springboot/README.md
@@ -2,15 +2,20 @@
Spring Boot Server
-
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
+
+The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
+Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
+The specification is available to download using the following url:
+http://localhost:8080/v3/api-docs/
+
Start your server as a simple java application
You can view the api documentation in swagger-ui by pointing to
-http://localhost:8080/
+http://localhost:8080/swagger-ui.html
Change default port value in application.properties
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot/pom.xml b/samples/openapi3/server/petstore/springboot/pom.xml
index 4320644df2cc..0524f400cd1f 100644
--- a/samples/openapi3/server/petstore/springboot/pom.xml
+++ b/samples/openapi3/server/petstore/springboot/pom.xml
@@ -10,11 +10,12 @@
${java.version}
${java.version}
1.6.4
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -68,5 +69,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index cb088f451935..000000000000
--- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.Module;
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebMvcConfigurer webConfigurer() {
- return new WebMvcConfigurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
- };
- }
-
- @Bean
- public Module jsonNullableModule() {
- return new JsonNullableModule();
- }
-
-}
diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..f62fd6d91797
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
@@ -0,0 +1,23 @@
+package org.openapitools;
+
+import com.fasterxml.jackson.databind.Module;
+import org.openapitools.jackson.nullable.JsonNullableModule;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
+public class OpenApiGeneratorApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
+ }
+
+ @Bean
+ public Module jsonNullableModule() {
+ return new JsonNullableModule();
+ }
+
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java
index 61d4ebb31830..9aa29284ab5f 100644
--- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java
+++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/configuration/HomeController.java
@@ -1,18 +1,10 @@
package org.openapitools.configuration;
import org.springframework.context.annotation.Bean;
-import com.fasterxml.jackson.dataformat.yaml.YAMLMapper;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.core.io.Resource;
import org.springframework.stereotype.Controller;
-import org.springframework.util.StreamUtils;
-import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.charset.Charset;
+import org.springframework.web.bind.annotation.GetMapping;
/**
* Home redirection to OpenAPI api documentation
@@ -20,34 +12,9 @@
@Controller
public class HomeController {
- private static YAMLMapper yamlMapper = new YAMLMapper();
-
- @Value("classpath:/openapi.yaml")
- private Resource openapi;
-
- @Bean
- public String openapiContent() throws IOException {
- try(InputStream is = openapi.getInputStream()) {
- return StreamUtils.copyToString(is, Charset.defaultCharset());
- }
- }
-
- @GetMapping(value = "/openapi.yaml", produces = "application/vnd.oai.openapi")
- @ResponseBody
- public String openapiYaml() throws IOException {
- return openapiContent();
- }
-
- @GetMapping(value = "/openapi.json", produces = "application/json")
- @ResponseBody
- public Object openapiJson() throws IOException {
- return yamlMapper.readValue(openapiContent(), Object.class);
- }
-
@RequestMapping("/")
public String index() {
- return "redirect:swagger-ui/index.html?url=../openapi.json";
+ return "redirect:swagger-ui.html";
}
-
-}
+}
\ No newline at end of file
diff --git a/samples/openapi3/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
new file mode 100644
index 000000000000..3681f67e7705
--- /dev/null
+++ b/samples/openapi3/server/petstore/springboot/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java
@@ -0,0 +1,13 @@
+package org.openapitools;
+
+import org.junit.jupiter.api.Test;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest
+class OpenApiGeneratorApplicationTests {
+
+ @Test
+ void contextLoads() {
+ }
+
+}
\ No newline at end of file
diff --git a/samples/server/petstore/java-camel/.openapi-generator/FILES b/samples/server/petstore/java-camel/.openapi-generator/FILES
index 4c9d78d30ebe..24eceb6f8ad9 100644
--- a/samples/server/petstore/java-camel/.openapi-generator/FILES
+++ b/samples/server/petstore/java-camel/.openapi-generator/FILES
@@ -1,6 +1,6 @@
README.md
pom.xml
-src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+src/main/java/org/openapitools/OpenApiGeneratorApplication.java
src/main/java/org/openapitools/RFC3339DateFormat.java
src/main/java/org/openapitools/RestConfiguration.java
src/main/java/org/openapitools/ValidationErrorProcessor.java
diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index cb088f451935..000000000000
--- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,63 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.Module;
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebMvcConfigurer webConfigurer() {
- return new WebMvcConfigurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- registry.addResourceHandler("/swagger-ui/**").addResourceLocations("classpath:/META-INF/resources/webjars/swagger-ui/3.14.2/");
- }
- };
- }
-
- @Bean
- public Module jsonNullableModule() {
- return new JsonNullableModule();
- }
-
-}
diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
new file mode 100644
index 000000000000..f62fd6d91797
--- /dev/null
+++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/OpenApiGeneratorApplication.java
@@ -0,0 +1,23 @@
+package org.openapitools;
+
+import com.fasterxml.jackson.databind.Module;
+import org.openapitools.jackson.nullable.JsonNullableModule;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+
+@SpringBootApplication
+@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
+public class OpenApiGeneratorApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(OpenApiGeneratorApplication.class, args);
+ }
+
+ @Bean
+ public Module jsonNullableModule() {
+ return new JsonNullableModule();
+ }
+
+}
\ No newline at end of file
diff --git a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/config/swagger/OpenAPIDocumentationConfig.java b/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/config/swagger/OpenAPIDocumentationConfig.java
deleted file mode 100644
index dac5a9cdd15f..000000000000
--- a/samples/server/petstore/java-pkmst/src/main/java/com/prokarma/pkmst/config/swagger/OpenAPIDocumentationConfig.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package com.prokarma.pkmst.config.swagger;
-
-import java.util.Date;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.http.ResponseEntity;
-import org.springframework.util.StopWatch;
-import springfox.documentation.builders.PathSelectors;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.service.Contact;
-//import static springfox.documentation.builders.PathSelectors.regex;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-/**
- * Enable swagger ui for application
- * @author pkmst
- *
- */
-@EnableSwagger2
-@Configuration
-public class OpenAPIDocumentationConfig {
-
- public static final String DEFAULT_INCLUDE_PATTERN = "/pkmst/.*";
- @Bean
- public Docket swaggerSpringfoxDocket(PkmstProperties pkmstProperties) {
- StopWatch watch = new StopWatch();
- watch.start();
- Contact contact = new Contact(
- pkmstProperties.getSwagger().getContactName(),
- pkmstProperties.getSwagger().getContactUrl(),
- pkmstProperties.getSwagger().getContactEmail());
-
- ApiInfo apiInfo = new ApiInfo(
- pkmstProperties.getSwagger().getTitle(),
- pkmstProperties.getSwagger().getDescription(),
- pkmstProperties.getSwagger().getVersion(),
- pkmstProperties.getSwagger().getTermsOfServiceUrl(),
- contact,
- pkmstProperties.getSwagger().getLicense(),
- pkmstProperties.getSwagger().getLicenseUrl());
-
- Docket docket = new Docket(DocumentationType.SWAGGER_2)
- .apiInfo(apiInfo)
- .forCodeGeneration(true)
- .genericModelSubstitutes(ResponseEntity.class)
- .ignoredParameterTypes(java.sql.Date.class)
- .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
- .directModelSubstitute(java.time.ZonedDateTime.class, Date.class)
- .directModelSubstitute(java.time.LocalDateTime.class, Date.class)
- .select()
- .apis(RequestHandlerSelectors.basePackage("com.prokarma.pkmst"))
- // .paths(regex(DEFAULT_INCLUDE_PATTERN))
- .paths(PathSelectors.any())
- .build();
- watch.stop();
- return docket;
- }
-
-}
\ No newline at end of file
diff --git a/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES b/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES
index 476018140121..65d58a20ec41 100644
--- a/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES
+++ b/samples/server/petstore/spring-boot-nullable-set/.openapi-generator/FILES
@@ -1,4 +1,3 @@
-.openapi-generator-ignore
README.md
pom.xml
src/main/java/org/openapitools/api/ApiUtil.java
diff --git a/samples/server/petstore/spring-boot-nullable-set/pom.xml b/samples/server/petstore/spring-boot-nullable-set/pom.xml
index 616991b3db3d..896c15f5167f 100644
--- a/samples/server/petstore/spring-boot-nullable-set/pom.xml
+++ b/samples/server/petstore/spring-boot-nullable-set/pom.xml
@@ -10,11 +10,12 @@
${java.version}
${java.version}
1.6.4
+ 4.4.1-1
org.springframework.boot
spring-boot-starter-parent
- 2.6.2
+ 2.6.3
src/main/java
@@ -62,5 +63,10 @@
com.fasterxml.jackson.core
jackson-databind
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java
index 7406be7426c1..796126d05a9f 100644
--- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java
+++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/api/NullableApi.java
@@ -59,7 +59,7 @@ default Optional getRequest() {
consumes = "application/json"
)
default ResponseEntity nullableTest(
- @Parameter(name = "ObjectWithUniqueItems", description = "", schema = @Schema(description = "")) @Valid @RequestBody(required = false) ObjectWithUniqueItems objectWithUniqueItems
+ @Parameter(name = "ObjectWithUniqueItems", description = "") @Valid @RequestBody(required = false) ObjectWithUniqueItems objectWithUniqueItems
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES
deleted file mode 100644
index 3522987f15f9..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/FILES
+++ /dev/null
@@ -1,13 +0,0 @@
-README.md
-pom.xml
-src/main/java/org/openapitools/OpenAPI2SpringBoot.java
-src/main/java/org/openapitools/RFC3339DateFormat.java
-src/main/java/org/openapitools/api/ApiUtil.java
-src/main/java/org/openapitools/api/TestHeadersApi.java
-src/main/java/org/openapitools/api/TestHeadersApiController.java
-src/main/java/org/openapitools/api/TestQueryParamsApi.java
-src/main/java/org/openapitools/api/TestQueryParamsApiController.java
-src/main/java/org/openapitools/configuration/HomeController.java
-src/main/java/org/openapitools/model/TestResponse.java
-src/main/resources/application.properties
-src/main/resources/openapi.yaml
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
deleted file mode 100644
index 7cad28eed8ac..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.openapitools;
-
-import com.fasterxml.jackson.databind.Module;
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.boot.CommandLineRunner;
-import org.springframework.boot.ExitCodeGenerator;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-@SpringBootApplication
-@ComponentScan(basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"})
-public class OpenAPI2SpringBoot implements CommandLineRunner {
-
- @Override
- public void run(String... arg0) throws Exception {
- if (arg0.length > 0 && arg0[0].equals("exitcode")) {
- throw new ExitException();
- }
- }
-
- public static void main(String[] args) throws Exception {
- new SpringApplication(OpenAPI2SpringBoot.class).run(args);
- }
-
- static class ExitException extends RuntimeException implements ExitCodeGenerator {
- private static final long serialVersionUID = 1L;
-
- @Override
- public int getExitCode() {
- return 10;
- }
-
- }
-
- @Bean
- public WebMvcConfigurer webConfigurer() {
- return new WebMvcConfigurer() {
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
- };
- }
-
- @Bean
- public Module jsonNullableModule() {
- return new JsonNullableModule();
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java
deleted file mode 100644
index c05f7a3be323..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import java.math.BigDecimal;
-import org.openapitools.model.TestResponse;
-import io.swagger.annotations.*;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Validated
-@Api(value = "test-headers", description = "the test-headers API")
-public interface TestHeadersApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- /**
- * GET /test-headers : test headers
- * desc
- *
- * @param headerNumber (optional, default to 11.2)
- * @param headerString (optional, default to qwerty)
- * @param headerStringWrapped (optional, default to qwerty)
- * @param headerStringQuotes (optional, default to qwerty\"with quotes\" test)
- * @param headerStringQuotesWrapped (optional, default to qwerty\"with quotes\" test)
- * @param headerBoolean (optional, default to true)
- * @return default response (status code 200)
- */
- @ApiOperation(
- tags = { "verify-default-value" },
- value = "test headers",
- nickname = "headersTest",
- notes = "desc",
- response = TestResponse.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "default response", response = TestResponse.class)
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/test-headers",
- produces = { "application/json" }
- )
- default ResponseEntity headersTest(
- @ApiParam(value = "", defaultValue = "11.2") @RequestHeader(value = "headerNumber", required = false, defaultValue = "11.2") BigDecimal headerNumber,
- @ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerString", required = false, defaultValue = "qwerty") String headerString,
- @ApiParam(value = "", defaultValue = "qwerty") @RequestHeader(value = "headerStringWrapped", required = false, defaultValue = "qwerty") String headerStringWrapped,
- @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotes", required = false, defaultValue = "qwerty\"with quotes\" test") String headerStringQuotes,
- @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @RequestHeader(value = "headerStringQuotesWrapped", required = false, defaultValue = "qwerty\"with quotes\" test") String headerStringQuotesWrapped,
- @ApiParam(value = "", defaultValue = "true") @RequestHeader(value = "headerBoolean", required = false, defaultValue = "true") Boolean headerBoolean
- ) {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"numberField\" : 6.027456183070403, \"booleanField\" : true, \"id\" : 0, \"stringField\" : \"asd\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java
deleted file mode 100644
index cdc9e71f4347..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApiController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openapitools.api;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.context.request.NativeWebRequest;
-import java.util.Optional;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Controller
-@RequestMapping("${openapi.toto.base-path:}")
-public class TestHeadersApiController implements TestHeadersApi {
-
- private final NativeWebRequest request;
-
- @Autowired
- public TestHeadersApiController(NativeWebRequest request) {
- this.request = request;
- }
-
- @Override
- public Optional getRequest() {
- return Optional.ofNullable(request);
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java
deleted file mode 100644
index 701275ec4880..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import java.math.BigDecimal;
-import org.openapitools.model.TestResponse;
-import io.swagger.annotations.*;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Validated
-@Api(value = "test-query-params", description = "the test-query-params API")
-public interface TestQueryParamsApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- /**
- * GET /test-query-params : test query params
- * desc
- *
- * @param queryNumber (optional, default to 11.2)
- * @param queryString (optional, default to qwerty)
- * @param queryStringWrapped (optional, default to qwerty)
- * @param queryStringQuotes (optional, default to qwerty\"with quotes\" test)
- * @param queryStringQuotesWrapped (optional, default to qwerty\"with quotes\" test)
- * @param queryBoolean (optional, default to true)
- * @return default response (status code 200)
- */
- @ApiOperation(
- tags = { "verify-default-value" },
- value = "test query params",
- nickname = "queryParamsTest",
- notes = "desc",
- response = TestResponse.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "default response", response = TestResponse.class)
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/test-query-params",
- produces = { "application/json" }
- )
- default ResponseEntity queryParamsTest(
- @ApiParam(value = "", defaultValue = "11.2") @Valid @RequestParam(value = "queryNumber", required = false, defaultValue = "11.2") BigDecimal queryNumber,
- @ApiParam(value = "", defaultValue = "qwerty") @Valid @RequestParam(value = "queryString", required = false, defaultValue = "qwerty") String queryString,
- @ApiParam(value = "", defaultValue = "qwerty") @Valid @RequestParam(value = "queryStringWrapped", required = false, defaultValue = "qwerty") String queryStringWrapped,
- @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @Valid @RequestParam(value = "queryStringQuotes", required = false, defaultValue = "qwerty\"with quotes\" test") String queryStringQuotes,
- @ApiParam(value = "", defaultValue = "qwerty\"with quotes\" test") @Valid @RequestParam(value = "queryStringQuotesWrapped", required = false, defaultValue = "qwerty\"with quotes\" test") String queryStringQuotesWrapped,
- @ApiParam(value = "", defaultValue = "true") @Valid @RequestParam(value = "queryBoolean", required = false, defaultValue = "true") Boolean queryBoolean
- ) {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"numberField\" : 6.027456183070403, \"booleanField\" : true, \"id\" : 0, \"stringField\" : \"asd\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
-
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java
deleted file mode 100644
index 1884ac71c223..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApiController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openapitools.api;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.context.request.NativeWebRequest;
-import java.util.Optional;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Controller
-@RequestMapping("${openapi.toto.base-path:}")
-public class TestQueryParamsApiController implements TestQueryParamsApi {
-
- private final NativeWebRequest request;
-
- @Autowired
- public TestQueryParamsApiController(NativeWebRequest request) {
- this.request = request;
- }
-
- @Override
- public Optional getRequest() {
- return Optional.ofNullable(request);
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/HomeController.java
deleted file mode 100644
index 25727830541b..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/HomeController.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.openapitools.configuration;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-
-/**
- * Home redirection to OpenAPI api documentation
- */
-@Controller
-public class HomeController {
-
- @RequestMapping("/")
- public String index() {
- return "redirect:swagger-ui.html";
- }
-
-
-}
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java
deleted file mode 100644
index 03247106ff56..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.openapitools.configuration;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import org.springframework.web.util.UriComponentsBuilder;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.service.Contact;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.paths.Paths;
-import springfox.documentation.spring.web.paths.RelativePathProvider;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-import javax.servlet.ServletContext;
-
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Configuration
-@EnableSwagger2
-public class OpenAPIDocumentationConfig {
-
- ApiInfo apiInfo() {
- return new ApiInfoBuilder()
- .title("toto")
- .description("desc")
- .license("")
- .licenseUrl("http://unlicense.org")
- .termsOfServiceUrl("")
- .version("1.0.0")
- .contact(new Contact("","", ""))
- .build();
- }
-
- @Bean
- public Docket customImplementation(ServletContext servletContext, @Value("${openapi.toto.base-path:}") String basePath) {
- return new Docket(DocumentationType.SWAGGER_2)
- .select()
- .apis(RequestHandlerSelectors.basePackage("org.openapitools.api"))
- .build()
- .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath))
- .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
- .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class)
- .apiInfo(apiInfo());
- }
-
- class BasePathAwareRelativePathProvider extends RelativePathProvider {
- private String basePath;
-
- public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) {
- super(servletContext);
- this.basePath = basePath;
- }
-
- @Override
- protected String applicationPath() {
- return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString());
- }
-
- @Override
- public String getOperationPath(String operationPath) {
- UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/");
- return Paths.removeAdjacentForwardSlashes(
- uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString());
- }
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java
deleted file mode 100644
index cae289f03d1b..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/model/TestResponse.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * TestResponse
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class TestResponse {
-
- @JsonProperty("id")
- private Integer id;
-
- @JsonProperty("stringField")
- private String stringField = "asd";
-
- @JsonProperty("numberField")
- private BigDecimal numberField = new BigDecimal("11");
-
- @JsonProperty("booleanField")
- private Boolean booleanField = true;
-
- public TestResponse id(Integer id) {
- this.id = id;
- return this;
- }
-
- /**
- * Get id
- * @return id
- */
- @NotNull
- @ApiModelProperty(required = true, value = "")
- public Integer getId() {
- return id;
- }
-
- public void setId(Integer id) {
- this.id = id;
- }
-
- public TestResponse stringField(String stringField) {
- this.stringField = stringField;
- return this;
- }
-
- /**
- * Get stringField
- * @return stringField
- */
- @NotNull
- @ApiModelProperty(required = true, value = "")
- public String getStringField() {
- return stringField;
- }
-
- public void setStringField(String stringField) {
- this.stringField = stringField;
- }
-
- public TestResponse numberField(BigDecimal numberField) {
- this.numberField = numberField;
- return this;
- }
-
- /**
- * Get numberField
- * @return numberField
- */
- @NotNull @Valid
- @ApiModelProperty(required = true, value = "")
- public BigDecimal getNumberField() {
- return numberField;
- }
-
- public void setNumberField(BigDecimal numberField) {
- this.numberField = numberField;
- }
-
- public TestResponse booleanField(Boolean booleanField) {
- this.booleanField = booleanField;
- return this;
- }
-
- /**
- * Get booleanField
- * @return booleanField
- */
- @NotNull
- @ApiModelProperty(required = true, value = "")
- public Boolean getBooleanField() {
- return booleanField;
- }
-
- public void setBooleanField(Boolean booleanField) {
- this.booleanField = booleanField;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- TestResponse testResponse = (TestResponse) o;
- return Objects.equals(this.id, testResponse.id) &&
- Objects.equals(this.stringField, testResponse.stringField) &&
- Objects.equals(this.numberField, testResponse.numberField) &&
- Objects.equals(this.booleanField, testResponse.booleanField);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, stringField, numberField, booleanField);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class TestResponse {\n");
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" stringField: ").append(toIndentedString(stringField)).append("\n");
- sb.append(" numberField: ").append(toIndentedString(numberField)).append("\n");
- sb.append(" booleanField: ").append(toIndentedString(booleanField)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml b/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml
deleted file mode 100644
index bd7100d9b552..000000000000
--- a/samples/server/petstore/spring-mvc-default-value/src/main/resources/openapi.yaml
+++ /dev/null
@@ -1,170 +0,0 @@
-openapi: 3.0.1
-info:
- description: desc
- title: toto
- version: 1.0.0
-servers:
-- description: /
- url: /
-tags:
-- description: verify-default-value
- name: verify-default-value
-paths:
- /test-headers:
- get:
- description: desc
- operationId: headersTest
- parameters:
- - explode: false
- in: header
- name: headerNumber
- required: false
- schema:
- default: 11.2
- type: number
- style: simple
- - explode: false
- in: header
- name: headerString
- required: false
- schema:
- default: qwerty
- type: string
- style: simple
- - explode: false
- in: header
- name: headerStringWrapped
- required: false
- schema:
- default: qwerty
- type: string
- style: simple
- - explode: false
- in: header
- name: headerStringQuotes
- required: false
- schema:
- default: qwerty"with quotes" test
- type: string
- style: simple
- - explode: false
- in: header
- name: headerStringQuotesWrapped
- required: false
- schema:
- default: qwerty"with quotes" test
- type: string
- style: simple
- - explode: false
- in: header
- name: headerBoolean
- required: false
- schema:
- default: true
- type: boolean
- style: simple
- responses:
- default:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TestResponse'
- description: default response
- summary: test headers
- tags:
- - verify-default-value
- x-accepts: application/json
- x-tags:
- - tag: verify-default-value
- /test-query-params:
- get:
- description: desc
- operationId: queryParamsTest
- parameters:
- - explode: true
- in: query
- name: queryNumber
- required: false
- schema:
- default: 11.2
- type: number
- style: form
- - explode: true
- in: query
- name: queryString
- required: false
- schema:
- default: qwerty
- type: string
- style: form
- - explode: true
- in: query
- name: queryStringWrapped
- required: false
- schema:
- default: qwerty
- type: string
- style: form
- - explode: true
- in: query
- name: queryStringQuotes
- required: false
- schema:
- default: qwerty"with quotes" test
- type: string
- style: form
- - explode: true
- in: query
- name: queryStringQuotesWrapped
- required: false
- schema:
- default: qwerty"with quotes" test
- type: string
- style: form
- - explode: true
- in: query
- name: queryBoolean
- required: false
- schema:
- default: true
- type: boolean
- style: form
- responses:
- default:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/TestResponse'
- description: default response
- summary: test query params
- tags:
- - verify-default-value
- x-accepts: application/json
- x-tags:
- - tag: verify-default-value
-components:
- schemas:
- TestResponse:
- example:
- numberField: 6.027456183070403
- booleanField: true
- id: 0
- stringField: asd
- properties:
- id:
- type: integer
- stringField:
- default: asd
- type: string
- numberField:
- default: 11
- type: number
- booleanField:
- default: true
- type: boolean
- required:
- - booleanField
- - id
- - numberField
- - stringField
- type: object
diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator-ignore b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator-ignore
deleted file mode 100644
index 7484ee590a38..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator-ignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# OpenAPI Generator Ignore
-# Generated by openapi-generator https://github.com/openapitools/openapi-generator
-
-# Use this file to prevent files from being overwritten by the generator.
-# The patterns follow closely to .gitignore or .dockerignore.
-
-# As an example, the C# client generator defines ApiClient.cs.
-# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
-#ApiClient.cs
-
-# You can match any string of characters against a directory, file or extension with a single asterisk (*):
-#foo/*/qux
-# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
-
-# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
-#foo/**/qux
-# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
-
-# You can also negate patterns with an exclamation (!).
-# For example, you can ignore all files in a docs folder with the file extension .md:
-#docs/*.md
-# Then explicitly reverse the ignore rule for a single file:
-#!docs/README.md
diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES
deleted file mode 100644
index 97eae4aa8c7a..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/FILES
+++ /dev/null
@@ -1,70 +0,0 @@
-README.md
-pom.xml
-src/main/java/org/openapitools/api/AnotherFakeApi.java
-src/main/java/org/openapitools/api/AnotherFakeApiController.java
-src/main/java/org/openapitools/api/ApiUtil.java
-src/main/java/org/openapitools/api/FakeApi.java
-src/main/java/org/openapitools/api/FakeApiController.java
-src/main/java/org/openapitools/api/FakeClassnameTestApi.java
-src/main/java/org/openapitools/api/FakeClassnameTestApiController.java
-src/main/java/org/openapitools/api/PetApi.java
-src/main/java/org/openapitools/api/PetApiController.java
-src/main/java/org/openapitools/api/StoreApi.java
-src/main/java/org/openapitools/api/StoreApiController.java
-src/main/java/org/openapitools/api/UserApi.java
-src/main/java/org/openapitools/api/UserApiController.java
-src/main/java/org/openapitools/configuration/HomeController.java
-src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java
-src/main/java/org/openapitools/configuration/RFC3339DateFormat.java
-src/main/java/org/openapitools/configuration/WebApplication.java
-src/main/java/org/openapitools/configuration/WebMvcConfiguration.java
-src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
-src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
-src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
-src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
-src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
-src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
-src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
-src/main/java/org/openapitools/model/AdditionalPropertiesString.java
-src/main/java/org/openapitools/model/Animal.java
-src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
-src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
-src/main/java/org/openapitools/model/ArrayTest.java
-src/main/java/org/openapitools/model/BigCat.java
-src/main/java/org/openapitools/model/BigCatAllOf.java
-src/main/java/org/openapitools/model/Capitalization.java
-src/main/java/org/openapitools/model/Cat.java
-src/main/java/org/openapitools/model/CatAllOf.java
-src/main/java/org/openapitools/model/Category.java
-src/main/java/org/openapitools/model/ClassModel.java
-src/main/java/org/openapitools/model/Client.java
-src/main/java/org/openapitools/model/Dog.java
-src/main/java/org/openapitools/model/DogAllOf.java
-src/main/java/org/openapitools/model/EnumArrays.java
-src/main/java/org/openapitools/model/EnumClass.java
-src/main/java/org/openapitools/model/EnumTest.java
-src/main/java/org/openapitools/model/File.java
-src/main/java/org/openapitools/model/FileSchemaTestClass.java
-src/main/java/org/openapitools/model/FormatTest.java
-src/main/java/org/openapitools/model/HasOnlyReadOnly.java
-src/main/java/org/openapitools/model/MapTest.java
-src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
-src/main/java/org/openapitools/model/Model200Response.java
-src/main/java/org/openapitools/model/ModelApiResponse.java
-src/main/java/org/openapitools/model/ModelList.java
-src/main/java/org/openapitools/model/ModelReturn.java
-src/main/java/org/openapitools/model/Name.java
-src/main/java/org/openapitools/model/NumberOnly.java
-src/main/java/org/openapitools/model/Order.java
-src/main/java/org/openapitools/model/OuterComposite.java
-src/main/java/org/openapitools/model/OuterEnum.java
-src/main/java/org/openapitools/model/Pet.java
-src/main/java/org/openapitools/model/ReadOnlyFirst.java
-src/main/java/org/openapitools/model/SpecialModelName.java
-src/main/java/org/openapitools/model/Tag.java
-src/main/java/org/openapitools/model/TypeHolderDefault.java
-src/main/java/org/openapitools/model/TypeHolderExample.java
-src/main/java/org/openapitools/model/User.java
-src/main/java/org/openapitools/model/XmlItem.java
-src/main/resources/application.properties
-src/main/resources/openapi.yaml
diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION
deleted file mode 100644
index 5f68295fc196..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-6.0.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc-j8-async/README.md b/samples/server/petstore/spring-mvc-j8-async/README.md
deleted file mode 100644
index 4d5e52bd8f88..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/README.md
+++ /dev/null
@@ -1,12 +0,0 @@
-# OpenAPI generated server
-
-Spring MVC Server
-
-
-## Overview
-This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. This is an example of building a OpenAPI-enabled server in Java using the Spring MVC framework.
-
-The underlying library integrating OpenAPI to Spring-MVC is [springfox](https://github.com/springfox/springfox)
-
-You can view the server in swagger-ui by pointing to
-http://localhost:8002/v2/
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml
deleted file mode 100644
index 5a556ac88569..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/pom.xml
+++ /dev/null
@@ -1,178 +0,0 @@
-
- 4.0.0
- org.openapitools
- spring-mvc-server-j8-async
- jar
- spring-mvc-server-j8-async
- 1.0.0
-
- src/main/java
-
-
- org.apache.maven.plugins
- maven-war-plugin
- 3.1.0
-
-
- maven-failsafe-plugin
- 2.6
-
-
-
- integration-test
- verify
-
-
-
-
-
- org.eclipse.jetty
- jetty-maven-plugin
- ${jetty-version}
-
-
- /v2
-
- target/${project.artifactId}-${project.version}
- 8079
- stopit
- 10
-
- 8002
- 60000
-
-
-
-
- jakarta.validation
- jakarta.validation-api
- ${beanvalidation-version}
-
-
-
-
- start-jetty
- pre-integration-test
-
- start
-
-
- 0
- true
-
-
-
- stop-jetty
- post-integration-test
-
- stop
-
-
-
-
-
-
-
-
- org.slf4j
- slf4j-log4j12
- ${slf4j-version}
-
-
-
-
- org.springframework
- spring-core
- ${spring-version}
-
-
- org.springframework
- spring-webmvc
- ${spring-version}
-
-
- org.springframework
- spring-web
- ${spring-version}
-
-
- jakarta.annotation
- jakarta.annotation-api
- ${jakarta-annotation-version}
-
-
- jakarta.xml.bind
- jakarta.xml.bind-api
- ${jakarta.xml.bind-version}
-
-
-
- io.springfox
- springfox-swagger2
- ${springfox-version}
-
-
- com.fasterxml.jackson.core
- jackson-annotations
-
-
-
-
- io.springfox
- springfox-swagger-ui
- ${springfox-version}
-
-
- org.openapitools
- jackson-databind-nullable
- ${jackson-databind-nullable-version}
-
-
- junit
- junit
- ${junit-version}
- test
-
-
- jakarta.servlet
- jakarta.servlet-api
- ${servlet-api-version}
-
-
-
- jakarta.validation
- jakarta.validation-api
- ${beanvalidation-version}
- provided
-
-
- org.springframework.data
- spring-data-commons
- 2.0.11.RELEASE
-
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson-databind-version}
-
-
-
- 1.8
- ${java.version}
- ${java.version}
- 1.3.5
- 2.3.3
- 9.2.15.v20160210
- 1.7.21
- 4.13.1
- 4.0.4
- 2.9.2
- 2.9.9
- 2.8.4
- 2.0.2
- 4.3.20.RELEASE
- 0.2.2
- 2.9.8
- 1.6.3
-
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java
deleted file mode 100644
index e3fcb154af3b..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import org.openapitools.model.Client;
-import io.swagger.annotations.*;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.CompletableFuture;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Validated
-@Api(value = "another-fake", description = "the another-fake API")
-public interface AnotherFakeApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- /**
- * PATCH /another-fake/dummy : To test special tags
- * To test special tags and operation ID starting with number
- *
- * @param body client model (required)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "$another-fake?" },
- value = "To test special tags",
- nickname = "call123testSpecialTags",
- notes = "To test special tags and operation ID starting with number",
- response = Client.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Client.class)
- })
- @RequestMapping(
- method = RequestMethod.PATCH,
- value = "/another-fake/dummy",
- produces = { "application/json" },
- consumes = { "application/json" }
- )
- default CompletableFuture> call123testSpecialTags(
- @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"client\" : \"client\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java
deleted file mode 100644
index 81dcb1da85e4..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApiController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openapitools.api;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.context.request.NativeWebRequest;
-import java.util.Optional;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Controller
-@RequestMapping("${openapi.openAPIPetstore.base-path:/}")
-public class AnotherFakeApiController implements AnotherFakeApi {
-
- private final NativeWebRequest request;
-
- @Autowired
- public AnotherFakeApiController(NativeWebRequest request) {
- this.request = request;
- }
-
- @Override
- public Optional getRequest() {
- return Optional.ofNullable(request);
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiException.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiException.java
deleted file mode 100644
index fdbaeee3a29e..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiException.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.openapitools.api;
-
-
-public class ApiException extends Exception{
- private int code;
- public ApiException (int code, String msg) {
- super(msg);
- this.code = code;
- }
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiOriginFilter.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiOriginFilter.java
deleted file mode 100644
index 32424c32c4cc..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiOriginFilter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openapitools.api;
-
-import java.io.IOException;
-
-import javax.servlet.*;
-import javax.servlet.http.HttpServletResponse;
-
-
-public class ApiOriginFilter implements javax.servlet.Filter {
- @Override
- public void doFilter(ServletRequest request, ServletResponse response,
- FilterChain chain) throws IOException, ServletException {
- HttpServletResponse res = (HttpServletResponse) response;
- res.addHeader("Access-Control-Allow-Origin", "*");
- res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT");
- res.addHeader("Access-Control-Allow-Headers", "Content-Type");
- chain.doFilter(request, response);
- }
-
- @Override
- public void destroy() {
- }
-
- @Override
- public void init(FilterConfig filterConfig) throws ServletException {
- }
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiResponseMessage.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiResponseMessage.java
deleted file mode 100644
index c85c5b51afdf..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiResponseMessage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.openapitools.api;
-
-import javax.xml.bind.annotation.XmlTransient;
-
-
-@javax.xml.bind.annotation.XmlRootElement
-public class ApiResponseMessage {
- public static final int ERROR = 1;
- public static final int WARNING = 2;
- public static final int INFO = 3;
- public static final int OK = 4;
- public static final int TOO_BUSY = 5;
-
- int code;
- String type;
- String message;
-
- public ApiResponseMessage(){}
-
- public ApiResponseMessage(int code, String message){
- this.code = code;
- switch(code){
- case ERROR:
- setType("error");
- break;
- case WARNING:
- setType("warning");
- break;
- case INFO:
- setType("info");
- break;
- case OK:
- setType("ok");
- break;
- case TOO_BUSY:
- setType("too busy");
- break;
- default:
- setType("unknown");
- break;
- }
- this.message = message;
- }
-
- @XmlTransient
- public int getCode() {
- return code;
- }
-
- public void setCode(int code) {
- this.code = code;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiUtil.java
deleted file mode 100644
index 1245b1dd0ccf..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/ApiUtil.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.openapitools.api;
-
-import org.springframework.web.context.request.NativeWebRequest;
-
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-
-public class ApiUtil {
- public static void setExampleResponse(NativeWebRequest req, String contentType, String example) {
- try {
- HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class);
- res.setCharacterEncoding("UTF-8");
- res.addHeader("Content-Type", contentType);
- res.getWriter().print(example);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java
deleted file mode 100644
index 792e526a2bcf..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java
+++ /dev/null
@@ -1,593 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import java.math.BigDecimal;
-import org.openapitools.model.Client;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.openapitools.model.FileSchemaTestClass;
-import java.time.LocalDate;
-import java.util.Map;
-import org.openapitools.model.ModelApiResponse;
-import java.time.OffsetDateTime;
-import org.openapitools.model.OuterComposite;
-import org.openapitools.model.User;
-import org.openapitools.model.XmlItem;
-import io.swagger.annotations.*;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.CompletableFuture;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Validated
-@Api(value = "fake", description = "the fake API")
-public interface FakeApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- /**
- * POST /fake/create_xml_item : creates an XmlItem
- * this route creates an XmlItem
- *
- * @param xmlItem XmlItem Body (required)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "creates an XmlItem",
- nickname = "createXmlItem",
- notes = "this route creates an XmlItem"
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/fake/create_xml_item",
- consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }
- )
- default CompletableFuture> createXmlItem(
- @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * POST /fake/outer/boolean
- * Test serialization of outer boolean types
- *
- * @param body Input boolean as post body (optional)
- * @return Output boolean (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "",
- nickname = "fakeOuterBooleanSerialize",
- notes = "Test serialization of outer boolean types",
- response = Boolean.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class)
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/fake/outer/boolean",
- produces = { "*/*" }
- )
- default CompletableFuture> fakeOuterBooleanSerialize(
- @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * POST /fake/outer/composite
- * Test serialization of object with outer number type
- *
- * @param body Input composite as post body (optional)
- * @return Output composite (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "",
- nickname = "fakeOuterCompositeSerialize",
- notes = "Test serialization of object with outer number type",
- response = OuterComposite.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class)
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/fake/outer/composite",
- produces = { "*/*" }
- )
- default CompletableFuture> fakeOuterCompositeSerialize(
- @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
- String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }";
- ApiUtil.setExampleResponse(request, "*/*", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-
- /**
- * POST /fake/outer/number
- * Test serialization of outer number types
- *
- * @param body Input number as post body (optional)
- * @return Output number (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "",
- nickname = "fakeOuterNumberSerialize",
- notes = "Test serialization of outer number types",
- response = BigDecimal.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class)
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/fake/outer/number",
- produces = { "*/*" }
- )
- default CompletableFuture> fakeOuterNumberSerialize(
- @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * POST /fake/outer/string
- * Test serialization of outer string types
- *
- * @param body Input string as post body (optional)
- * @return Output string (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "",
- nickname = "fakeOuterStringSerialize",
- notes = "Test serialization of outer string types",
- response = String.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Output string", response = String.class)
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/fake/outer/string",
- produces = { "*/*" }
- )
- default CompletableFuture> fakeOuterStringSerialize(
- @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * PUT /fake/body-with-file-schema
- * For this test, the body for this request much reference a schema named `File`.
- *
- * @param body (required)
- * @return Success (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "",
- nickname = "testBodyWithFileSchema",
- notes = "For this test, the body for this request much reference a schema named `File`."
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Success")
- })
- @RequestMapping(
- method = RequestMethod.PUT,
- value = "/fake/body-with-file-schema",
- consumes = { "application/json" }
- )
- default CompletableFuture> testBodyWithFileSchema(
- @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * PUT /fake/body-with-query-params
- *
- * @param query (required)
- * @param body (required)
- * @return Success (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "",
- nickname = "testBodyWithQueryParams",
- notes = ""
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Success")
- })
- @RequestMapping(
- method = RequestMethod.PUT,
- value = "/fake/body-with-query-params",
- consumes = { "application/json" }
- )
- default CompletableFuture> testBodyWithQueryParams(
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,
- @ApiParam(value = "", required = true) @Valid @RequestBody User body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * PATCH /fake : To test \"client\" model
- * To test \"client\" model
- *
- * @param body client model (required)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "To test \"client\" model",
- nickname = "testClientModel",
- notes = "To test \"client\" model",
- response = Client.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Client.class)
- })
- @RequestMapping(
- method = RequestMethod.PATCH,
- value = "/fake",
- produces = { "application/json" },
- consumes = { "application/json" }
- )
- default CompletableFuture> testClientModel(
- @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"client\" : \"client\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-
- /**
- * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
- *
- * @param number None (required)
- * @param _double None (required)
- * @param patternWithoutDelimiter None (required)
- * @param _byte None (required)
- * @param integer None (optional)
- * @param int32 None (optional)
- * @param int64 None (optional)
- * @param _float None (optional)
- * @param string None (optional)
- * @param binary None (optional)
- * @param date None (optional)
- * @param dateTime None (optional)
- * @param password None (optional)
- * @param paramCallback None (optional)
- * @return Invalid username supplied (status code 400)
- * or User not found (status code 404)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트",
- nickname = "testEndpointParameters",
- notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트",
- authorizations = {
- @Authorization(value = "http_basic_test")
- }
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/fake",
- consumes = { "application/x-www-form-urlencoded" }
- )
- default CompletableFuture> testEndpointParameters(
- @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,
- @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "double", required = true) Double _double,
- @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter,
- @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte,
- @ApiParam(value = "None") @Valid @RequestPart(value = "integer", required = false) Integer integer,
- @ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,
- @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64,
- @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float,
- @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string,
- @ApiParam(value = "None") @RequestPart(value = "binary", required = false) MultipartFile binary,
- @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date,
- @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime,
- @ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,
- @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * GET /fake : To test enum parameters
- * To test enum parameters
- *
- * @param enumHeaderStringArray Header parameter enum test (string array) (optional)
- * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
- * @param enumQueryStringArray Query parameter enum test (string array) (optional)
- * @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
- * @param enumQueryInteger Query parameter enum test (double) (optional)
- * @param enumQueryDouble Query parameter enum test (double) (optional)
- * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
- * @param enumFormString Form parameter enum test (string) (optional, default to -efg)
- * @return Invalid request (status code 400)
- * or Not found (status code 404)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "To test enum parameters",
- nickname = "testEnumParameters",
- notes = "To test enum parameters"
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid request"),
- @ApiResponse(code = 404, message = "Not found")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/fake",
- consumes = { "application/x-www-form-urlencoded" }
- )
- default CompletableFuture> testEnumParameters(
- @ApiParam(value = "Header parameter enum test (string array)", allowableValues = ">, $") @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray,
- @ApiParam(value = "Header parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString,
- @ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,
- @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString,
- @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger,
- @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,
- @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray,
- @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * DELETE /fake : Fake endpoint to test group parameters (optional)
- * Fake endpoint to test group parameters (optional)
- *
- * @param requiredStringGroup Required String in group parameters (required)
- * @param requiredBooleanGroup Required Boolean in group parameters (required)
- * @param requiredInt64Group Required Integer in group parameters (required)
- * @param stringGroup String in group parameters (optional)
- * @param booleanGroup Boolean in group parameters (optional)
- * @param int64Group Integer in group parameters (optional)
- * @return Someting wrong (status code 400)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "Fake endpoint to test group parameters (optional)",
- nickname = "testGroupParameters",
- notes = "Fake endpoint to test group parameters (optional)"
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Someting wrong")
- })
- @RequestMapping(
- method = RequestMethod.DELETE,
- value = "/fake"
- )
- default CompletableFuture> testGroupParameters(
- @NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,
- @ApiParam(value = "Required Boolean in group parameters", required = true) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup,
- @NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,
- @ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,
- @ApiParam(value = "Boolean in group parameters") @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup,
- @ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * POST /fake/inline-additionalProperties : test inline additionalProperties
- *
- * @param param request body (required)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "test inline additionalProperties",
- nickname = "testInlineAdditionalProperties",
- notes = ""
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/fake/inline-additionalProperties",
- consumes = { "application/json" }
- )
- default CompletableFuture> testInlineAdditionalProperties(
- @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * GET /fake/jsonFormData : test json serialization of form data
- *
- * @param param field1 (required)
- * @param param2 field2 (required)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "test json serialization of form data",
- nickname = "testJsonFormData",
- notes = ""
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/fake/jsonFormData",
- consumes = { "application/x-www-form-urlencoded" }
- )
- default CompletableFuture> testJsonFormData(
- @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param,
- @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * PUT /fake/test-query-parameters
- * To test the collection format in query parameters
- *
- * @param pipe (required)
- * @param ioutil (required)
- * @param http (required)
- * @param url (required)
- * @param context (required)
- * @return Success (status code 200)
- */
- @ApiOperation(
- tags = { "fake" },
- value = "",
- nickname = "testQueryParameterCollectionFormat",
- notes = "To test the collection format in query parameters"
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "Success")
- })
- @RequestMapping(
- method = RequestMethod.PUT,
- value = "/fake/test-query-parameters"
- )
- default CompletableFuture> testQueryParameterCollectionFormat(
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,
- @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required)
- *
- * @param petId ID of pet to update (required)
- * @param requiredFile file to upload (required)
- * @param additionalMetadata Additional data to pass to server (optional)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "pet" },
- value = "uploads an image (required)",
- nickname = "uploadFileWithRequiredFile",
- notes = "",
- response = ModelApiResponse.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/fake/{petId}/uploadImageWithRequiredFile",
- produces = { "application/json" },
- consumes = { "multipart/form-data" }
- )
- default CompletableFuture> uploadFileWithRequiredFile(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile,
- @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java
deleted file mode 100644
index b81393d39d3b..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApiController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openapitools.api;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.context.request.NativeWebRequest;
-import java.util.Optional;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Controller
-@RequestMapping("${openapi.openAPIPetstore.base-path:/}")
-public class FakeApiController implements FakeApi {
-
- private final NativeWebRequest request;
-
- @Autowired
- public FakeApiController(NativeWebRequest request) {
- this.request = request;
- }
-
- @Override
- public Optional getRequest() {
- return Optional.ofNullable(request);
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java
deleted file mode 100644
index 7510bd1d4794..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import org.openapitools.model.Client;
-import io.swagger.annotations.*;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.CompletableFuture;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Validated
-@Api(value = "fake_classname_test", description = "the fake_classname_test API")
-public interface FakeClassnameTestApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- /**
- * PATCH /fake_classname_test : To test class name in snake case
- * To test class name in snake case
- *
- * @param body client model (required)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "fake_classname_tags 123#$%^" },
- value = "To test class name in snake case",
- nickname = "testClassname",
- notes = "To test class name in snake case",
- response = Client.class,
- authorizations = {
- @Authorization(value = "api_key_query")
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Client.class)
- })
- @RequestMapping(
- method = RequestMethod.PATCH,
- value = "/fake_classname_test",
- produces = { "application/json" },
- consumes = { "application/json" }
- )
- default CompletableFuture> testClassname(
- @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"client\" : \"client\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java
deleted file mode 100644
index 3f4a45e1f9fa..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openapitools.api;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.context.request.NativeWebRequest;
-import java.util.Optional;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Controller
-@RequestMapping("${openapi.openAPIPetstore.base-path:/}")
-public class FakeClassnameTestApiController implements FakeClassnameTestApi {
-
- private final NativeWebRequest request;
-
- @Autowired
- public FakeClassnameTestApiController(NativeWebRequest request) {
- this.request = request;
- }
-
- @Override
- public Optional getRequest() {
- return Optional.ofNullable(request);
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/NotFoundException.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/NotFoundException.java
deleted file mode 100644
index 526df6c1c197..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/NotFoundException.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.openapitools.api;
-
-
-public class NotFoundException extends ApiException {
- private int code;
- public NotFoundException (int code, String msg) {
- super(code, msg);
- this.code = code;
- }
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java
deleted file mode 100644
index ed40dbe01413..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java
+++ /dev/null
@@ -1,402 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import org.openapitools.model.ModelApiResponse;
-import org.openapitools.model.Pet;
-import java.util.Set;
-import io.swagger.annotations.*;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.CompletableFuture;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Validated
-@Api(value = "pet", description = "the pet API")
-public interface PetApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- /**
- * POST /pet : Add a new pet to the store
- *
- * @param body Pet object that needs to be added to the store (required)
- * @return successful operation (status code 200)
- * or Invalid input (status code 405)
- */
- @ApiOperation(
- tags = { "pet" },
- value = "Add a new pet to the store",
- nickname = "addPet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 405, message = "Invalid input")
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/pet",
- consumes = { "application/json", "application/xml" }
- )
- default CompletableFuture> addPet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * DELETE /pet/{petId} : Deletes a pet
- *
- * @param petId Pet id to delete (required)
- * @param apiKey (optional)
- * @return successful operation (status code 200)
- * or Invalid pet value (status code 400)
- */
- @ApiOperation(
- tags = { "pet" },
- value = "Deletes a pet",
- nickname = "deletePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid pet value")
- })
- @RequestMapping(
- method = RequestMethod.DELETE,
- value = "/pet/{petId}"
- )
- default CompletableFuture> deletePet(
- @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * GET /pet/findByStatus : Finds Pets by status
- * Multiple status values can be provided with comma separated strings
- *
- * @param status Status values that need to be considered for filter (required)
- * @return successful operation (status code 200)
- * or Invalid status value (status code 400)
- */
- @ApiOperation(
- tags = { "pet" },
- value = "Finds Pets by status",
- nickname = "findPetsByStatus",
- notes = "Multiple status values can be provided with comma separated strings",
- response = Pet.class,
- responseContainer = "List",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
- @ApiResponse(code = 400, message = "Invalid status value")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/pet/findByStatus",
- produces = { "application/xml", "application/json" }
- )
- default CompletableFuture>> findPetsByStatus(
- @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
- String exampleString = " 123456789 doggie aeiou aeiou ";
- ApiUtil.setExampleResponse(request, "application/xml", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-
- /**
- * GET /pet/findByTags : Finds Pets by tags
- * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
- *
- * @param tags Tags to filter by (required)
- * @return successful operation (status code 200)
- * or Invalid tag value (status code 400)
- * @deprecated
- */
- @ApiOperation(
- tags = { "pet" },
- value = "Finds Pets by tags",
- nickname = "findPetsByTags",
- notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",
- response = Pet.class,
- responseContainer = "Set",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"),
- @ApiResponse(code = 400, message = "Invalid tag value")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/pet/findByTags",
- produces = { "application/xml", "application/json" }
- )
- default CompletableFuture>> findPetsByTags(
- @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
- String exampleString = " 123456789 doggie aeiou aeiou ";
- ApiUtil.setExampleResponse(request, "application/xml", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-
- /**
- * GET /pet/{petId} : Find pet by ID
- * Returns a single pet
- *
- * @param petId ID of pet to return (required)
- * @return successful operation (status code 200)
- * or Invalid ID supplied (status code 400)
- * or Pet not found (status code 404)
- */
- @ApiOperation(
- tags = { "pet" },
- value = "Find pet by ID",
- nickname = "getPetById",
- notes = "Returns a single pet",
- response = Pet.class,
- authorizations = {
- @Authorization(value = "api_key")
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/pet/{petId}",
- produces = { "application/xml", "application/json" }
- )
- default CompletableFuture> getPetById(
- @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
- String exampleString = " 123456789 doggie aeiou aeiou ";
- ApiUtil.setExampleResponse(request, "application/xml", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-
- /**
- * PUT /pet : Update an existing pet
- *
- * @param body Pet object that needs to be added to the store (required)
- * @return successful operation (status code 200)
- * or Invalid ID supplied (status code 400)
- * or Pet not found (status code 404)
- * or Validation exception (status code 405)
- */
- @ApiOperation(
- tags = { "pet" },
- value = "Update an existing pet",
- nickname = "updatePet",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation"),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Pet not found"),
- @ApiResponse(code = 405, message = "Validation exception")
- })
- @RequestMapping(
- method = RequestMethod.PUT,
- value = "/pet",
- consumes = { "application/json", "application/xml" }
- )
- default CompletableFuture> updatePet(
- @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * POST /pet/{petId} : Updates a pet in the store with form data
- *
- * @param petId ID of pet that needs to be updated (required)
- * @param name Updated name of the pet (optional)
- * @param status Updated status of the pet (optional)
- * @return Invalid input (status code 405)
- */
- @ApiOperation(
- tags = { "pet" },
- value = "Updates a pet in the store with form data",
- nickname = "updatePetWithForm",
- notes = "",
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 405, message = "Invalid input")
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/pet/{petId}",
- consumes = { "application/x-www-form-urlencoded" }
- )
- default CompletableFuture> updatePetWithForm(
- @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name,
- @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * POST /pet/{petId}/uploadImage : uploads an image
- *
- * @param petId ID of pet to update (required)
- * @param additionalMetadata Additional data to pass to server (optional)
- * @param file file to upload (optional)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "pet" },
- value = "uploads an image",
- nickname = "uploadFile",
- notes = "",
- response = ModelApiResponse.class,
- authorizations = {
- @Authorization(value = "petstore_auth", scopes = {
- @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"),
- @AuthorizationScope(scope = "read:pets", description = "read your pets")
- })
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class)
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/pet/{petId}/uploadImage",
- produces = { "application/json" },
- consumes = { "multipart/form-data" }
- )
- default CompletableFuture> uploadFile(
- @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId,
- @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata,
- @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java
deleted file mode 100644
index ec47c8498512..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import java.util.Map;
-import org.openapitools.model.Order;
-import io.swagger.annotations.*;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.CompletableFuture;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Validated
-@Api(value = "store", description = "the store API")
-public interface StoreApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- /**
- * DELETE /store/order/{order_id} : Delete purchase order by ID
- * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
- *
- * @param orderId ID of the order that needs to be deleted (required)
- * @return Invalid ID supplied (status code 400)
- * or Order not found (status code 404)
- */
- @ApiOperation(
- tags = { "store" },
- value = "Delete purchase order by ID",
- nickname = "deleteOrder",
- notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors"
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
- @RequestMapping(
- method = RequestMethod.DELETE,
- value = "/store/order/{order_id}"
- )
- default CompletableFuture> deleteOrder(
- @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("order_id") String orderId
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * GET /store/inventory : Returns pet inventories by status
- * Returns a map of status codes to quantities
- *
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "store" },
- value = "Returns pet inventories by status",
- nickname = "getInventory",
- notes = "Returns a map of status codes to quantities",
- response = Integer.class,
- responseContainer = "Map",
- authorizations = {
- @Authorization(value = "api_key")
- }
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/store/inventory",
- produces = { "application/json" }
- )
- default CompletableFuture>> getInventory(
-
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * GET /store/order/{order_id} : Find purchase order by ID
- * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
- *
- * @param orderId ID of pet that needs to be fetched (required)
- * @return successful operation (status code 200)
- * or Invalid ID supplied (status code 400)
- * or Order not found (status code 404)
- */
- @ApiOperation(
- tags = { "store" },
- value = "Find purchase order by ID",
- nickname = "getOrderById",
- notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",
- response = Order.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid ID supplied"),
- @ApiResponse(code = 404, message = "Order not found")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/store/order/{order_id}",
- produces = { "application/xml", "application/json" }
- )
- default CompletableFuture> getOrderById(
- @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("order_id") Long orderId
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
- String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true ";
- ApiUtil.setExampleResponse(request, "application/xml", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-
- /**
- * POST /store/order : Place an order for a pet
- *
- * @param body order placed for purchasing the pet (required)
- * @return successful operation (status code 200)
- * or Invalid Order (status code 400)
- */
- @ApiOperation(
- tags = { "store" },
- value = "Place an order for a pet",
- nickname = "placeOrder",
- notes = "",
- response = Order.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = Order.class),
- @ApiResponse(code = 400, message = "Invalid Order")
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/store/order",
- produces = { "application/xml", "application/json" }
- )
- default CompletableFuture> placeOrder(
- @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
- String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true ";
- ApiUtil.setExampleResponse(request, "application/xml", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java
deleted file mode 100644
index a1f02f844bf3..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApiController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openapitools.api;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.context.request.NativeWebRequest;
-import java.util.Optional;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Controller
-@RequestMapping("${openapi.openAPIPetstore.base-path:/}")
-public class StoreApiController implements StoreApi {
-
- private final NativeWebRequest request;
-
- @Autowired
- public StoreApiController(NativeWebRequest request) {
- this.request = request;
- }
-
- @Override
- public Optional getRequest() {
- return Optional.ofNullable(request);
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java
deleted file mode 100644
index aca32843e370..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/**
- * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.0.0-SNAPSHOT).
- * https://openapi-generator.tech
- * Do not edit the class manually.
- */
-package org.openapitools.api;
-
-import java.util.List;
-import java.time.OffsetDateTime;
-import org.openapitools.model.User;
-import io.swagger.annotations.*;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.context.request.NativeWebRequest;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.CompletableFuture;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Validated
-@Api(value = "user", description = "the user API")
-public interface UserApi {
-
- default Optional getRequest() {
- return Optional.empty();
- }
-
- /**
- * POST /user : Create user
- * This can only be done by the logged in user.
- *
- * @param body Created user object (required)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "user" },
- value = "Create user",
- nickname = "createUser",
- notes = "This can only be done by the logged in user."
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/user"
- )
- default CompletableFuture> createUser(
- @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * POST /user/createWithArray : Creates list of users with given input array
- *
- * @param body List of user object (required)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithArrayInput",
- notes = ""
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/user/createWithArray"
- )
- default CompletableFuture> createUsersWithArrayInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * POST /user/createWithList : Creates list of users with given input array
- *
- * @param body List of user object (required)
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "user" },
- value = "Creates list of users with given input array",
- nickname = "createUsersWithListInput",
- notes = ""
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
- @RequestMapping(
- method = RequestMethod.POST,
- value = "/user/createWithList"
- )
- default CompletableFuture> createUsersWithListInput(
- @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * DELETE /user/{username} : Delete user
- * This can only be done by the logged in user.
- *
- * @param username The name that needs to be deleted (required)
- * @return Invalid username supplied (status code 400)
- * or User not found (status code 404)
- */
- @ApiOperation(
- tags = { "user" },
- value = "Delete user",
- nickname = "deleteUser",
- notes = "This can only be done by the logged in user."
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
- @RequestMapping(
- method = RequestMethod.DELETE,
- value = "/user/{username}"
- )
- default CompletableFuture> deleteUser(
- @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * GET /user/{username} : Get user by user name
- *
- * @param username The name that needs to be fetched. Use user1 for testing. (required)
- * @return successful operation (status code 200)
- * or Invalid username supplied (status code 400)
- * or User not found (status code 404)
- */
- @ApiOperation(
- tags = { "user" },
- value = "Get user by user name",
- nickname = "getUserByName",
- notes = "",
- response = User.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = User.class),
- @ApiResponse(code = 400, message = "Invalid username supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/user/{username}",
- produces = { "application/xml", "application/json" }
- )
- default CompletableFuture> getUserByName(
- @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username
- ) {
- return CompletableFuture.supplyAsync(()-> {
- getRequest().ifPresent(request -> {
- for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
- String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }";
- ApiUtil.setExampleResponse(request, "application/json", exampleString);
- break;
- }
- if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
- String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 ";
- ApiUtil.setExampleResponse(request, "application/xml", exampleString);
- break;
- }
- }
- });
- return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
- }, Runnable::run);
-
- }
-
-
- /**
- * GET /user/login : Logs user into the system
- *
- * @param username The user name for login (required)
- * @param password The password for login in clear text (required)
- * @return successful operation (status code 200)
- * or Invalid username/password supplied (status code 400)
- */
- @ApiOperation(
- tags = { "user" },
- value = "Logs user into the system",
- nickname = "loginUser",
- notes = "",
- response = String.class
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation", response = String.class),
- @ApiResponse(code = 400, message = "Invalid username/password supplied")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/user/login",
- produces = { "application/xml", "application/json" }
- )
- default CompletableFuture> loginUser(
- @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,
- @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * GET /user/logout : Logs out current logged in user session
- *
- * @return successful operation (status code 200)
- */
- @ApiOperation(
- tags = { "user" },
- value = "Logs out current logged in user session",
- nickname = "logoutUser",
- notes = ""
- )
- @ApiResponses({
- @ApiResponse(code = 200, message = "successful operation")
- })
- @RequestMapping(
- method = RequestMethod.GET,
- value = "/user/logout"
- )
- default CompletableFuture> logoutUser(
-
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-
- /**
- * PUT /user/{username} : Updated user
- * This can only be done by the logged in user.
- *
- * @param username name that need to be deleted (required)
- * @param body Updated user object (required)
- * @return Invalid user supplied (status code 400)
- * or User not found (status code 404)
- */
- @ApiOperation(
- tags = { "user" },
- value = "Updated user",
- nickname = "updateUser",
- notes = "This can only be done by the logged in user."
- )
- @ApiResponses({
- @ApiResponse(code = 400, message = "Invalid user supplied"),
- @ApiResponse(code = 404, message = "User not found")
- })
- @RequestMapping(
- method = RequestMethod.PUT,
- value = "/user/{username}"
- )
- default CompletableFuture> updateUser(
- @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username,
- @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body
- ) {
- return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
-
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java
deleted file mode 100644
index 8efc6418c2e8..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApiController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.openapitools.api;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.context.request.NativeWebRequest;
-import java.util.Optional;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Controller
-@RequestMapping("${openapi.openAPIPetstore.base-path:/}")
-public class UserApiController implements UserApi {
-
- private final NativeWebRequest request;
-
- @Autowired
- public UserApiController(NativeWebRequest request) {
- this.request = request;
- }
-
- @Override
- public Optional getRequest() {
- return Optional.ofNullable(request);
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/HomeController.java
deleted file mode 100644
index 25727830541b..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/HomeController.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.openapitools.configuration;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-
-/**
- * Home redirection to OpenAPI api documentation
- */
-@Controller
-public class HomeController {
-
- @RequestMapping("/")
- public String index() {
- return "redirect:swagger-ui.html";
- }
-
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java
deleted file mode 100644
index 3df5ef9f3c34..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.openapitools.configuration;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import org.springframework.web.util.UriComponentsBuilder;
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.service.Contact;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.paths.Paths;
-import springfox.documentation.spring.web.paths.RelativePathProvider;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-import javax.servlet.ServletContext;
-
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Configuration
-@EnableSwagger2
-public class OpenAPIDocumentationConfig {
-
- ApiInfo apiInfo() {
- return new ApiInfoBuilder()
- .title("OpenAPI Petstore")
- .description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
- .license("Apache-2.0")
- .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html")
- .termsOfServiceUrl("")
- .version("1.0.0")
- .contact(new Contact("","", ""))
- .build();
- }
-
- @Bean
- public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/}") String basePath) {
- return new Docket(DocumentationType.SWAGGER_2)
- .select()
- .apis(RequestHandlerSelectors.basePackage("org.openapitools.api"))
- .build()
- .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath))
- .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
- .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class)
- .apiInfo(apiInfo());
- }
-
- class BasePathAwareRelativePathProvider extends RelativePathProvider {
- private String basePath;
-
- public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) {
- super(servletContext);
- this.basePath = basePath;
- }
-
- @Override
- protected String applicationPath() {
- return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString());
- }
-
- @Override
- public String getOperationPath(String operationPath) {
- UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/");
- return Paths.removeAdjacentForwardSlashes(
- uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString());
- }
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java
deleted file mode 100644
index 682e77202d1e..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/OpenAPIUiConfiguration.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.openapitools.configuration;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import org.openapitools.jackson.nullable.JsonNullableModule;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.context.annotation.Import;
-import org.springframework.context.annotation.Bean;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.converter.StringHttpMessageConverter;
-import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
-import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
-
-import org.springframework.web.method.support.HandlerMethodArgumentResolver;
-import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
-
-import java.util.List;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-@Configuration
-@ComponentScan(basePackages = {"org.openapitools.api", "org.openapitools.configuration"})
-@EnableWebMvc
-@PropertySource("classpath:application.properties")
-@Import(OpenAPIDocumentationConfig.class)
-public class OpenAPIUiConfiguration extends WebMvcConfigurerAdapter {
- private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" };
-
- private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
- "classpath:/META-INF/resources/", "classpath:/resources/",
- "classpath:/static/", "classpath:/public/" };
-
- private static final String[] RESOURCE_LOCATIONS;
- static {
- RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length
- + SERVLET_RESOURCE_LOCATIONS.length];
- System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0,
- SERVLET_RESOURCE_LOCATIONS.length);
- System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS,
- SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length);
- }
-
- private static final String[] STATIC_INDEX_HTML_RESOURCES;
- static {
- STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length];
- for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) {
- STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html";
- }
- }
-
- @Override
- public void addArgumentResolvers(List argumentResolvers) {
- argumentResolvers.add(new PageableHandlerMethodArgumentResolver());
- super.addArgumentResolvers(argumentResolvers);
- }
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- if (!registry.hasMappingForPattern("/webjars/**")) {
- registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
- }
- if (!registry.hasMappingForPattern("/**")) {
- registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS);
- }
- }
-
- /*@Override
- public void addCorsMappings(CorsRegistry registry) {
- registry.addMapping("/**")
- .allowedOrigins("*")
- .allowedMethods("*")
- .allowedHeaders("Content-Type");
- }*/
-
- @Bean
- public Jackson2ObjectMapperBuilder builder() {
- return new Jackson2ObjectMapperBuilder()
- .indentOutput(true)
- .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
- .modulesToInstall(new JsonNullableModule())
-
- .dateFormat(new RFC3339DateFormat());
- }
-
- @Override
- public void configureMessageConverters(List> converters) {
- converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));
- converters.add(new StringHttpMessageConverter());
- super.configureMessageConverters(converters);
- }
-
- @Bean
- public ObjectMapper objectMapper(){
- return builder().build();
- }
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java
deleted file mode 100644
index 697c27391a5c..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/RFC3339DateFormat.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.openapitools.configuration;
-
-import com.fasterxml.jackson.databind.util.StdDateFormat;
-
-import java.text.DateFormat;
-import java.text.FieldPosition;
-import java.text.ParsePosition;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
-
-public class RFC3339DateFormat extends DateFormat {
- private static final long serialVersionUID = 1L;
- private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC");
-
- private final StdDateFormat fmt = new StdDateFormat()
- .withTimeZone(TIMEZONE_Z)
- .withColonInTimeZone(true);
-
- public RFC3339DateFormat() {
- this.calendar = new GregorianCalendar();
- }
-
- @Override
- public Date parse(String source, ParsePosition pos) {
- return fmt.parse(source, pos);
- }
-
- @Override
- public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
- return fmt.format(date, toAppendTo, fieldPosition);
- }
-
- @Override
- public Object clone() {
- return this;
- }
-}
\ No newline at end of file
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java
deleted file mode 100644
index 4a567429c250..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerDocumentationConfig.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.openapitools.configuration;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-
-import springfox.documentation.builders.ApiInfoBuilder;
-import springfox.documentation.builders.RequestHandlerSelectors;
-import springfox.documentation.service.ApiInfo;
-import springfox.documentation.service.Contact;
-import springfox.documentation.spi.DocumentationType;
-import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
-
-
-@Configuration
-@EnableSwagger2
-public class SwaggerDocumentationConfig {
-
- ApiInfo apiInfo() {
- return new ApiInfoBuilder()
- .title("Swagger Petstore")
- .description("This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\")
- .license("Apache-2.0")
- .licenseUrl("https://www.apache.org/licenses/LICENSE-2.0.html")
- .termsOfServiceUrl("")
- .version("1.0.0")
- .contact(new Contact("","", "apiteam@swagger.io"))
- .build();
- }
-
- @Bean
- public Docket customImplementation(){
- return new Docket(DocumentationType.SWAGGER_2)
- .select()
- .apis(RequestHandlerSelectors.basePackage("org.openapitools.api"))
- .build()
- .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
- .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class)
- .apiInfo(apiInfo());
- }
-
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java
deleted file mode 100644
index 4518796ac56f..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/SwaggerUiConfiguration.java
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.openapitools.configuration;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.context.annotation.Import;
-import org.springframework.context.annotation.Bean;
-import org.springframework.http.converter.HttpMessageConverter;
-import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
-import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
-import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
-
-import java.util.List;
-
-
-@Configuration
-@ComponentScan(basePackages = "org.openapitools.api")
-@EnableWebMvc
-@PropertySource("classpath:swagger.properties")
-@Import(SwaggerDocumentationConfig.class)
-public class SwaggerUiConfiguration extends WebMvcConfigurerAdapter {
- private static final String[] SERVLET_RESOURCE_LOCATIONS = { "/" };
-
- private static final String[] CLASSPATH_RESOURCE_LOCATIONS = {
- "classpath:/META-INF/resources/", "classpath:/resources/",
- "classpath:/static/", "classpath:/public/" };
-
- private static final String[] RESOURCE_LOCATIONS;
- static {
- RESOURCE_LOCATIONS = new String[CLASSPATH_RESOURCE_LOCATIONS.length
- + SERVLET_RESOURCE_LOCATIONS.length];
- System.arraycopy(SERVLET_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS, 0,
- SERVLET_RESOURCE_LOCATIONS.length);
- System.arraycopy(CLASSPATH_RESOURCE_LOCATIONS, 0, RESOURCE_LOCATIONS,
- SERVLET_RESOURCE_LOCATIONS.length, CLASSPATH_RESOURCE_LOCATIONS.length);
- }
-
- private static final String[] STATIC_INDEX_HTML_RESOURCES;
- static {
- STATIC_INDEX_HTML_RESOURCES = new String[RESOURCE_LOCATIONS.length];
- for (int i = 0; i < STATIC_INDEX_HTML_RESOURCES.length; i++) {
- STATIC_INDEX_HTML_RESOURCES[i] = RESOURCE_LOCATIONS[i] + "index.html";
- }
- }
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- if (!registry.hasMappingForPattern("/webjars/**")) {
- registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
- }
- if (!registry.hasMappingForPattern("/**")) {
- registry.addResourceHandler("/**").addResourceLocations(RESOURCE_LOCATIONS);
- }
- }
-
- @Bean
- public Jackson2ObjectMapperBuilder builder() {
- Jackson2ObjectMapperBuilder builder = new Jackson2ObjectMapperBuilder()
- .indentOutput(true)
- .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
- .dateFormat(new RFC3339DateFormat());
- return builder;
- }
-
- @Override
- public void configureMessageConverters(List> converters) {
- converters.add(new MappingJackson2HttpMessageConverter(objectMapper()));
- super.configureMessageConverters(converters);
- }
-
- @Bean
- public ObjectMapper objectMapper(){
- return builder().build();
- }
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java
deleted file mode 100644
index 8e9d7af82449..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebApplication.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.openapitools.configuration;
-
-import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class WebApplication extends AbstractAnnotationConfigDispatcherServletInitializer {
-
- @Override
- protected Class>[] getRootConfigClasses() {
- return new Class[] { OpenAPIUiConfiguration.class };
- }
-
- @Override
- protected Class>[] getServletConfigClasses() {
- return new Class>[] { WebMvcConfiguration.class };
- }
-
- @Override
- protected String[] getServletMappings() {
- return new String[] { "/" };
- }
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java
deleted file mode 100644
index 691a5378ca49..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/configuration/WebMvcConfiguration.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.openapitools.configuration;
-
-import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
-import javax.annotation.Generated;
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class WebMvcConfiguration extends WebMvcConfigurationSupport {
- @Override
- public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
- configurer.enable();
- }
-}
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
deleted file mode 100644
index ea719cc4ad89..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.HashMap;
-import java.util.Map;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * AdditionalPropertiesAnyType
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class AdditionalPropertiesAnyType extends HashMap {
-
- @JsonProperty("name")
- private String name;
-
- public AdditionalPropertiesAnyType name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
-
- @ApiModelProperty(value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o;
- return Objects.equals(this.name, additionalPropertiesAnyType.name) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesAnyType {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
deleted file mode 100644
index a4ec39252ebe..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * AdditionalPropertiesArray
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class AdditionalPropertiesArray extends HashMap {
-
- @JsonProperty("name")
- private String name;
-
- public AdditionalPropertiesArray name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
-
- @ApiModelProperty(value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o;
- return Objects.equals(this.name, additionalPropertiesArray.name) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesArray {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
deleted file mode 100644
index 47db34f7b504..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.HashMap;
-import java.util.Map;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * AdditionalPropertiesBoolean
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class AdditionalPropertiesBoolean extends HashMap {
-
- @JsonProperty("name")
- private String name;
-
- public AdditionalPropertiesBoolean name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
-
- @ApiModelProperty(value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o;
- return Objects.equals(this.name, additionalPropertiesBoolean.name) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesBoolean {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
deleted file mode 100644
index 5851aa2c2498..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
+++ /dev/null
@@ -1,400 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * AdditionalPropertiesClass
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class AdditionalPropertiesClass {
-
- @JsonProperty("map_string")
- @Valid
- private Map mapString = null;
-
- @JsonProperty("map_number")
- @Valid
- private Map mapNumber = null;
-
- @JsonProperty("map_integer")
- @Valid
- private Map mapInteger = null;
-
- @JsonProperty("map_boolean")
- @Valid
- private Map mapBoolean = null;
-
- @JsonProperty("map_array_integer")
- @Valid
- private Map> mapArrayInteger = null;
-
- @JsonProperty("map_array_anytype")
- @Valid
- private Map> mapArrayAnytype = null;
-
- @JsonProperty("map_map_string")
- @Valid
- private Map> mapMapString = null;
-
- @JsonProperty("map_map_anytype")
- @Valid
- private Map> mapMapAnytype = null;
-
- @JsonProperty("anytype_1")
- private Object anytype1;
-
- @JsonProperty("anytype_2")
- private Object anytype2;
-
- @JsonProperty("anytype_3")
- private Object anytype3;
-
- public AdditionalPropertiesClass mapString(Map mapString) {
- this.mapString = mapString;
- return this;
- }
-
- public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) {
- if (this.mapString == null) {
- this.mapString = new HashMap<>();
- }
- this.mapString.put(key, mapStringItem);
- return this;
- }
-
- /**
- * Get mapString
- * @return mapString
- */
-
- @ApiModelProperty(value = "")
- public Map getMapString() {
- return mapString;
- }
-
- public void setMapString(Map mapString) {
- this.mapString = mapString;
- }
-
- public AdditionalPropertiesClass mapNumber(Map mapNumber) {
- this.mapNumber = mapNumber;
- return this;
- }
-
- public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) {
- if (this.mapNumber == null) {
- this.mapNumber = new HashMap<>();
- }
- this.mapNumber.put(key, mapNumberItem);
- return this;
- }
-
- /**
- * Get mapNumber
- * @return mapNumber
- */
- @Valid
- @ApiModelProperty(value = "")
- public Map getMapNumber() {
- return mapNumber;
- }
-
- public void setMapNumber(Map mapNumber) {
- this.mapNumber = mapNumber;
- }
-
- public AdditionalPropertiesClass mapInteger(Map mapInteger) {
- this.mapInteger = mapInteger;
- return this;
- }
-
- public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) {
- if (this.mapInteger == null) {
- this.mapInteger = new HashMap<>();
- }
- this.mapInteger.put(key, mapIntegerItem);
- return this;
- }
-
- /**
- * Get mapInteger
- * @return mapInteger
- */
-
- @ApiModelProperty(value = "")
- public Map getMapInteger() {
- return mapInteger;
- }
-
- public void setMapInteger(Map mapInteger) {
- this.mapInteger = mapInteger;
- }
-
- public AdditionalPropertiesClass mapBoolean(Map mapBoolean) {
- this.mapBoolean = mapBoolean;
- return this;
- }
-
- public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) {
- if (this.mapBoolean == null) {
- this.mapBoolean = new HashMap<>();
- }
- this.mapBoolean.put(key, mapBooleanItem);
- return this;
- }
-
- /**
- * Get mapBoolean
- * @return mapBoolean
- */
-
- @ApiModelProperty(value = "")
- public Map getMapBoolean() {
- return mapBoolean;
- }
-
- public void setMapBoolean(Map mapBoolean) {
- this.mapBoolean = mapBoolean;
- }
-
- public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) {
- this.mapArrayInteger = mapArrayInteger;
- return this;
- }
-
- public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) {
- if (this.mapArrayInteger == null) {
- this.mapArrayInteger = new HashMap<>();
- }
- this.mapArrayInteger.put(key, mapArrayIntegerItem);
- return this;
- }
-
- /**
- * Get mapArrayInteger
- * @return mapArrayInteger
- */
- @Valid
- @ApiModelProperty(value = "")
- public Map> getMapArrayInteger() {
- return mapArrayInteger;
- }
-
- public void setMapArrayInteger(Map> mapArrayInteger) {
- this.mapArrayInteger = mapArrayInteger;
- }
-
- public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) {
- this.mapArrayAnytype = mapArrayAnytype;
- return this;
- }
-
- public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) {
- if (this.mapArrayAnytype == null) {
- this.mapArrayAnytype = new HashMap<>();
- }
- this.mapArrayAnytype.put(key, mapArrayAnytypeItem);
- return this;
- }
-
- /**
- * Get mapArrayAnytype
- * @return mapArrayAnytype
- */
- @Valid
- @ApiModelProperty(value = "")
- public Map> getMapArrayAnytype() {
- return mapArrayAnytype;
- }
-
- public void setMapArrayAnytype(Map> mapArrayAnytype) {
- this.mapArrayAnytype = mapArrayAnytype;
- }
-
- public AdditionalPropertiesClass mapMapString(Map> mapMapString) {
- this.mapMapString = mapMapString;
- return this;
- }
-
- public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) {
- if (this.mapMapString == null) {
- this.mapMapString = new HashMap<>();
- }
- this.mapMapString.put(key, mapMapStringItem);
- return this;
- }
-
- /**
- * Get mapMapString
- * @return mapMapString
- */
- @Valid
- @ApiModelProperty(value = "")
- public Map> getMapMapString() {
- return mapMapString;
- }
-
- public void setMapMapString(Map> mapMapString) {
- this.mapMapString = mapMapString;
- }
-
- public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) {
- this.mapMapAnytype = mapMapAnytype;
- return this;
- }
-
- public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) {
- if (this.mapMapAnytype == null) {
- this.mapMapAnytype = new HashMap<>();
- }
- this.mapMapAnytype.put(key, mapMapAnytypeItem);
- return this;
- }
-
- /**
- * Get mapMapAnytype
- * @return mapMapAnytype
- */
- @Valid
- @ApiModelProperty(value = "")
- public Map> getMapMapAnytype() {
- return mapMapAnytype;
- }
-
- public void setMapMapAnytype(Map> mapMapAnytype) {
- this.mapMapAnytype = mapMapAnytype;
- }
-
- public AdditionalPropertiesClass anytype1(Object anytype1) {
- this.anytype1 = anytype1;
- return this;
- }
-
- /**
- * Get anytype1
- * @return anytype1
- */
-
- @ApiModelProperty(value = "")
- public Object getAnytype1() {
- return anytype1;
- }
-
- public void setAnytype1(Object anytype1) {
- this.anytype1 = anytype1;
- }
-
- public AdditionalPropertiesClass anytype2(Object anytype2) {
- this.anytype2 = anytype2;
- return this;
- }
-
- /**
- * Get anytype2
- * @return anytype2
- */
-
- @ApiModelProperty(value = "")
- public Object getAnytype2() {
- return anytype2;
- }
-
- public void setAnytype2(Object anytype2) {
- this.anytype2 = anytype2;
- }
-
- public AdditionalPropertiesClass anytype3(Object anytype3) {
- this.anytype3 = anytype3;
- return this;
- }
-
- /**
- * Get anytype3
- * @return anytype3
- */
-
- @ApiModelProperty(value = "")
- public Object getAnytype3() {
- return anytype3;
- }
-
- public void setAnytype3(Object anytype3) {
- this.anytype3 = anytype3;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o;
- return Objects.equals(this.mapString, additionalPropertiesClass.mapString) &&
- Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) &&
- Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) &&
- Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) &&
- Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) &&
- Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) &&
- Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) &&
- Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) &&
- Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
- Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) &&
- Objects.equals(this.anytype3, additionalPropertiesClass.anytype3);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesClass {\n");
- sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n");
- sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n");
- sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n");
- sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n");
- sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n");
- sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n");
- sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n");
- sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n");
- sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n");
- sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n");
- sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
deleted file mode 100644
index bba3dce1a55e..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.HashMap;
-import java.util.Map;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * AdditionalPropertiesInteger
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class AdditionalPropertiesInteger extends HashMap {
-
- @JsonProperty("name")
- private String name;
-
- public AdditionalPropertiesInteger name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
-
- @ApiModelProperty(value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o;
- return Objects.equals(this.name, additionalPropertiesInteger.name) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesInteger {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
deleted file mode 100644
index 5f48487e05d6..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
+++ /dev/null
@@ -1,89 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-import java.util.HashMap;
-import java.util.Map;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * AdditionalPropertiesNumber
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class AdditionalPropertiesNumber extends HashMap {
-
- @JsonProperty("name")
- private String name;
-
- public AdditionalPropertiesNumber name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
-
- @ApiModelProperty(value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o;
- return Objects.equals(this.name, additionalPropertiesNumber.name) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesNumber {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
deleted file mode 100644
index 40ca1af6ab4f..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.HashMap;
-import java.util.Map;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * AdditionalPropertiesObject
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class AdditionalPropertiesObject extends HashMap {
-
- @JsonProperty("name")
- private String name;
-
- public AdditionalPropertiesObject name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
-
- @ApiModelProperty(value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o;
- return Objects.equals(this.name, additionalPropertiesObject.name) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesObject {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
deleted file mode 100644
index ddc76e27b19f..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.HashMap;
-import java.util.Map;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * AdditionalPropertiesString
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class AdditionalPropertiesString extends HashMap {
-
- @JsonProperty("name")
- private String name;
-
- public AdditionalPropertiesString name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
-
- @ApiModelProperty(value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o;
- return Objects.equals(this.name, additionalPropertiesString.name) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AdditionalPropertiesString {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java
deleted file mode 100644
index fcd78770a43d..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Animal.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonSubTypes;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Animal
- */
-
-@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "className", visible = true)
-@JsonSubTypes({
- @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"),
- @JsonSubTypes.Type(value = Cat.class, name = "Cat"),
- @JsonSubTypes.Type(value = Dog.class, name = "Dog"),
-})
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class Animal {
-
- @JsonProperty("className")
- private String className;
-
- @JsonProperty("color")
- private String color = "red";
-
- public Animal className(String className) {
- this.className = className;
- return this;
- }
-
- /**
- * Get className
- * @return className
- */
- @NotNull
- @ApiModelProperty(required = true, value = "")
- public String getClassName() {
- return className;
- }
-
- public void setClassName(String className) {
- this.className = className;
- }
-
- public Animal color(String color) {
- this.color = color;
- return this;
- }
-
- /**
- * Get color
- * @return color
- */
-
- @ApiModelProperty(value = "")
- public String getColor() {
- return color;
- }
-
- public void setColor(String color) {
- this.color = color;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Animal animal = (Animal) o;
- return Objects.equals(this.className, animal.className) &&
- Objects.equals(this.color, animal.color);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(className, color);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Animal {\n");
- sb.append(" className: ").append(toIndentedString(className)).append("\n");
- sb.append(" color: ").append(toIndentedString(color)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AnimalFarm.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AnimalFarm.java
deleted file mode 100644
index 393968173ac0..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/AnimalFarm.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.openapitools.model;
-
-import java.util.Objects;
-import java.util.ArrayList;
-import java.util.List;
-import org.openapitools.model.Animal;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-/**
- * AnimalFarm
- */
-
-public class AnimalFarm extends ArrayList {
-
- @Override
- public boolean equals(java.lang.Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- return true;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class AnimalFarm {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(java.lang.Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
deleted file mode 100644
index 3859dcfdcc05..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.List;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * ArrayOfArrayOfNumberOnly
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class ArrayOfArrayOfNumberOnly {
-
- @JsonProperty("ArrayArrayNumber")
- @Valid
- private List> arrayArrayNumber = null;
-
- public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) {
- this.arrayArrayNumber = arrayArrayNumber;
- return this;
- }
-
- public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) {
- if (this.arrayArrayNumber == null) {
- this.arrayArrayNumber = new ArrayList<>();
- }
- this.arrayArrayNumber.add(arrayArrayNumberItem);
- return this;
- }
-
- /**
- * Get arrayArrayNumber
- * @return arrayArrayNumber
- */
- @Valid
- @ApiModelProperty(value = "")
- public List> getArrayArrayNumber() {
- return arrayArrayNumber;
- }
-
- public void setArrayArrayNumber(List> arrayArrayNumber) {
- this.arrayArrayNumber = arrayArrayNumber;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o;
- return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(arrayArrayNumber);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class ArrayOfArrayOfNumberOnly {\n");
- sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
deleted file mode 100644
index a90ce117c238..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.List;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * ArrayOfNumberOnly
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class ArrayOfNumberOnly {
-
- @JsonProperty("ArrayNumber")
- @Valid
- private List arrayNumber = null;
-
- public ArrayOfNumberOnly arrayNumber(List arrayNumber) {
- this.arrayNumber = arrayNumber;
- return this;
- }
-
- public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
- if (this.arrayNumber == null) {
- this.arrayNumber = new ArrayList<>();
- }
- this.arrayNumber.add(arrayNumberItem);
- return this;
- }
-
- /**
- * Get arrayNumber
- * @return arrayNumber
- */
- @Valid
- @ApiModelProperty(value = "")
- public List getArrayNumber() {
- return arrayNumber;
- }
-
- public void setArrayNumber(List arrayNumber) {
- this.arrayNumber = arrayNumber;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o;
- return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(arrayNumber);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class ArrayOfNumberOnly {\n");
- sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java
deleted file mode 100644
index e8f37b16d5cb..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ArrayTest.java
+++ /dev/null
@@ -1,162 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.ArrayList;
-import java.util.List;
-import org.openapitools.model.ReadOnlyFirst;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * ArrayTest
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class ArrayTest {
-
- @JsonProperty("array_of_string")
- @Valid
- private List arrayOfString = null;
-
- @JsonProperty("array_array_of_integer")
- @Valid
- private List> arrayArrayOfInteger = null;
-
- @JsonProperty("array_array_of_model")
- @Valid
- private List> arrayArrayOfModel = null;
-
- public ArrayTest arrayOfString(List arrayOfString) {
- this.arrayOfString = arrayOfString;
- return this;
- }
-
- public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
- if (this.arrayOfString == null) {
- this.arrayOfString = new ArrayList<>();
- }
- this.arrayOfString.add(arrayOfStringItem);
- return this;
- }
-
- /**
- * Get arrayOfString
- * @return arrayOfString
- */
-
- @ApiModelProperty(value = "")
- public List getArrayOfString() {
- return arrayOfString;
- }
-
- public void setArrayOfString(List arrayOfString) {
- this.arrayOfString = arrayOfString;
- }
-
- public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) {
- this.arrayArrayOfInteger = arrayArrayOfInteger;
- return this;
- }
-
- public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) {
- if (this.arrayArrayOfInteger == null) {
- this.arrayArrayOfInteger = new ArrayList<>();
- }
- this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem);
- return this;
- }
-
- /**
- * Get arrayArrayOfInteger
- * @return arrayArrayOfInteger
- */
- @Valid
- @ApiModelProperty(value = "")
- public List> getArrayArrayOfInteger() {
- return arrayArrayOfInteger;
- }
-
- public void setArrayArrayOfInteger(List> arrayArrayOfInteger) {
- this.arrayArrayOfInteger = arrayArrayOfInteger;
- }
-
- public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) {
- this.arrayArrayOfModel = arrayArrayOfModel;
- return this;
- }
-
- public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) {
- if (this.arrayArrayOfModel == null) {
- this.arrayArrayOfModel = new ArrayList<>();
- }
- this.arrayArrayOfModel.add(arrayArrayOfModelItem);
- return this;
- }
-
- /**
- * Get arrayArrayOfModel
- * @return arrayArrayOfModel
- */
- @Valid
- @ApiModelProperty(value = "")
- public List> getArrayArrayOfModel() {
- return arrayArrayOfModel;
- }
-
- public void setArrayArrayOfModel(List> arrayArrayOfModel) {
- this.arrayArrayOfModel = arrayArrayOfModel;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- ArrayTest arrayTest = (ArrayTest) o;
- return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) &&
- Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) &&
- Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class ArrayTest {\n");
- sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n");
- sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n");
- sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java
deleted file mode 100644
index 68a00f5edd47..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCat.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.model.BigCatAllOf;
-import org.openapitools.model.Cat;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * BigCat
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class BigCat extends Cat {
-
- /**
- * Gets or Sets kind
- */
- public enum KindEnum {
- LIONS("lions"),
-
- TIGERS("tigers"),
-
- LEOPARDS("leopards"),
-
- JAGUARS("jaguars");
-
- private String value;
-
- KindEnum(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static KindEnum fromValue(String value) {
- for (KindEnum b : KindEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("kind")
- private KindEnum kind;
-
- public BigCat kind(KindEnum kind) {
- this.kind = kind;
- return this;
- }
-
- /**
- * Get kind
- * @return kind
- */
-
- @ApiModelProperty(value = "")
- public KindEnum getKind() {
- return kind;
- }
-
- public void setKind(KindEnum kind) {
- this.kind = kind;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- BigCat bigCat = (BigCat) o;
- return Objects.equals(this.kind, bigCat.kind) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(kind, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class BigCat {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" kind: ").append(toIndentedString(kind)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java
deleted file mode 100644
index 23fd197e0faa..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/BigCatAllOf.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * BigCatAllOf
- */
-
-@JsonTypeName("BigCat_allOf")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class BigCatAllOf {
-
- /**
- * Gets or Sets kind
- */
- public enum KindEnum {
- LIONS("lions"),
-
- TIGERS("tigers"),
-
- LEOPARDS("leopards"),
-
- JAGUARS("jaguars");
-
- private String value;
-
- KindEnum(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static KindEnum fromValue(String value) {
- for (KindEnum b : KindEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("kind")
- private KindEnum kind;
-
- public BigCatAllOf kind(KindEnum kind) {
- this.kind = kind;
- return this;
- }
-
- /**
- * Get kind
- * @return kind
- */
-
- @ApiModelProperty(value = "")
- public KindEnum getKind() {
- return kind;
- }
-
- public void setKind(KindEnum kind) {
- this.kind = kind;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- BigCatAllOf bigCatAllOf = (BigCatAllOf) o;
- return Objects.equals(this.kind, bigCatAllOf.kind);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(kind);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class BigCatAllOf {\n");
- sb.append(" kind: ").append(toIndentedString(kind)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java
deleted file mode 100644
index 37c928a79482..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Capitalization.java
+++ /dev/null
@@ -1,204 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Capitalization
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class Capitalization {
-
- @JsonProperty("smallCamel")
- private String smallCamel;
-
- @JsonProperty("CapitalCamel")
- private String capitalCamel;
-
- @JsonProperty("small_Snake")
- private String smallSnake;
-
- @JsonProperty("Capital_Snake")
- private String capitalSnake;
-
- @JsonProperty("SCA_ETH_Flow_Points")
- private String scAETHFlowPoints;
-
- @JsonProperty("ATT_NAME")
- private String ATT_NAME;
-
- public Capitalization smallCamel(String smallCamel) {
- this.smallCamel = smallCamel;
- return this;
- }
-
- /**
- * Get smallCamel
- * @return smallCamel
- */
-
- @ApiModelProperty(value = "")
- public String getSmallCamel() {
- return smallCamel;
- }
-
- public void setSmallCamel(String smallCamel) {
- this.smallCamel = smallCamel;
- }
-
- public Capitalization capitalCamel(String capitalCamel) {
- this.capitalCamel = capitalCamel;
- return this;
- }
-
- /**
- * Get capitalCamel
- * @return capitalCamel
- */
-
- @ApiModelProperty(value = "")
- public String getCapitalCamel() {
- return capitalCamel;
- }
-
- public void setCapitalCamel(String capitalCamel) {
- this.capitalCamel = capitalCamel;
- }
-
- public Capitalization smallSnake(String smallSnake) {
- this.smallSnake = smallSnake;
- return this;
- }
-
- /**
- * Get smallSnake
- * @return smallSnake
- */
-
- @ApiModelProperty(value = "")
- public String getSmallSnake() {
- return smallSnake;
- }
-
- public void setSmallSnake(String smallSnake) {
- this.smallSnake = smallSnake;
- }
-
- public Capitalization capitalSnake(String capitalSnake) {
- this.capitalSnake = capitalSnake;
- return this;
- }
-
- /**
- * Get capitalSnake
- * @return capitalSnake
- */
-
- @ApiModelProperty(value = "")
- public String getCapitalSnake() {
- return capitalSnake;
- }
-
- public void setCapitalSnake(String capitalSnake) {
- this.capitalSnake = capitalSnake;
- }
-
- public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
- this.scAETHFlowPoints = scAETHFlowPoints;
- return this;
- }
-
- /**
- * Get scAETHFlowPoints
- * @return scAETHFlowPoints
- */
-
- @ApiModelProperty(value = "")
- public String getScAETHFlowPoints() {
- return scAETHFlowPoints;
- }
-
- public void setScAETHFlowPoints(String scAETHFlowPoints) {
- this.scAETHFlowPoints = scAETHFlowPoints;
- }
-
- public Capitalization ATT_NAME(String ATT_NAME) {
- this.ATT_NAME = ATT_NAME;
- return this;
- }
-
- /**
- * Name of the pet
- * @return ATT_NAME
- */
-
- @ApiModelProperty(value = "Name of the pet ")
- public String getATTNAME() {
- return ATT_NAME;
- }
-
- public void setATTNAME(String ATT_NAME) {
- this.ATT_NAME = ATT_NAME;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Capitalization capitalization = (Capitalization) o;
- return Objects.equals(this.smallCamel, capitalization.smallCamel) &&
- Objects.equals(this.capitalCamel, capitalization.capitalCamel) &&
- Objects.equals(this.smallSnake, capitalization.smallSnake) &&
- Objects.equals(this.capitalSnake, capitalization.capitalSnake) &&
- Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) &&
- Objects.equals(this.ATT_NAME, capitalization.ATT_NAME);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Capitalization {\n");
- sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n");
- sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n");
- sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n");
- sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n");
- sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n");
- sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java
deleted file mode 100644
index 9fb7bfef1800..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Cat.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.model.Animal;
-import org.openapitools.model.CatAllOf;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Cat
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class Cat extends Animal {
-
- @JsonProperty("declawed")
- private Boolean declawed;
-
- public Cat declawed(Boolean declawed) {
- this.declawed = declawed;
- return this;
- }
-
- /**
- * Get declawed
- * @return declawed
- */
-
- @ApiModelProperty(value = "")
- public Boolean getDeclawed() {
- return declawed;
- }
-
- public void setDeclawed(Boolean declawed) {
- this.declawed = declawed;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Cat cat = (Cat) o;
- return Objects.equals(this.declawed, cat.declawed) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(declawed, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Cat {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java
deleted file mode 100644
index 7f699ced5842..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/CatAllOf.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * CatAllOf
- */
-
-@JsonTypeName("Cat_allOf")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class CatAllOf {
-
- @JsonProperty("declawed")
- private Boolean declawed;
-
- public CatAllOf declawed(Boolean declawed) {
- this.declawed = declawed;
- return this;
- }
-
- /**
- * Get declawed
- * @return declawed
- */
-
- @ApiModelProperty(value = "")
- public Boolean getDeclawed() {
- return declawed;
- }
-
- public void setDeclawed(Boolean declawed) {
- this.declawed = declawed;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- CatAllOf catAllOf = (CatAllOf) o;
- return Objects.equals(this.declawed, catAllOf.declawed);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(declawed);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class CatAllOf {\n");
- sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java
deleted file mode 100644
index 8adf35c2fa00..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Category.java
+++ /dev/null
@@ -1,108 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Category
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class Category {
-
- @JsonProperty("id")
- private Long id;
-
- @JsonProperty("name")
- private String name = "default-name";
-
- public Category id(Long id) {
- this.id = id;
- return this;
- }
-
- /**
- * Get id
- * @return id
- */
-
- @ApiModelProperty(value = "")
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public Category name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
- @NotNull
- @ApiModelProperty(required = true, value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Category category = (Category) o;
- return Objects.equals(this.id, category.id) &&
- Objects.equals(this.name, category.name);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(id, name);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Category {\n");
- sb.append(" id: ").append(toIndentedString(id)).append("\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java
deleted file mode 100644
index 72e9288b53af..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ClassModel.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Model for testing model with \"_class\" property
- */
-
-@ApiModel(description = "Model for testing model with \"_class\" property")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class ClassModel {
-
- @JsonProperty("_class")
- private String propertyClass;
-
- public ClassModel propertyClass(String propertyClass) {
- this.propertyClass = propertyClass;
- return this;
- }
-
- /**
- * Get propertyClass
- * @return propertyClass
- */
-
- @ApiModelProperty(value = "")
- public String getPropertyClass() {
- return propertyClass;
- }
-
- public void setPropertyClass(String propertyClass) {
- this.propertyClass = propertyClass;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- ClassModel classModel = (ClassModel) o;
- return Objects.equals(this.propertyClass, classModel.propertyClass);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(propertyClass);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class ClassModel {\n");
- sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java
deleted file mode 100644
index 9891fe7dafce..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Client.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Client
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class Client {
-
- @JsonProperty("client")
- private String client;
-
- public Client client(String client) {
- this.client = client;
- return this;
- }
-
- /**
- * Get client
- * @return client
- */
-
- @ApiModelProperty(value = "")
- public String getClient() {
- return client;
- }
-
- public void setClient(String client) {
- this.client = client;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Client client = (Client) o;
- return Objects.equals(this.client, client.client);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(client);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Client {\n");
- sb.append(" client: ").append(toIndentedString(client)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java
deleted file mode 100644
index 3ee8ac596893..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Dog.java
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.model.Animal;
-import org.openapitools.model.DogAllOf;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Dog
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class Dog extends Animal {
-
- @JsonProperty("breed")
- private String breed;
-
- public Dog breed(String breed) {
- this.breed = breed;
- return this;
- }
-
- /**
- * Get breed
- * @return breed
- */
-
- @ApiModelProperty(value = "")
- public String getBreed() {
- return breed;
- }
-
- public void setBreed(String breed) {
- this.breed = breed;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Dog dog = (Dog) o;
- return Objects.equals(this.breed, dog.breed) &&
- super.equals(o);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(breed, super.hashCode());
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Dog {\n");
- sb.append(" ").append(toIndentedString(super.toString())).append("\n");
- sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java
deleted file mode 100644
index c081b7517a47..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/DogAllOf.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * DogAllOf
- */
-
-@JsonTypeName("Dog_allOf")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class DogAllOf {
-
- @JsonProperty("breed")
- private String breed;
-
- public DogAllOf breed(String breed) {
- this.breed = breed;
- return this;
- }
-
- /**
- * Get breed
- * @return breed
- */
-
- @ApiModelProperty(value = "")
- public String getBreed() {
- return breed;
- }
-
- public void setBreed(String breed) {
- this.breed = breed;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- DogAllOf dogAllOf = (DogAllOf) o;
- return Objects.equals(this.breed, dogAllOf.breed);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(breed);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class DogAllOf {\n");
- sb.append(" breed: ").append(toIndentedString(breed)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java
deleted file mode 100644
index b85ad3e155ec..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumArrays.java
+++ /dev/null
@@ -1,190 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.ArrayList;
-import java.util.List;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * EnumArrays
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class EnumArrays {
-
- /**
- * Gets or Sets justSymbol
- */
- public enum JustSymbolEnum {
- GREATER_THAN_OR_EQUAL_TO(">="),
-
- DOLLAR("$");
-
- private String value;
-
- JustSymbolEnum(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static JustSymbolEnum fromValue(String value) {
- for (JustSymbolEnum b : JustSymbolEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("just_symbol")
- private JustSymbolEnum justSymbol;
-
- /**
- * Gets or Sets arrayEnum
- */
- public enum ArrayEnumEnum {
- FISH("fish"),
-
- CRAB("crab");
-
- private String value;
-
- ArrayEnumEnum(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static ArrayEnumEnum fromValue(String value) {
- for (ArrayEnumEnum b : ArrayEnumEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("array_enum")
- @Valid
- private List arrayEnum = null;
-
- public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
- this.justSymbol = justSymbol;
- return this;
- }
-
- /**
- * Get justSymbol
- * @return justSymbol
- */
-
- @ApiModelProperty(value = "")
- public JustSymbolEnum getJustSymbol() {
- return justSymbol;
- }
-
- public void setJustSymbol(JustSymbolEnum justSymbol) {
- this.justSymbol = justSymbol;
- }
-
- public EnumArrays arrayEnum(List arrayEnum) {
- this.arrayEnum = arrayEnum;
- return this;
- }
-
- public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
- if (this.arrayEnum == null) {
- this.arrayEnum = new ArrayList<>();
- }
- this.arrayEnum.add(arrayEnumItem);
- return this;
- }
-
- /**
- * Get arrayEnum
- * @return arrayEnum
- */
-
- @ApiModelProperty(value = "")
- public List getArrayEnum() {
- return arrayEnum;
- }
-
- public void setArrayEnum(List arrayEnum) {
- this.arrayEnum = arrayEnum;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- EnumArrays enumArrays = (EnumArrays) o;
- return Objects.equals(this.justSymbol, enumArrays.justSymbol) &&
- Objects.equals(this.arrayEnum, enumArrays.arrayEnum);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(justSymbol, arrayEnum);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class EnumArrays {\n");
- sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n");
- sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java
deleted file mode 100644
index c2abaaed4305..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumClass.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonValue;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-
-/**
- * Gets or Sets EnumClass
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public enum EnumClass {
-
- _ABC("_abc"),
-
- _EFG("-efg"),
-
- _XYZ_("(xyz)");
-
- private String value;
-
- EnumClass(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static EnumClass fromValue(String value) {
- for (EnumClass b : EnumClass.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java
deleted file mode 100644
index ba5b8c323a9a..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/EnumTest.java
+++ /dev/null
@@ -1,328 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.model.OuterEnum;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * EnumTest
- */
-
-@JsonTypeName("Enum_Test")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class EnumTest {
-
- /**
- * Gets or Sets enumString
- */
- public enum EnumStringEnum {
- UPPER("UPPER"),
-
- LOWER("lower"),
-
- EMPTY("");
-
- private String value;
-
- EnumStringEnum(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static EnumStringEnum fromValue(String value) {
- for (EnumStringEnum b : EnumStringEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("enum_string")
- private EnumStringEnum enumString;
-
- /**
- * Gets or Sets enumStringRequired
- */
- public enum EnumStringRequiredEnum {
- UPPER("UPPER"),
-
- LOWER("lower"),
-
- EMPTY("");
-
- private String value;
-
- EnumStringRequiredEnum(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static EnumStringRequiredEnum fromValue(String value) {
- for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("enum_string_required")
- private EnumStringRequiredEnum enumStringRequired;
-
- /**
- * Gets or Sets enumInteger
- */
- public enum EnumIntegerEnum {
- NUMBER_1(1),
-
- NUMBER_MINUS_1(-1);
-
- private Integer value;
-
- EnumIntegerEnum(Integer value) {
- this.value = value;
- }
-
- @JsonValue
- public Integer getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static EnumIntegerEnum fromValue(Integer value) {
- for (EnumIntegerEnum b : EnumIntegerEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("enum_integer")
- private EnumIntegerEnum enumInteger;
-
- /**
- * Gets or Sets enumNumber
- */
- public enum EnumNumberEnum {
- NUMBER_1_DOT_1(1.1),
-
- NUMBER_MINUS_1_DOT_2(-1.2);
-
- private Double value;
-
- EnumNumberEnum(Double value) {
- this.value = value;
- }
-
- @JsonValue
- public Double getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static EnumNumberEnum fromValue(Double value) {
- for (EnumNumberEnum b : EnumNumberEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("enum_number")
- private EnumNumberEnum enumNumber;
-
- @JsonProperty("outerEnum")
- private OuterEnum outerEnum;
-
- public EnumTest enumString(EnumStringEnum enumString) {
- this.enumString = enumString;
- return this;
- }
-
- /**
- * Get enumString
- * @return enumString
- */
-
- @ApiModelProperty(value = "")
- public EnumStringEnum getEnumString() {
- return enumString;
- }
-
- public void setEnumString(EnumStringEnum enumString) {
- this.enumString = enumString;
- }
-
- public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
- this.enumStringRequired = enumStringRequired;
- return this;
- }
-
- /**
- * Get enumStringRequired
- * @return enumStringRequired
- */
- @NotNull
- @ApiModelProperty(required = true, value = "")
- public EnumStringRequiredEnum getEnumStringRequired() {
- return enumStringRequired;
- }
-
- public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) {
- this.enumStringRequired = enumStringRequired;
- }
-
- public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
- this.enumInteger = enumInteger;
- return this;
- }
-
- /**
- * Get enumInteger
- * @return enumInteger
- */
-
- @ApiModelProperty(value = "")
- public EnumIntegerEnum getEnumInteger() {
- return enumInteger;
- }
-
- public void setEnumInteger(EnumIntegerEnum enumInteger) {
- this.enumInteger = enumInteger;
- }
-
- public EnumTest enumNumber(EnumNumberEnum enumNumber) {
- this.enumNumber = enumNumber;
- return this;
- }
-
- /**
- * Get enumNumber
- * @return enumNumber
- */
-
- @ApiModelProperty(value = "")
- public EnumNumberEnum getEnumNumber() {
- return enumNumber;
- }
-
- public void setEnumNumber(EnumNumberEnum enumNumber) {
- this.enumNumber = enumNumber;
- }
-
- public EnumTest outerEnum(OuterEnum outerEnum) {
- this.outerEnum = outerEnum;
- return this;
- }
-
- /**
- * Get outerEnum
- * @return outerEnum
- */
- @Valid
- @ApiModelProperty(value = "")
- public OuterEnum getOuterEnum() {
- return outerEnum;
- }
-
- public void setOuterEnum(OuterEnum outerEnum) {
- this.outerEnum = outerEnum;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- EnumTest enumTest = (EnumTest) o;
- return Objects.equals(this.enumString, enumTest.enumString) &&
- Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) &&
- Objects.equals(this.enumInteger, enumTest.enumInteger) &&
- Objects.equals(this.enumNumber, enumTest.enumNumber) &&
- Objects.equals(this.outerEnum, enumTest.outerEnum);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class EnumTest {\n");
- sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n");
- sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n");
- sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n");
- sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n");
- sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java
deleted file mode 100644
index 685394664974..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/File.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Must be named `File` for test.
- */
-
-@ApiModel(description = "Must be named `File` for test.")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class File {
-
- @JsonProperty("sourceURI")
- private String sourceURI;
-
- public File sourceURI(String sourceURI) {
- this.sourceURI = sourceURI;
- return this;
- }
-
- /**
- * Test capitalization
- * @return sourceURI
- */
-
- @ApiModelProperty(value = "Test capitalization")
- public String getSourceURI() {
- return sourceURI;
- }
-
- public void setSourceURI(String sourceURI) {
- this.sourceURI = sourceURI;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- File file = (File) o;
- return Objects.equals(this.sourceURI, file.sourceURI);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(sourceURI);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class File {\n");
- sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java
deleted file mode 100644
index 01149ce8f6ae..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FileSchemaTestClass.java
+++ /dev/null
@@ -1,120 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * FileSchemaTestClass
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class FileSchemaTestClass {
-
- @JsonProperty("file")
- private File file;
-
- @JsonProperty("files")
- @Valid
- private List files = null;
-
- public FileSchemaTestClass file(File file) {
- this.file = file;
- return this;
- }
-
- /**
- * Get file
- * @return file
- */
- @Valid
- @ApiModelProperty(value = "")
- public File getFile() {
- return file;
- }
-
- public void setFile(File file) {
- this.file = file;
- }
-
- public FileSchemaTestClass files(List files) {
- this.files = files;
- return this;
- }
-
- public FileSchemaTestClass addFilesItem(File filesItem) {
- if (this.files == null) {
- this.files = new ArrayList<>();
- }
- this.files.add(filesItem);
- return this;
- }
-
- /**
- * Get files
- * @return files
- */
- @Valid
- @ApiModelProperty(value = "")
- public List getFiles() {
- return files;
- }
-
- public void setFiles(List files) {
- this.files = files;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o;
- return Objects.equals(this.file, fileSchemaTestClass.file) &&
- Objects.equals(this.files, fileSchemaTestClass.files);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(file, files);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class FileSchemaTestClass {\n");
- sb.append(" file: ").append(toIndentedString(file)).append("\n");
- sb.append(" files: ").append(toIndentedString(files)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java
deleted file mode 100644
index 153641cacd56..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java
+++ /dev/null
@@ -1,416 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-import java.time.LocalDate;
-import java.time.OffsetDateTime;
-import java.util.Arrays;
-import java.util.UUID;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * FormatTest
- */
-
-@JsonTypeName("format_test")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class FormatTest {
-
- @JsonProperty("integer")
- private Integer integer;
-
- @JsonProperty("int32")
- private Integer int32;
-
- @JsonProperty("int64")
- private Long int64;
-
- @JsonProperty("number")
- private BigDecimal number;
-
- @JsonProperty("float")
- private Float _float;
-
- @JsonProperty("double")
- private Double _double;
-
- @JsonProperty("string")
- private String string;
-
- @JsonProperty("byte")
- private byte[] _byte;
-
- @JsonProperty("binary")
- private org.springframework.core.io.Resource binary;
-
- @JsonProperty("date")
- @DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
- private LocalDate date;
-
- @JsonProperty("dateTime")
- @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
- private OffsetDateTime dateTime;
-
- @JsonProperty("uuid")
- private UUID uuid;
-
- @JsonProperty("password")
- private String password;
-
- @JsonProperty("BigDecimal")
- private BigDecimal bigDecimal;
-
- public FormatTest integer(Integer integer) {
- this.integer = integer;
- return this;
- }
-
- /**
- * Get integer
- * minimum: 10
- * maximum: 100
- * @return integer
- */
- @Min(10) @Max(100)
- @ApiModelProperty(value = "")
- public Integer getInteger() {
- return integer;
- }
-
- public void setInteger(Integer integer) {
- this.integer = integer;
- }
-
- public FormatTest int32(Integer int32) {
- this.int32 = int32;
- return this;
- }
-
- /**
- * Get int32
- * minimum: 20
- * maximum: 200
- * @return int32
- */
- @Min(20) @Max(200)
- @ApiModelProperty(value = "")
- public Integer getInt32() {
- return int32;
- }
-
- public void setInt32(Integer int32) {
- this.int32 = int32;
- }
-
- public FormatTest int64(Long int64) {
- this.int64 = int64;
- return this;
- }
-
- /**
- * Get int64
- * @return int64
- */
-
- @ApiModelProperty(value = "")
- public Long getInt64() {
- return int64;
- }
-
- public void setInt64(Long int64) {
- this.int64 = int64;
- }
-
- public FormatTest number(BigDecimal number) {
- this.number = number;
- return this;
- }
-
- /**
- * Get number
- * minimum: 32.1
- * maximum: 543.2
- * @return number
- */
- @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2")
- @ApiModelProperty(required = true, value = "")
- public BigDecimal getNumber() {
- return number;
- }
-
- public void setNumber(BigDecimal number) {
- this.number = number;
- }
-
- public FormatTest _float(Float _float) {
- this._float = _float;
- return this;
- }
-
- /**
- * Get _float
- * minimum: 54.3
- * maximum: 987.6
- * @return _float
- */
- @DecimalMin("54.3") @DecimalMax("987.6")
- @ApiModelProperty(value = "")
- public Float getFloat() {
- return _float;
- }
-
- public void setFloat(Float _float) {
- this._float = _float;
- }
-
- public FormatTest _double(Double _double) {
- this._double = _double;
- return this;
- }
-
- /**
- * Get _double
- * minimum: 67.8
- * maximum: 123.4
- * @return _double
- */
- @DecimalMin("67.8") @DecimalMax("123.4")
- @ApiModelProperty(value = "")
- public Double getDouble() {
- return _double;
- }
-
- public void setDouble(Double _double) {
- this._double = _double;
- }
-
- public FormatTest string(String string) {
- this.string = string;
- return this;
- }
-
- /**
- * Get string
- * @return string
- */
- @Pattern(regexp = "/[a-z]/i")
- @ApiModelProperty(value = "")
- public String getString() {
- return string;
- }
-
- public void setString(String string) {
- this.string = string;
- }
-
- public FormatTest _byte(byte[] _byte) {
- this._byte = _byte;
- return this;
- }
-
- /**
- * Get _byte
- * @return _byte
- */
- @NotNull
- @ApiModelProperty(required = true, value = "")
- public byte[] getByte() {
- return _byte;
- }
-
- public void setByte(byte[] _byte) {
- this._byte = _byte;
- }
-
- public FormatTest binary(org.springframework.core.io.Resource binary) {
- this.binary = binary;
- return this;
- }
-
- /**
- * Get binary
- * @return binary
- */
- @Valid
- @ApiModelProperty(value = "")
- public org.springframework.core.io.Resource getBinary() {
- return binary;
- }
-
- public void setBinary(org.springframework.core.io.Resource binary) {
- this.binary = binary;
- }
-
- public FormatTest date(LocalDate date) {
- this.date = date;
- return this;
- }
-
- /**
- * Get date
- * @return date
- */
- @NotNull @Valid
- @ApiModelProperty(required = true, value = "")
- public LocalDate getDate() {
- return date;
- }
-
- public void setDate(LocalDate date) {
- this.date = date;
- }
-
- public FormatTest dateTime(OffsetDateTime dateTime) {
- this.dateTime = dateTime;
- return this;
- }
-
- /**
- * Get dateTime
- * @return dateTime
- */
- @Valid
- @ApiModelProperty(value = "")
- public OffsetDateTime getDateTime() {
- return dateTime;
- }
-
- public void setDateTime(OffsetDateTime dateTime) {
- this.dateTime = dateTime;
- }
-
- public FormatTest uuid(UUID uuid) {
- this.uuid = uuid;
- return this;
- }
-
- /**
- * Get uuid
- * @return uuid
- */
- @Valid
- @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "")
- public UUID getUuid() {
- return uuid;
- }
-
- public void setUuid(UUID uuid) {
- this.uuid = uuid;
- }
-
- public FormatTest password(String password) {
- this.password = password;
- return this;
- }
-
- /**
- * Get password
- * @return password
- */
- @NotNull @Size(min = 10, max = 64)
- @ApiModelProperty(required = true, value = "")
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public FormatTest bigDecimal(BigDecimal bigDecimal) {
- this.bigDecimal = bigDecimal;
- return this;
- }
-
- /**
- * Get bigDecimal
- * @return bigDecimal
- */
- @Valid
- @ApiModelProperty(value = "")
- public BigDecimal getBigDecimal() {
- return bigDecimal;
- }
-
- public void setBigDecimal(BigDecimal bigDecimal) {
- this.bigDecimal = bigDecimal;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- FormatTest formatTest = (FormatTest) o;
- return Objects.equals(this.integer, formatTest.integer) &&
- Objects.equals(this.int32, formatTest.int32) &&
- Objects.equals(this.int64, formatTest.int64) &&
- Objects.equals(this.number, formatTest.number) &&
- Objects.equals(this._float, formatTest._float) &&
- Objects.equals(this._double, formatTest._double) &&
- Objects.equals(this.string, formatTest.string) &&
- Arrays.equals(this._byte, formatTest._byte) &&
- Objects.equals(this.binary, formatTest.binary) &&
- Objects.equals(this.date, formatTest.date) &&
- Objects.equals(this.dateTime, formatTest.dateTime) &&
- Objects.equals(this.uuid, formatTest.uuid) &&
- Objects.equals(this.password, formatTest.password) &&
- Objects.equals(this.bigDecimal, formatTest.bigDecimal);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class FormatTest {\n");
- sb.append(" integer: ").append(toIndentedString(integer)).append("\n");
- sb.append(" int32: ").append(toIndentedString(int32)).append("\n");
- sb.append(" int64: ").append(toIndentedString(int64)).append("\n");
- sb.append(" number: ").append(toIndentedString(number)).append("\n");
- sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
- sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
- sb.append(" string: ").append(toIndentedString(string)).append("\n");
- sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
- sb.append(" binary: ").append(toIndentedString(binary)).append("\n");
- sb.append(" date: ").append(toIndentedString(date)).append("\n");
- sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
- sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
- sb.append(" password: ").append(toIndentedString(password)).append("\n");
- sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
deleted file mode 100644
index d235c68a51ff..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * HasOnlyReadOnly
- */
-
-@JsonTypeName("hasOnlyReadOnly")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class HasOnlyReadOnly {
-
- @JsonProperty("bar")
- private String bar;
-
- @JsonProperty("foo")
- private String foo;
-
- public HasOnlyReadOnly bar(String bar) {
- this.bar = bar;
- return this;
- }
-
- /**
- * Get bar
- * @return bar
- */
-
- @ApiModelProperty(readOnly = true, value = "")
- public String getBar() {
- return bar;
- }
-
- public void setBar(String bar) {
- this.bar = bar;
- }
-
- public HasOnlyReadOnly foo(String foo) {
- this.foo = foo;
- return this;
- }
-
- /**
- * Get foo
- * @return foo
- */
-
- @ApiModelProperty(readOnly = true, value = "")
- public String getFoo() {
- return foo;
- }
-
- public void setFoo(String foo) {
- this.foo = foo;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o;
- return Objects.equals(this.bar, hasOnlyReadOnly.bar) &&
- Objects.equals(this.foo, hasOnlyReadOnly.foo);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(bar, foo);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class HasOnlyReadOnly {\n");
- sb.append(" bar: ").append(toIndentedString(bar)).append("\n");
- sb.append(" foo: ").append(toIndentedString(foo)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java
deleted file mode 100644
index 27e3cea8e6ed..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MapTest.java
+++ /dev/null
@@ -1,231 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * MapTest
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class MapTest {
-
- @JsonProperty("map_map_of_string")
- @Valid
- private Map> mapMapOfString = null;
-
- /**
- * Gets or Sets inner
- */
- public enum InnerEnum {
- UPPER("UPPER"),
-
- LOWER("lower");
-
- private String value;
-
- InnerEnum(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static InnerEnum fromValue(String value) {
- for (InnerEnum b : InnerEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("map_of_enum_string")
- @Valid
- private Map mapOfEnumString = null;
-
- @JsonProperty("direct_map")
- @Valid
- private Map directMap = null;
-
- @JsonProperty("indirect_map")
- @Valid
- private Map indirectMap = null;
-
- public MapTest mapMapOfString(Map> mapMapOfString) {
- this.mapMapOfString = mapMapOfString;
- return this;
- }
-
- public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) {
- if (this.mapMapOfString == null) {
- this.mapMapOfString = new HashMap<>();
- }
- this.mapMapOfString.put(key, mapMapOfStringItem);
- return this;
- }
-
- /**
- * Get mapMapOfString
- * @return mapMapOfString
- */
- @Valid
- @ApiModelProperty(value = "")
- public Map> getMapMapOfString() {
- return mapMapOfString;
- }
-
- public void setMapMapOfString(Map> mapMapOfString) {
- this.mapMapOfString = mapMapOfString;
- }
-
- public MapTest mapOfEnumString(Map mapOfEnumString) {
- this.mapOfEnumString = mapOfEnumString;
- return this;
- }
-
- public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) {
- if (this.mapOfEnumString == null) {
- this.mapOfEnumString = new HashMap<>();
- }
- this.mapOfEnumString.put(key, mapOfEnumStringItem);
- return this;
- }
-
- /**
- * Get mapOfEnumString
- * @return mapOfEnumString
- */
-
- @ApiModelProperty(value = "")
- public Map getMapOfEnumString() {
- return mapOfEnumString;
- }
-
- public void setMapOfEnumString(Map mapOfEnumString) {
- this.mapOfEnumString = mapOfEnumString;
- }
-
- public MapTest directMap(Map directMap) {
- this.directMap = directMap;
- return this;
- }
-
- public MapTest putDirectMapItem(String key, Boolean directMapItem) {
- if (this.directMap == null) {
- this.directMap = new HashMap<>();
- }
- this.directMap.put(key, directMapItem);
- return this;
- }
-
- /**
- * Get directMap
- * @return directMap
- */
-
- @ApiModelProperty(value = "")
- public Map getDirectMap() {
- return directMap;
- }
-
- public void setDirectMap(Map directMap) {
- this.directMap = directMap;
- }
-
- public MapTest indirectMap(Map indirectMap) {
- this.indirectMap = indirectMap;
- return this;
- }
-
- public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) {
- if (this.indirectMap == null) {
- this.indirectMap = new HashMap<>();
- }
- this.indirectMap.put(key, indirectMapItem);
- return this;
- }
-
- /**
- * Get indirectMap
- * @return indirectMap
- */
-
- @ApiModelProperty(value = "")
- public Map getIndirectMap() {
- return indirectMap;
- }
-
- public void setIndirectMap(Map indirectMap) {
- this.indirectMap = indirectMap;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- MapTest mapTest = (MapTest) o;
- return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) &&
- Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) &&
- Objects.equals(this.directMap, mapTest.directMap) &&
- Objects.equals(this.indirectMap, mapTest.indirectMap);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class MapTest {\n");
- sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n");
- sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n");
- sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n");
- sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
deleted file mode 100644
index e490e2a61ef7..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
+++ /dev/null
@@ -1,149 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.time.OffsetDateTime;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import org.openapitools.model.Animal;
-import org.springframework.format.annotation.DateTimeFormat;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * MixedPropertiesAndAdditionalPropertiesClass
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class MixedPropertiesAndAdditionalPropertiesClass {
-
- @JsonProperty("uuid")
- private UUID uuid;
-
- @JsonProperty("dateTime")
- @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
- private OffsetDateTime dateTime;
-
- @JsonProperty("map")
- @Valid
- private Map map = null;
-
- public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
- this.uuid = uuid;
- return this;
- }
-
- /**
- * Get uuid
- * @return uuid
- */
- @Valid
- @ApiModelProperty(value = "")
- public UUID getUuid() {
- return uuid;
- }
-
- public void setUuid(UUID uuid) {
- this.uuid = uuid;
- }
-
- public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) {
- this.dateTime = dateTime;
- return this;
- }
-
- /**
- * Get dateTime
- * @return dateTime
- */
- @Valid
- @ApiModelProperty(value = "")
- public OffsetDateTime getDateTime() {
- return dateTime;
- }
-
- public void setDateTime(OffsetDateTime dateTime) {
- this.dateTime = dateTime;
- }
-
- public MixedPropertiesAndAdditionalPropertiesClass map(Map map) {
- this.map = map;
- return this;
- }
-
- public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) {
- if (this.map == null) {
- this.map = new HashMap<>();
- }
- this.map.put(key, mapItem);
- return this;
- }
-
- /**
- * Get map
- * @return map
- */
- @Valid
- @ApiModelProperty(value = "")
- public Map getMap() {
- return map;
- }
-
- public void setMap(Map map) {
- this.map = map;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o;
- return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) &&
- Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) &&
- Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(uuid, dateTime, map);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n");
- sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n");
- sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n");
- sb.append(" map: ").append(toIndentedString(map)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java
deleted file mode 100644
index 56b222f4e45b..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Model200Response.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Model for testing model name starting with number
- */
-
-@ApiModel(description = "Model for testing model name starting with number")
-@JsonTypeName("200_response")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class Model200Response {
-
- @JsonProperty("name")
- private Integer name;
-
- @JsonProperty("class")
- private String propertyClass;
-
- public Model200Response name(Integer name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
-
- @ApiModelProperty(value = "")
- public Integer getName() {
- return name;
- }
-
- public void setName(Integer name) {
- this.name = name;
- }
-
- public Model200Response propertyClass(String propertyClass) {
- this.propertyClass = propertyClass;
- return this;
- }
-
- /**
- * Get propertyClass
- * @return propertyClass
- */
-
- @ApiModelProperty(value = "")
- public String getPropertyClass() {
- return propertyClass;
- }
-
- public void setPropertyClass(String propertyClass) {
- this.propertyClass = propertyClass;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Model200Response _200response = (Model200Response) o;
- return Objects.equals(this.name, _200response.name) &&
- Objects.equals(this.propertyClass, _200response.propertyClass);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name, propertyClass);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Model200Response {\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelFile.java
deleted file mode 100644
index d61b764d4be1..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelFile.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-
-/**
- * Must be named `File` for test.
- */
-@ApiModel(description = "Must be named `File` for test.")
-@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class ModelFile {
- @JsonProperty("sourceURI")
- private String sourceURI;
-
- public ModelFile sourceURI(String sourceURI) {
- this.sourceURI = sourceURI;
- return this;
- }
-
- /**
- * Test capitalization
- * @return sourceURI
- */
- @ApiModelProperty(value = "Test capitalization")
-
-
- public String getSourceURI() {
- return sourceURI;
- }
-
- public void setSourceURI(String sourceURI) {
- this.sourceURI = sourceURI;
- }
-
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- ModelFile _file = (ModelFile) o;
- return Objects.equals(this.sourceURI, _file.sourceURI);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(sourceURI);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class ModelFile {\n");
-
- sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java
deleted file mode 100644
index 7800a7d698f7..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelList.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * ModelList
- */
-
-@JsonTypeName("List")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class ModelList {
-
- @JsonProperty("123-list")
- private String _123list;
-
- public ModelList _123list(String _123list) {
- this._123list = _123list;
- return this;
- }
-
- /**
- * Get _123list
- * @return _123list
- */
-
- @ApiModelProperty(value = "")
- public String get123list() {
- return _123list;
- }
-
- public void set123list(String _123list) {
- this._123list = _123list;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- ModelList _list = (ModelList) o;
- return Objects.equals(this._123list, _list._123list);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(_123list);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class ModelList {\n");
- sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java
deleted file mode 100644
index a933badc4910..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/ModelReturn.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonTypeName;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Model for testing reserved words
- */
-
-@ApiModel(description = "Model for testing reserved words")
-@JsonTypeName("Return")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class ModelReturn {
-
- @JsonProperty("return")
- private Integer _return;
-
- public ModelReturn _return(Integer _return) {
- this._return = _return;
- return this;
- }
-
- /**
- * Get _return
- * @return _return
- */
-
- @ApiModelProperty(value = "")
- public Integer getReturn() {
- return _return;
- }
-
- public void setReturn(Integer _return) {
- this._return = _return;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- ModelReturn _return = (ModelReturn) o;
- return Objects.equals(this._return, _return._return);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(_return);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class ModelReturn {\n");
- sb.append(" _return: ").append(toIndentedString(_return)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java
deleted file mode 100644
index febe2115a665..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Name.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Model for testing model name same as property name
- */
-
-@ApiModel(description = "Model for testing model name same as property name")
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class Name {
-
- @JsonProperty("name")
- private Integer name;
-
- @JsonProperty("snake_case")
- private Integer snakeCase;
-
- @JsonProperty("property")
- private String property;
-
- @JsonProperty("123Number")
- private Integer _123number;
-
- public Name name(Integer name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
- @NotNull
- @ApiModelProperty(required = true, value = "")
- public Integer getName() {
- return name;
- }
-
- public void setName(Integer name) {
- this.name = name;
- }
-
- public Name snakeCase(Integer snakeCase) {
- this.snakeCase = snakeCase;
- return this;
- }
-
- /**
- * Get snakeCase
- * @return snakeCase
- */
-
- @ApiModelProperty(readOnly = true, value = "")
- public Integer getSnakeCase() {
- return snakeCase;
- }
-
- public void setSnakeCase(Integer snakeCase) {
- this.snakeCase = snakeCase;
- }
-
- public Name property(String property) {
- this.property = property;
- return this;
- }
-
- /**
- * Get property
- * @return property
- */
-
- @ApiModelProperty(value = "")
- public String getProperty() {
- return property;
- }
-
- public void setProperty(String property) {
- this.property = property;
- }
-
- public Name _123number(Integer _123number) {
- this._123number = _123number;
- return this;
- }
-
- /**
- * Get _123number
- * @return _123number
- */
-
- @ApiModelProperty(readOnly = true, value = "")
- public Integer get123number() {
- return _123number;
- }
-
- public void set123number(Integer _123number) {
- this._123number = _123number;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Name name = (Name) o;
- return Objects.equals(this.name, name.name) &&
- Objects.equals(this.snakeCase, name.snakeCase) &&
- Objects.equals(this.property, name.property) &&
- Objects.equals(this._123number, name._123number);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name, snakeCase, property, _123number);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class Name {\n");
- sb.append(" name: ").append(toIndentedString(name)).append("\n");
- sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n");
- sb.append(" property: ").append(toIndentedString(property)).append("\n");
- sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java
deleted file mode 100644
index dcf5c5e801a6..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/NumberOnly.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * NumberOnly
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class NumberOnly {
-
- @JsonProperty("JustNumber")
- private BigDecimal justNumber;
-
- public NumberOnly justNumber(BigDecimal justNumber) {
- this.justNumber = justNumber;
- return this;
- }
-
- /**
- * Get justNumber
- * @return justNumber
- */
- @Valid
- @ApiModelProperty(value = "")
- public BigDecimal getJustNumber() {
- return justNumber;
- }
-
- public void setJustNumber(BigDecimal justNumber) {
- this.justNumber = justNumber;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- NumberOnly numberOnly = (NumberOnly) o;
- return Objects.equals(this.justNumber, numberOnly.justNumber);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(justNumber);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class NumberOnly {\n");
- sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java
deleted file mode 100644
index eca5e7cd4fa5..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterComposite.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.math.BigDecimal;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * OuterComposite
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class OuterComposite {
-
- @JsonProperty("my_number")
- private BigDecimal myNumber;
-
- @JsonProperty("my_string")
- private String myString;
-
- @JsonProperty("my_boolean")
- private Boolean myBoolean;
-
- public OuterComposite myNumber(BigDecimal myNumber) {
- this.myNumber = myNumber;
- return this;
- }
-
- /**
- * Get myNumber
- * @return myNumber
- */
- @Valid
- @ApiModelProperty(value = "")
- public BigDecimal getMyNumber() {
- return myNumber;
- }
-
- public void setMyNumber(BigDecimal myNumber) {
- this.myNumber = myNumber;
- }
-
- public OuterComposite myString(String myString) {
- this.myString = myString;
- return this;
- }
-
- /**
- * Get myString
- * @return myString
- */
-
- @ApiModelProperty(value = "")
- public String getMyString() {
- return myString;
- }
-
- public void setMyString(String myString) {
- this.myString = myString;
- }
-
- public OuterComposite myBoolean(Boolean myBoolean) {
- this.myBoolean = myBoolean;
- return this;
- }
-
- /**
- * Get myBoolean
- * @return myBoolean
- */
-
- @ApiModelProperty(value = "")
- public Boolean getMyBoolean() {
- return myBoolean;
- }
-
- public void setMyBoolean(Boolean myBoolean) {
- this.myBoolean = myBoolean;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- OuterComposite outerComposite = (OuterComposite) o;
- return Objects.equals(this.myNumber, outerComposite.myNumber) &&
- Objects.equals(this.myString, outerComposite.myString) &&
- Objects.equals(this.myBoolean, outerComposite.myBoolean);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(myNumber, myString, myBoolean);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("class OuterComposite {\n");
- sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n");
- sb.append(" myString: ").append(toIndentedString(myString)).append("\n");
- sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n");
- sb.append("}");
- return sb.toString();
- }
-
- /**
- * Convert the given object to string with each line indented by 4 spaces
- * (except the first line).
- */
- private String toIndentedString(Object o) {
- if (o == null) {
- return "null";
- }
- return o.toString().replace("\n", "\n ");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java
deleted file mode 100644
index 1f09d0a5d17a..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/OuterEnum.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonValue;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-
-/**
- * Gets or Sets OuterEnum
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public enum OuterEnum {
-
- PLACED("placed"),
-
- APPROVED("approved"),
-
- DELIVERED("delivered");
-
- private String value;
-
- OuterEnum(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static OuterEnum fromValue(String value) {
- for (OuterEnum b : OuterEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
-}
-
diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java
deleted file mode 100644
index 9f17ad305dae..000000000000
--- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/Pet.java
+++ /dev/null
@@ -1,265 +0,0 @@
-package org.openapitools.model;
-
-import java.net.URI;
-import java.util.Objects;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import com.fasterxml.jackson.annotation.JsonValue;
-import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import java.util.ArrayList;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import org.openapitools.model.Category;
-import org.openapitools.model.Tag;
-import org.openapitools.jackson.nullable.JsonNullable;
-import java.time.OffsetDateTime;
-import javax.validation.Valid;
-import javax.validation.constraints.*;
-
-
-import java.util.*;
-import javax.annotation.Generated;
-
-/**
- * Pet
- */
-
-@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
-public class Pet {
-
- @JsonProperty("id")
- private Long id;
-
- @JsonProperty("category")
- private Category category;
-
- @JsonProperty("name")
- private String name;
-
- @JsonProperty("photoUrls")
- @Valid
- private Set photoUrls = new LinkedHashSet<>();
-
- @JsonProperty("tags")
- @Valid
- private List tags = null;
-
- /**
- * pet status in the store
- */
- public enum StatusEnum {
- AVAILABLE("available"),
-
- PENDING("pending"),
-
- SOLD("sold");
-
- private String value;
-
- StatusEnum(String value) {
- this.value = value;
- }
-
- @JsonValue
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return String.valueOf(value);
- }
-
- @JsonCreator
- public static StatusEnum fromValue(String value) {
- for (StatusEnum b : StatusEnum.values()) {
- if (b.value.equals(value)) {
- return b;
- }
- }
- throw new IllegalArgumentException("Unexpected value '" + value + "'");
- }
- }
-
- @JsonProperty("status")
- private StatusEnum status;
-
- public Pet id(Long id) {
- this.id = id;
- return this;
- }
-
- /**
- * Get id
- * @return id
- */
-
- @ApiModelProperty(value = "")
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public Pet category(Category category) {
- this.category = category;
- return this;
- }
-
- /**
- * Get category
- * @return category
- */
- @Valid
- @ApiModelProperty(value = "")
- public Category getCategory() {
- return category;
- }
-
- public void setCategory(Category category) {
- this.category = category;
- }
-
- public Pet name(String name) {
- this.name = name;
- return this;
- }
-
- /**
- * Get name
- * @return name
- */
- @NotNull
- @ApiModelProperty(example = "doggie", required = true, value = "")
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Pet photoUrls(Set photoUrls) {
- this.photoUrls = photoUrls;
- return this;
- }
-
- public Pet addPhotoUrlsItem(String photoUrlsItem) {
- this.photoUrls.add(photoUrlsItem);
- return this;
- }
-
- /**
- * Get photoUrls
- * @return photoUrls
- */
- @NotNull
- @ApiModelProperty(required = true, value = "")
- public Set getPhotoUrls() {
- return photoUrls;
- }
-
- @JsonDeserialize(as = LinkedHashSet.class)
- public void setPhotoUrls(Set photoUrls) {
- this.photoUrls = photoUrls;
- }
-
- public Pet tags(List