diff --git a/bin/spring-all-pestore.sh b/bin/spring-all-pestore.sh
index ca760a5f7a5..e3060626f7b 100755
--- a/bin/spring-all-pestore.sh
+++ b/bin/spring-all-pestore.sh
@@ -17,3 +17,4 @@
./bin/springboot-petstore-server-beanvalidation.sh
./bin/springboot-petstore-server-implicitHeaders.sh
./bin/springboot-petstore-server-useOptional.sh
+./bin/springboot-virtualan-petstore-server.sh
\ No newline at end of file
diff --git a/bin/springboot-virtualan-petstore-server.json b/bin/springboot-virtualan-petstore-server.json
new file mode 100644
index 00000000000..d02799fde62
--- /dev/null
+++ b/bin/springboot-virtualan-petstore-server.json
@@ -0,0 +1,7 @@
+{
+ "artifactId": "springboot-virtualan",
+ "library": "spring-boot",
+ "virtualService": true,
+ "modelPackage" : "org.openapitools.virtualan.model",
+ "apiPackage" : "org.openapitools.virtualan.api"
+}
diff --git a/bin/springboot-virtualan-petstore-server.sh b/bin/springboot-virtualan-petstore-server.sh
new file mode 100644
index 00000000000..fa7c100379f
--- /dev/null
+++ b/bin/springboot-virtualan-petstore-server.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+SCRIPT="$0"
+echo "# START SCRIPT: $SCRIPT"
+
+while [ -h "$SCRIPT" ] ; do
+ ls=`ls -ld "$SCRIPT"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ SCRIPT="$link"
+ else
+ SCRIPT=`dirname "$SCRIPT"`/"$link"
+ fi
+done
+
+if [ ! -d "${APP_DIR}" ]; then
+ APP_DIR=`dirname "$SCRIPT"`/..
+ APP_DIR=`cd "${APP_DIR}"; pwd`
+fi
+
+executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
+
+if [ ! -f "$executable" ]
+then
+ mvn -B clean package
+fi
+
+# if you've executed sbt assembly previously it will use that instead.
+export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
+ags="generate --artifact-id springboot-virtualan -t modules/openapi-generator/src/main/resources/JavaSpring -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g spring -o samples/server/petstore/springboot-virtualan -c bin/springboot-virtualan-petstore-server.json -DhideGenerationTimestamp=true $@"
+
+echo "Removing files and folders under samples/server/petstore/springboot-virtualan/src/main"
+rm -rf samples/server/petstore/springboot-virtualan/src/main
+find samples/server/petstore/springboot-virtualan -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
+java $JAVA_OPTS -jar $executable $ags
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
index d96fda52687..30695d3a3f6 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java
@@ -232,6 +232,9 @@ public class CodegenConstants {
public static final String GENERATE_MODELS = "generateModels";
public static final String GENERATE_MODEL_DOCS = "generateModelDocs";
+ public static final String VIRTUAL_SERVICE = "virtualService";
+ public static final String VIRTUAL_SERVICE_DESC = "Generate Spring boot rest service as virtual service with Virtualan";
+
public static final String GENERATE_MODEL_TESTS = "generateModelTests";
public static final String GENERATE_MODEL_TESTS_DESC = "Specifies that model tests are to be generated.";
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 8bd1e2deacd..4b41f4bf64d 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
@@ -61,6 +61,8 @@ public class SpringCodegen extends AbstractJavaCodegen
public static final String INTERFACE_ONLY = "interfaceOnly";
public static final String DELEGATE_PATTERN = "delegatePattern";
public static final String SINGLE_CONTENT_TYPES = "singleContentTypes";
+ public static final String VIRTUAL_SERVICE = "virtualService";
+
public static final String JAVA_8 = "java8";
public static final String ASYNC = "async";
public static final String REACTIVE = "reactive";
@@ -90,6 +92,7 @@ public class SpringCodegen extends AbstractJavaCodegen
protected boolean openapiDocketConfig = false;
protected boolean apiFirst = false;
protected boolean useOptional = false;
+ protected boolean virtualService = false;
public SpringCodegen() {
super();
@@ -114,6 +117,7 @@ public class SpringCodegen extends AbstractJavaCodegen
cliOptions.add(CliOption.newBoolean(ASYNC, "use async Callable controllers", async));
cliOptions.add(CliOption.newBoolean(REACTIVE, "wrap responses in Mono/Flux Reactor types (spring-boot only)", reactive));
cliOptions.add(new CliOption(RESPONSE_WRAPPER, "wrap the responses in given type (Future,Callable,CompletableFuture,ListenableFuture,DeferredResult,HystrixCommand,RxObservable,RxSingle or fully qualified type)"));
+ cliOptions.add(CliOption.newBoolean(VIRTUAL_SERVICE, "Generates the virtual service. For more details refer - https://github.com/elan-venture/virtualan/wiki"));
cliOptions.add(CliOption.newBoolean(USE_TAGS, "use tags for creating interface and controller classnames", useTags));
cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations", useBeanValidation));
cliOptions.add(CliOption.newBoolean(IMPLICIT_HEADERS, "Use of @ApiImplicitParams for headers.", implicitHeaders));
@@ -198,6 +202,10 @@ public class SpringCodegen extends AbstractJavaCodegen
} else {
additionalProperties.put(BASE_PACKAGE, basePackage);
}
+
+ if (additionalProperties.containsKey(VIRTUAL_SERVICE)) {
+ this.setVirtualService(Boolean.valueOf(additionalProperties.get(VIRTUAL_SERVICE).toString()));
+ }
if (additionalProperties.containsKey(INTERFACE_ONLY)) {
this.setInterfaceOnly(Boolean.valueOf(additionalProperties.get(INTERFACE_ONLY).toString()));
@@ -667,6 +675,8 @@ public class SpringCodegen extends AbstractJavaCodegen
public void setJava8(boolean java8) { this.java8 = java8; }
+ public void setVirtualService(boolean virtualService) { this.virtualService = virtualService; }
+
public void setAsync(boolean async) { this.async = async; }
public void setReactive(boolean reactive) { this.reactive = reactive; }
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache
index 66121f30584..6736878e6f0 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache
@@ -9,6 +9,10 @@ package {{package}};
{{/imports}}
import io.swagger.annotations.*;
{{#jdk8-no-delegate}}
+{{#virtualService}}
+import io.virtualan.annotation.ApiVirtual;
+import io.virtualan.annotation.VirtualService;
+{{/virtualService}}
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
{{/jdk8-no-delegate}}
@@ -58,6 +62,9 @@ import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture
{{/useBeanValidation}}
@Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API")
{{#operations}}
+{{#virtualService}}
+@VirtualService
+{{/virtualService}}
public interface {{classname}} {
{{#jdk8}}
{{^isDelegate}}
@@ -77,6 +84,9 @@ public interface {{classname}} {
{{/jdk8}}
{{#operation}}
+ {{#virtualService}}
+ @ApiVirtual
+ {{/virtualService}}
@ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{returnBaseType}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = {
{{#authMethods}}@Authorization(value = "{{name}}"{{#isOAuth}}, scopes = {
{{#scopes}}@AuthorizationScope(scope = "{{scope}}", description = "{{description}}"){{#hasMore}},
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache
index 4c9e6271d59..5052f367a27 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache
@@ -69,6 +69,8 @@ public class {{classname}}Controller implements {{classname}} {
{{^isDelegate}}
{{^reactive}}
+ {{^jdk8}}
+ {{/jdk8}}
private final NativeWebRequest request;
@org.springframework.beans.factory.annotation.Autowired
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 f824f03035f..fdc844423d6 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
@@ -47,3 +47,14 @@ public interface PetClient extends PetApi {
}
```
{{/interfaceOnly}}
+{{#virtualService}}
+
+
+## Virtualan :
+
+You can view Virtualan UI by pointing to
+http://localhost:80//virtualan-ui.html.
+
+How to use guide available in the Virtualan wiki
+https://github.com/elan-venture/virtualan/wiki
+{{/virtualService}}
\ 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 1193554dd22..b7fea3f6262 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
@@ -3,4 +3,10 @@ springfox.documentation.swagger.v2.path=/api-docs
{{/useSpringfox}}
server.port={{serverPort}}
spring.jackson.date-format={{basePackage}}.RFC3339DateFormat
-spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
\ No newline at end of file
+spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
+{{#virtualService}}
+virtual.datasource.driver-class-name=org.hsqldb.jdbcDriver
+virtual.datasource.jdbcurl=jdbc:hsqldb:mem:dataSource
+virtual.datasource.username=sa
+virtual.datasource.password=
+{{/virtualService}}
\ 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 2d35c75cd1b..f97f0ea9258 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
@@ -134,6 +134,26 @@
javax.validation
validation-api
-{{/useBeanValidation}}
+{{/useBeanValidation}}
+{{#virtualService}}
+
+
+ io.virtualan
+ virtualan-plugin
+ 1.0.0
+
+
+
+ org.hsqldb
+ hsqldb
+ 2.3.2
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+ 1.5.9.RELEASE
+
+
+{{/virtualService}}
diff --git a/pom.xml b/pom.xml
index 31438e91cf5..d54c14d4bd3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -947,6 +947,18 @@
samples/server/petstore/springboot
+
+ springboot-virtualan
+
+
+ env
+ java
+
+
+
+ samples/server/petstore/springboot-virtualan
+
+
spring-cloud
diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/application.properties b/samples/server/petstore/springboot-beanvalidation/src/main/resources/application.properties
index 13b0dc6ab96..ceca4a9e0d0 100644
--- a/samples/server/petstore/springboot-beanvalidation/src/main/resources/application.properties
+++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/application.properties
@@ -1,4 +1,4 @@
springfox.documentation.swagger.v2.path=/api-docs
server.port=80
spring.jackson.date-format=org.openapitools.RFC3339DateFormat
-spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
\ No newline at end of file
+spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/application.properties b/samples/server/petstore/springboot-delegate-j8/src/main/resources/application.properties
index 13b0dc6ab96..ceca4a9e0d0 100644
--- a/samples/server/petstore/springboot-delegate-j8/src/main/resources/application.properties
+++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/application.properties
@@ -1,4 +1,4 @@
springfox.documentation.swagger.v2.path=/api-docs
server.port=80
spring.jackson.date-format=org.openapitools.RFC3339DateFormat
-spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
\ No newline at end of file
+spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/application.properties b/samples/server/petstore/springboot-delegate/src/main/resources/application.properties
index 13b0dc6ab96..ceca4a9e0d0 100644
--- a/samples/server/petstore/springboot-delegate/src/main/resources/application.properties
+++ b/samples/server/petstore/springboot-delegate/src/main/resources/application.properties
@@ -1,4 +1,4 @@
springfox.documentation.swagger.v2.path=/api-docs
server.port=80
spring.jackson.date-format=org.openapitools.RFC3339DateFormat
-spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
\ No newline at end of file
+spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties
index 13b0dc6ab96..ceca4a9e0d0 100644
--- a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties
+++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/application.properties
@@ -1,4 +1,4 @@
springfox.documentation.swagger.v2.path=/api-docs
server.port=80
spring.jackson.date-format=org.openapitools.RFC3339DateFormat
-spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
\ No newline at end of file
+spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/application.properties b/samples/server/petstore/springboot-reactive/src/main/resources/application.properties
index 6512a5b02e4..9d06609db66 100644
--- a/samples/server/petstore/springboot-reactive/src/main/resources/application.properties
+++ b/samples/server/petstore/springboot-reactive/src/main/resources/application.properties
@@ -1,3 +1,3 @@
server.port=80
spring.jackson.date-format=org.openapitools.RFC3339DateFormat
-spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
\ No newline at end of file
+spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/application.properties b/samples/server/petstore/springboot-useoptional/src/main/resources/application.properties
index 13b0dc6ab96..ceca4a9e0d0 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/resources/application.properties
+++ b/samples/server/petstore/springboot-useoptional/src/main/resources/application.properties
@@ -1,4 +1,4 @@
springfox.documentation.swagger.v2.path=/api-docs
server.port=80
spring.jackson.date-format=org.openapitools.RFC3339DateFormat
-spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
\ No newline at end of file
+spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator-ignore b/samples/server/petstore/springboot-virtualan/.openapi-generator-ignore
new file mode 100644
index 00000000000..7484ee590a3
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/.openapi-generator-ignore
@@ -0,0 +1,23 @@
+# OpenAPI Generator Ignore
+# Generated by openapi-generator https://github.com/openapitools/openapi-generator
+
+# Use this file to prevent files from being overwritten by the generator.
+# The patterns follow closely to .gitignore or .dockerignore.
+
+# As an example, the C# client generator defines ApiClient.cs.
+# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
+#ApiClient.cs
+
+# You can match any string of characters against a directory, file or extension with a single asterisk (*):
+#foo/*/qux
+# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
+
+# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
+#foo/**/qux
+# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
+
+# You can also negate patterns with an exclamation (!).
+# For example, you can ignore all files in a docs folder with the file extension .md:
+#docs/*.md
+# Then explicitly reverse the ignore rule for a single file:
+#!docs/README.md
diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION
new file mode 100644
index 00000000000..6d94c9c2e12
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION
@@ -0,0 +1 @@
+3.3.0-SNAPSHOT
\ No newline at end of file
diff --git a/samples/server/petstore/springboot-virtualan/README.md b/samples/server/petstore/springboot-virtualan/README.md
new file mode 100644
index 00000000000..34d7562140a
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/README.md
@@ -0,0 +1,26 @@
+# OpenAPI generated server
+
+Spring Boot Server
+
+
+## Overview
+This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
+By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
+This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
+
+The underlying library integrating OpenAPI to SpringBoot is [springfox](https://github.com/springfox/springfox)
+
+Start your server as a simple java application
+
+You can view the api documentation in swagger-ui by pointing to
+http://localhost:80/
+
+Change default port value in application.properties
+
+## Virtualan :
+
+You can view Virtualan UI by pointing to
+http://localhost:80//virtualan-ui.html.
+
+How to use guide available in the Virtualan wiki
+https://github.com/elan-venture/virtualan/wiki
diff --git a/samples/server/petstore/springboot-virtualan/pom.xml b/samples/server/petstore/springboot-virtualan/pom.xml
new file mode 100644
index 00000000000..c13fb400aff
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/pom.xml
@@ -0,0 +1,79 @@
+
+ 4.0.0
+ org.openapitools
+ springboot-virtualan
+ jar
+ springboot-virtualan
+ 1.0.0
+
+ 1.8
+ ${java.version}
+ ${java.version}
+ 2.8.0
+
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 2.0.1.RELEASE
+
+
+ src/main/java
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+ repackage
+
+
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+ io.springfox
+ springfox-swagger2
+ ${springfox-version}
+
+
+ io.springfox
+ springfox-swagger-ui
+ ${springfox-version}
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+
+
+
+ javax.validation
+ validation-api
+
+
+
+ io.virtualan
+ virtualan-plugin
+ 1.0.0
+
+
+
+ org.hsqldb
+ hsqldb
+ 2.3.2
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+ 1.5.9.RELEASE
+
+
+
+
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenAPI2SpringBoot.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
new file mode 100644
index 00000000000..5f8148a921b
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/OpenAPI2SpringBoot.java
@@ -0,0 +1,50 @@
+package org.openapitools;
+
+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.virtualan.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);
+ }
+
+ 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");
+ }*/
+ };
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/RFC3339DateFormat.java
new file mode 100644
index 00000000000..026bb3168c6
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/RFC3339DateFormat.java
@@ -0,0 +1,22 @@
+package org.openapitools;
+
+import com.fasterxml.jackson.databind.util.ISO8601DateFormat;
+import com.fasterxml.jackson.databind.util.ISO8601Utils;
+
+import java.text.FieldPosition;
+import java.util.Date;
+
+
+public class RFC3339DateFormat extends ISO8601DateFormat {
+
+ private static final long serialVersionUID = 1L;
+
+ // Same as ISO8601DateFormat but serializing milliseconds.
+ @Override
+ public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) {
+ String value = ISO8601Utils.format(date, true);
+ toAppendTo.append(value);
+ return toAppendTo;
+ }
+
+}
\ No newline at end of file
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/HomeController.java
new file mode 100644
index 00000000000..25727830541
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/HomeController.java
@@ -0,0 +1,19 @@
+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/springboot-virtualan/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java
new file mode 100644
index 00000000000..b018fb7272a
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/configuration/OpenAPIDocumentationConfig.java
@@ -0,0 +1,70 @@
+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;
+
+
+@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("http://www.apache.org/licenses/LICENSE-2.0.html")
+ .termsOfServiceUrl("")
+ .version("1.0.0")
+ .contact(new Contact("","", ""))
+ .build();
+ }
+
+ @Bean
+ public Docket customImplementation(ServletContext servletContext, @Value("${openapi.openAPIPetstore.base-path:/v2}") String basePath) {
+ return new Docket(DocumentationType.SWAGGER_2)
+ .select()
+ .apis(RequestHandlerSelectors.basePackage("org.openapitools.virtualan.api"))
+ .build()
+ .pathProvider(new BasePathAwareRelativePathProvider(servletContext, basePath))
+ .directModelSubstitute(java.time.LocalDate.class, java.sql.Date.class)
+ .directModelSubstitute(java.time.OffsetDateTime.class, java.util.Date.class)
+ .apiInfo(apiInfo());
+ }
+
+ class BasePathAwareRelativePathProvider extends RelativePathProvider {
+ private String basePath;
+
+ public BasePathAwareRelativePathProvider(ServletContext servletContext, String basePath) {
+ super(servletContext);
+ this.basePath = basePath;
+ }
+
+ @Override
+ protected String applicationPath() {
+ return Paths.removeAdjacentForwardSlashes(UriComponentsBuilder.fromPath(super.applicationPath()).path(basePath).build().toString());
+ }
+
+ @Override
+ public String getOperationPath(String operationPath) {
+ UriComponentsBuilder uriComponentsBuilder = UriComponentsBuilder.fromPath("/");
+ return Paths.removeAdjacentForwardSlashes(
+ uriComponentsBuilder.path(operationPath.replaceFirst("^" + basePath, "")).build().toString());
+ }
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java
new file mode 100644
index 00000000000..7106b763d21
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java
@@ -0,0 +1,62 @@
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.virtualan.api;
+
+import org.openapitools.virtualan.model.Client;
+import io.swagger.annotations.*;
+import io.virtualan.annotation.ApiVirtual;
+import io.virtualan.annotation.VirtualService;
+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.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+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;
+
+@Validated
+@Api(value = "another-fake", description = "the another-fake API")
+@VirtualService
+public interface AnotherFakeApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ @ApiVirtual
+ @ApiOperation(value = "To test special tags", nickname = "call123testSpecialTags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Client.class) })
+ @RequestMapping(value = "/another-fake/dummy",
+ produces = { "application/json" },
+ consumes = { "application/json" },
+ method = RequestMethod.PATCH)
+ default ResponseEntity call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java
new file mode 100644
index 00000000000..8ba61766e9e
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApiController.java
@@ -0,0 +1,24 @@
+package org.openapitools.virtualan.api;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.context.request.NativeWebRequest;
+import java.util.Optional;
+
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class AnotherFakeApiController implements AnotherFakeApi {
+
+ private final NativeWebRequest request;
+
+ @org.springframework.beans.factory.annotation.Autowired
+ public AnotherFakeApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/ApiUtil.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/ApiUtil.java
new file mode 100644
index 00000000000..a1b15b821fb
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/ApiUtil.java
@@ -0,0 +1,17 @@
+package org.openapitools.virtualan.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 {
+ req.getNativeResponse(HttpServletResponse.class).addHeader("Content-Type", contentType);
+ req.getNativeResponse(HttpServletResponse.class).getOutputStream().print(example);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+}
\ No newline at end of file
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java
new file mode 100644
index 00000000000..0555f06748f
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java
@@ -0,0 +1,264 @@
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.virtualan.api;
+
+import java.math.BigDecimal;
+import org.openapitools.virtualan.model.Client;
+import org.openapitools.virtualan.model.FileSchemaTestClass;
+import java.time.LocalDate;
+import java.util.Map;
+import org.openapitools.virtualan.model.ModelApiResponse;
+import java.time.OffsetDateTime;
+import org.openapitools.virtualan.model.OuterComposite;
+import org.springframework.core.io.Resource;
+import org.openapitools.virtualan.model.User;
+import io.swagger.annotations.*;
+import io.virtualan.annotation.ApiVirtual;
+import io.virtualan.annotation.VirtualService;
+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.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+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;
+
+@Validated
+@Api(value = "fake", description = "the fake API")
+@VirtualService
+public interface FakeApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ @ApiVirtual
+ @ApiOperation(value = "", nickname = "fakeOuterBooleanSerialize", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) })
+ @RequestMapping(value = "/fake/outer/boolean",
+ produces = { "*/*" },
+ method = RequestMethod.POST)
+ default ResponseEntity fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
+ ApiUtil.setExampleResponse(request, "*/*", "null");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "", nickname = "fakeOuterCompositeSerialize", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) })
+ @RequestMapping(value = "/fake/outer/composite",
+ produces = { "*/*" },
+ method = RequestMethod.POST)
+ default ResponseEntity fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite outerComposite) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
+ ApiUtil.setExampleResponse(request, "*/*", "{ \"my_string\" : \"my_string\", \"my_number\" : 0.80082819046101150206595775671303272247314453125, \"my_boolean\" : true}");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "", nickname = "fakeOuterNumberSerialize", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) })
+ @RequestMapping(value = "/fake/outer/number",
+ produces = { "*/*" },
+ method = RequestMethod.POST)
+ default ResponseEntity fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
+ ApiUtil.setExampleResponse(request, "*/*", "null");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "", nickname = "fakeOuterStringSerialize", notes = "Test serialization of outer string types", response = String.class, tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Output string", response = String.class) })
+ @RequestMapping(value = "/fake/outer/string",
+ produces = { "*/*" },
+ method = RequestMethod.POST)
+ default ResponseEntity fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
+ ApiUtil.setExampleResponse(request, "*/*", "null");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "", nickname = "testBodyWithFileSchema", notes = "For this test, the body for this request much reference a schema named `File`.", tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Success") })
+ @RequestMapping(value = "/fake/body-with-file-schema",
+ consumes = { "application/json" },
+ method = RequestMethod.PUT)
+ default ResponseEntity testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "", nickname = "testBodyWithQueryParams", notes = "", tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "Success") })
+ @RequestMapping(value = "/fake/body-with-query-params",
+ consumes = { "application/json" },
+ method = RequestMethod.PUT)
+ default ResponseEntity testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody User user) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "To test \"client\" model", nickname = "testClientModel", notes = "To test \"client\" model", response = Client.class, tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Client.class) })
+ @RequestMapping(value = "/fake",
+ produces = { "application/json" },
+ consumes = { "application/json" },
+ method = RequestMethod.PATCH)
+ default ResponseEntity testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", nickname = "testEndpointParameters", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", authorizations = {
+ @Authorization(value = "http_basic_test")
+ }, tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid username supplied"),
+ @ApiResponse(code = 404, message = "User not found") })
+ @RequestMapping(value = "/fake",
+ consumes = { "application/x-www-form-urlencoded" },
+ method = RequestMethod.POST)
+ default ResponseEntity testEndpointParameters(@ApiParam(value = "None", required=true, defaultValue="null") @RequestParam(value="number", required=true) BigDecimal number,@ApiParam(value = "None", required=true, defaultValue="null") @RequestParam(value="double", required=true) Double _double,@ApiParam(value = "None", required=true, defaultValue="null") @RequestParam(value="pattern_without_delimiter", required=true) String patternWithoutDelimiter,@ApiParam(value = "None", required=true, defaultValue="null") @RequestParam(value="byte", required=true) byte[] _byte,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="integer", required=false) Integer integer,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="int32", required=false) Integer int32,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="int64", required=false) Long int64,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="float", required=false) Float _float,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="string", required=false) String string,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile binary,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="date", required=false) LocalDate date,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="dateTime", required=false) OffsetDateTime dateTime,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="password", required=false) String password,@ApiParam(value = "None", defaultValue="null") @RequestParam(value="callback", required=false) String paramCallback) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "To test enum parameters", nickname = "testEnumParameters", notes = "To test enum parameters", tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid request"),
+ @ApiResponse(code = 404, message = "Not found") })
+ @RequestMapping(value = "/fake",
+ consumes = { "application/x-www-form-urlencoded" },
+ method = RequestMethod.GET)
+ default ResponseEntity 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) 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=">, $", defaultValue="$") @RequestParam(value="enum_form_string_array", required=false) List enumFormStringArray,@ApiParam(value = "Form parameter enum test (string)", allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestParam(value="enum_form_string", required=false) String enumFormString) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "test inline additionalProperties", nickname = "testInlineAdditionalProperties", notes = "", tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation") })
+ @RequestMapping(value = "/fake/inline-additionalProperties",
+ consumes = { "application/json" },
+ method = RequestMethod.POST)
+ default ResponseEntity testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Map requestBody) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "test json serialization of form data", nickname = "testJsonFormData", notes = "", tags={ "fake", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation") })
+ @RequestMapping(value = "/fake/jsonFormData",
+ consumes = { "application/x-www-form-urlencoded" },
+ method = RequestMethod.GET)
+ default ResponseEntity testJsonFormData(@ApiParam(value = "field1", required=true, defaultValue="null") @RequestParam(value="param", required=true) String param,@ApiParam(value = "field2", required=true, defaultValue="null") @RequestParam(value="param2", required=true) String param2) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(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")
+ })
+ }, tags={ "pet", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
+ @RequestMapping(value = "/fake/{petId}/uploadImageWithRequiredFile",
+ produces = { "application/json" },
+ consumes = { "multipart/form-data" },
+ method = RequestMethod.POST)
+ default ResponseEntity uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile requiredFile,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java
new file mode 100644
index 00000000000..4b2e463440d
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApiController.java
@@ -0,0 +1,24 @@
+package org.openapitools.virtualan.api;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.context.request.NativeWebRequest;
+import java.util.Optional;
+
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class FakeApiController implements FakeApi {
+
+ private final NativeWebRequest request;
+
+ @org.springframework.beans.factory.annotation.Autowired
+ public FakeApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java
new file mode 100644
index 00000000000..d83dcb48787
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java
@@ -0,0 +1,64 @@
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.virtualan.api;
+
+import org.openapitools.virtualan.model.Client;
+import io.swagger.annotations.*;
+import io.virtualan.annotation.ApiVirtual;
+import io.virtualan.annotation.VirtualService;
+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.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+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;
+
+@Validated
+@Api(value = "fake_classname_test", description = "the fake_classname_test API")
+@VirtualService
+public interface FakeClassnameTestApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ @ApiVirtual
+ @ApiOperation(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")
+ }, tags={ "fake_classname_tags 123#$%^", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Client.class) })
+ @RequestMapping(value = "/fake_classname_test",
+ produces = { "application/json" },
+ consumes = { "application/json" },
+ method = RequestMethod.PATCH)
+ default ResponseEntity testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Client client) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ ApiUtil.setExampleResponse(request, "application/json", "{ \"client\" : \"client\"}");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java
new file mode 100644
index 00000000000..9a048c36e72
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApiController.java
@@ -0,0 +1,24 @@
+package org.openapitools.virtualan.api;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.context.request.NativeWebRequest;
+import java.util.Optional;
+
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class FakeClassnameTestApiController implements FakeClassnameTestApi {
+
+ private final NativeWebRequest request;
+
+ @org.springframework.beans.factory.annotation.Autowired
+ public FakeClassnameTestApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java
new file mode 100644
index 00000000000..21ad9cccb25
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java
@@ -0,0 +1,233 @@
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.virtualan.api;
+
+import org.openapitools.virtualan.model.ModelApiResponse;
+import org.openapitools.virtualan.model.Pet;
+import org.springframework.core.io.Resource;
+import io.swagger.annotations.*;
+import io.virtualan.annotation.ApiVirtual;
+import io.virtualan.annotation.VirtualService;
+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.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+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;
+
+@Validated
+@Api(value = "pet", description = "the pet API")
+@VirtualService
+public interface PetApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ @ApiVirtual
+ @ApiOperation(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")
+ })
+ }, tags={ "pet", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 405, message = "Invalid input") })
+ @RequestMapping(value = "/pet",
+ consumes = { "application/json", "application/xml" },
+ method = RequestMethod.POST)
+ default ResponseEntity addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet pet) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(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")
+ })
+ }, tags={ "pet", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid pet value") })
+ @RequestMapping(value = "/pet/{petId}",
+ method = RequestMethod.DELETE)
+ 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) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(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")
+ })
+ }, tags={ "pet", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid status value") })
+ @RequestMapping(value = "/pet/findByStatus",
+ produces = { "application/xml", "application/json" },
+ method = RequestMethod.GET)
+ 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) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}");
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(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 = "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")
+ })
+ }, tags={ "pet", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"),
+ @ApiResponse(code = 400, message = "Invalid tag value") })
+ @RequestMapping(value = "/pet/findByTags",
+ produces = { "application/xml", "application/json" },
+ method = RequestMethod.GET)
+ default ResponseEntity> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @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"))) {
+ ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}");
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(value = "Find pet by ID", nickname = "getPetById", notes = "Returns a single pet", response = Pet.class, authorizations = {
+ @Authorization(value = "api_key")
+ }, tags={ "pet", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Pet.class),
+ @ApiResponse(code = 400, message = "Invalid ID supplied"),
+ @ApiResponse(code = 404, message = "Pet not found") })
+ @RequestMapping(value = "/pet/{petId}",
+ produces = { "application/xml", "application/json" },
+ method = RequestMethod.GET)
+ default ResponseEntity getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ ApiUtil.setExampleResponse(request, "application/json", "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\"}");
+ break;
+ }
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) {
+ ApiUtil.setExampleResponse(request, "application/xml", " 123456789 doggie aeiou aeiou");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(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")
+ })
+ }, tags={ "pet", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid ID supplied"),
+ @ApiResponse(code = 404, message = "Pet not found"),
+ @ApiResponse(code = 405, message = "Validation exception") })
+ @RequestMapping(value = "/pet",
+ consumes = { "application/json", "application/xml" },
+ method = RequestMethod.PUT)
+ default ResponseEntity updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Pet pet) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(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")
+ })
+ }, tags={ "pet", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 405, message = "Invalid input") })
+ @RequestMapping(value = "/pet/{petId}",
+ consumes = { "application/x-www-form-urlencoded" },
+ method = RequestMethod.POST)
+ 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", defaultValue="null") @RequestParam(value="name", required=false) String name,@ApiParam(value = "Updated status of the pet", defaultValue="null") @RequestParam(value="status", required=false) String status) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(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")
+ })
+ }, tags={ "pet", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) })
+ @RequestMapping(value = "/pet/{petId}/uploadImage",
+ produces = { "application/json" },
+ consumes = { "multipart/form-data" },
+ method = RequestMethod.POST)
+ default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server", defaultValue="null") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) {
+ getRequest().ifPresent(request -> {
+ for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
+ if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) {
+ ApiUtil.setExampleResponse(request, "application/json", "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\"}");
+ break;
+ }
+ }
+ });
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java
new file mode 100644
index 00000000000..d9f4d8f1264
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApiController.java
@@ -0,0 +1,24 @@
+package org.openapitools.virtualan.api;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.context.request.NativeWebRequest;
+import java.util.Optional;
+
+@Controller
+@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}")
+public class PetApiController implements PetApi {
+
+ private final NativeWebRequest request;
+
+ @org.springframework.beans.factory.annotation.Autowired
+ public PetApiController(NativeWebRequest request) {
+ this.request = request;
+ }
+
+ @Override
+ public Optional getRequest() {
+ return Optional.ofNullable(request);
+ }
+
+}
diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java
new file mode 100644
index 00000000000..f4f013f0f55
--- /dev/null
+++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java
@@ -0,0 +1,122 @@
+/**
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (3.3.0-SNAPSHOT).
+ * https://openapi-generator.tech
+ * Do not edit the class manually.
+ */
+package org.openapitools.virtualan.api;
+
+import java.util.Map;
+import org.openapitools.virtualan.model.Order;
+import io.swagger.annotations.*;
+import io.virtualan.annotation.ApiVirtual;
+import io.virtualan.annotation.VirtualService;
+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.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RequestPart;
+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;
+
+@Validated
+@Api(value = "store", description = "the store API")
+@VirtualService
+public interface StoreApi {
+
+ default Optional getRequest() {
+ return Optional.empty();
+ }
+
+ @ApiVirtual
+ @ApiOperation(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", tags={ "store", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 400, message = "Invalid ID supplied"),
+ @ApiResponse(code = 404, message = "Order not found") })
+ @RequestMapping(value = "/store/order/{order_id}",
+ method = RequestMethod.DELETE)
+ default ResponseEntity deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+
+ }
+
+
+ @ApiVirtual
+ @ApiOperation(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")
+ }, tags={ "store", })
+ @ApiResponses(value = {
+ @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") })
+ @RequestMapping(value = "/store/inventory",
+ produces = { "application/json" },
+ method = RequestMethod.GET)
+ default ResponseEntity