diff --git a/bin/java-vertx-async-petstore-server.sh b/bin/java-vertx-async-petstore-server.sh index d0d25aaba1..8a0d86cac9 100755 --- a/bin/java-vertx-async-petstore-server.sh +++ b/bin/java-vertx-async-petstore-server.sh @@ -27,6 +27,6 @@ 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 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-vertx -o samples/server/petstore/java-vertx/async -DvertxSwaggerRouterVersion=1.2.0" +ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-vertx -o samples/server/petstore/java-vertx/async -DvertxSwaggerRouterVersion=1.4.0 -DhideGenerationTimestamp=true" java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-vertx-rx-petstore-server.sh b/bin/java-vertx-rx-petstore-server.sh index 937ef324b0..864dfa59ee 100755 --- a/bin/java-vertx-rx-petstore-server.sh +++ b/bin/java-vertx-rx-petstore-server.sh @@ -27,6 +27,6 @@ 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 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-vertx --artifact-id java-vertx-rx-server -o samples/server/petstore/java-vertx/rx -DvertxSwaggerRouterVersion=1.2.0,rxInterface=true" +ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l java-vertx --artifact-id java-vertx-rx-server -o samples/server/petstore/java-vertx/rx -DvertxSwaggerRouterVersion=1.4.0,rxInterface=true -DhideGenerationTimestamp=true" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java index dad4c88e8e..58cb77d8c1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaVertXServerCodegen.java @@ -1,5 +1,11 @@ package org.openapitools.codegen.languages; +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.PathItem.HttpMethod; +import io.swagger.v3.oas.models.media.Schema; + import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenModel; import org.openapitools.codegen.CodegenOperation; @@ -7,12 +13,6 @@ import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenType; import org.openapitools.codegen.SupportingFile; import org.openapitools.codegen.utils.URLPathUtils; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.oas.models.PathItem; -import io.swagger.v3.oas.models.PathItem.HttpMethod; -import io.swagger.v3.core.util.Json; import java.io.File; import java.net.URL; @@ -25,7 +25,7 @@ import java.util.regex.Pattern; public class JavaVertXServerCodegen extends AbstractJavaCodegen { protected String resourceFolder = "src/main/resources"; - protected String rootPackage = "io.swagger.server.api"; + protected String rootPackage = "org.openapitools.server.api"; protected String apiVersion = "1.0.0-SNAPSHOT"; public static final String ROOT_PACKAGE = "rootPackage"; @@ -124,7 +124,7 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen { apiDocTemplateFiles.clear(); supportingFiles.clear(); - supportingFiles.add(new SupportingFile("swagger.mustache", resourceFolder, "swagger.json")); + supportingFiles.add(new SupportingFile("openapi.mustache", resourceFolder, "openapi.json")); supportingFiles.add(new SupportingFile("MainApiVerticle.mustache", sourceFolder + File.separator + rootPackage.replace(".", File.separator), "MainApiVerticle.java")); @@ -173,6 +173,13 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen { return newObjs; } + @Override + public Map postProcessSupportingFileData(Map objs) { + generateJSONSpecFile(objs); + return super.postProcessSupportingFileData(objs); + } + + @Override public CodegenOperation fromOperation(String path, String httpMethod, Operation operation, Map definitions, OpenAPI openAPI) { @@ -194,10 +201,6 @@ public class JavaVertXServerCodegen extends AbstractJavaCodegen { public void preprocessOpenAPI(OpenAPI openAPI) { super.preprocessOpenAPI(openAPI); - // add full swagger definition in a mustache parameter - String openAPIDef = Json.pretty(openAPI); - this.additionalProperties.put("fullOpenAPI", openAPIDef); - // add server port from the swagger file, 8080 by default URL url = URLPathUtils.getServerURL(openAPI); this.additionalProperties.put("serverPort", URLPathUtils.getPort(url, 8080)); diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/README.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/README.mustache index ac03f0bc7c..b07458ad60 100644 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/README.mustache +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/README.mustache @@ -1 +1,3 @@ +{{^hideGenerationTimestamp}} Project generated on : {{generatedDate}} +{{/hideGenerationTimestamp}} diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/openapi.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/openapi.mustache new file mode 100644 index 0000000000..7710186d9d --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaVertXServer/openapi.mustache @@ -0,0 +1 @@ +{{{openapi-json}}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaVertXServer/swagger.mustache b/modules/openapi-generator/src/main/resources/JavaVertXServer/swagger.mustache deleted file mode 100644 index e5799e4d04..0000000000 --- a/modules/openapi-generator/src/main/resources/JavaVertXServer/swagger.mustache +++ /dev/null @@ -1 +0,0 @@ -{{{fullOpenAPI}}} \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/.openapi-generator-ignore b/samples/server/petstore/java-vertx/async/.openapi-generator-ignore index c5fa491b4c..7484ee590a 100644 --- a/samples/server/petstore/java-vertx/async/.openapi-generator-ignore +++ b/samples/server/petstore/java-vertx/async/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# 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 Swagger Codgen to ignore just this file by uncommenting the following line: +# 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 (*): diff --git a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/async/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/README.md b/samples/server/petstore/java-vertx/async/README.md index 7f4534629b..e69de29bb2 100644 --- a/samples/server/petstore/java-vertx/async/README.md +++ b/samples/server/petstore/java-vertx/async/README.md @@ -1 +0,0 @@ -Project generated on : 2017-07-08T16:03:02.953+02:00 diff --git a/samples/server/petstore/java-vertx/async/pom.xml b/samples/server/petstore/java-vertx/async/pom.xml index ba6f38e39d..7485723d5e 100644 --- a/samples/server/petstore/java-vertx/async/pom.xml +++ b/samples/server/petstore/java-vertx/async/pom.xml @@ -2,8 +2,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - io.swagger - swagger-java-vertx-server + org.openapitools + openapi-java-vertx-server 1.0.0-SNAPSHOT jar @@ -28,24 +28,25 @@ test - - io.vertx - vertx-unit - ${vertx.version} - test - + + io.vertx + vertx-unit + ${vertx.version} + test + - com.github.phiz71 - vertx-swagger-router - ${vertx-swagger-router.version} - + com.github.phiz71 + vertx-swagger-router + ${vertx-swagger-router.version} + + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-datatype-jsr310.version} + - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-datatype-jsr310.version} - @@ -75,7 +76,7 @@ implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> io.vertx.core.Starter - io.swagger.server.api.MainApiVerticle + org.openapitools.server.api.MainApiVerticle @@ -87,4 +88,4 @@ - + \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/MainApiException.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiException.java similarity index 93% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/MainApiException.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiException.java index 8eb8f720d6..4aef710c01 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/MainApiException.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiException.java @@ -1,4 +1,4 @@ -package io.swagger.server.api; +package org.openapitools.server.api; public class MainApiException extends Exception { private int statusCode; diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/MainApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiVerticle.java similarity index 88% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/MainApiVerticle.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiVerticle.java index aabd70b44a..695ca48e59 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/MainApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/MainApiVerticle.java @@ -1,4 +1,4 @@ -package io.swagger.server.api; +package org.openapitools.server.api; import java.nio.charset.Charset; @@ -42,7 +42,7 @@ public class MainApiVerticle extends AbstractVerticle { public void start(Future startFuture) throws Exception { Json.mapper.registerModule(new JavaTimeModule()); FileSystem vertxFileSystem = vertx.fileSystem(); - vertxFileSystem.readFile("swagger.json", readFile -> { + vertxFileSystem.readFile("openapi.json", readFile -> { if (readFile.succeeded()) { Swagger swagger = new SwaggerParser().parse(readFile.result().toString(Charset.forName("utf-8"))); Router swaggerRouter = SwaggerRouter.swaggerRouter(router, swagger, vertx.eventBus(), new OperationIdServiceIdResolver()); @@ -66,7 +66,7 @@ public class MainApiVerticle extends AbstractVerticle { public void deployVerticles(Future startFuture) { - vertx.deployVerticle("io.swagger.server.api.verticle.PetApiVerticle", res -> { + vertx.deployVerticle("org.openapitools.server.api.verticle.PetApiVerticle", res -> { if (res.succeeded()) { LOGGER.info("PetApiVerticle : Deployed"); } else { @@ -75,7 +75,7 @@ public class MainApiVerticle extends AbstractVerticle { } }); - vertx.deployVerticle("io.swagger.server.api.verticle.StoreApiVerticle", res -> { + vertx.deployVerticle("org.openapitools.server.api.verticle.StoreApiVerticle", res -> { if (res.succeeded()) { LOGGER.info("StoreApiVerticle : Deployed"); } else { @@ -84,7 +84,7 @@ public class MainApiVerticle extends AbstractVerticle { } }); - vertx.deployVerticle("io.swagger.server.api.verticle.UserApiVerticle", res -> { + vertx.deployVerticle("org.openapitools.server.api.verticle.UserApiVerticle", res -> { if (res.succeeded()) { LOGGER.info("UserApiVerticle : Deployed"); } else { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Category.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Category.java similarity index 97% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Category.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Category.java index 1065963542..58721d64cd 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Category.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Category.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/ModelApiResponse.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java similarity index 98% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/ModelApiResponse.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java index ef5261c7ed..60e1945bf1 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/ModelApiResponse.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Order.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Order.java similarity index 98% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Order.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Order.java index 0eaaa46f35..1815414b55 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Order.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Order.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Pet.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Pet.java similarity index 96% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Pet.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Pet.java index e975a8dc2b..be9ab39a49 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Pet.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Pet.java @@ -1,13 +1,13 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.server.api.model.Category; -import io.swagger.server.api.model.Tag; import java.util.ArrayList; import java.util.List; +import org.openapitools.server.api.model.Category; +import org.openapitools.server.api.model.Tag; /** * A pet for sale in the pet store diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Tag.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Tag.java similarity index 97% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Tag.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Tag.java index f00a458e3d..acb51386a8 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/Tag.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/Tag.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/User.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/User.java similarity index 98% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/User.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/User.java index 6e7331cd23..fedd3d6207 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/User.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/model/User.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApi.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApi.java similarity index 73% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApi.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApi.java index 7c7849563e..28a9e6e3d2 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApi.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApi.java @@ -1,9 +1,9 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import java.io.File; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.ModelApiResponse; -import io.swagger.server.api.model.Pet; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.ModelApiResponse; +import org.openapitools.server.api.model.Pet; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -13,7 +13,7 @@ import java.util.Map; public interface PetApi { //addPet - void addPet(Pet body, Handler> handler); + void addPet(Pet pet, Handler> handler); //deletePet void deletePet(Long petId, String apiKey, Handler> handler); @@ -28,7 +28,7 @@ public interface PetApi { void getPetById(Long petId, Handler> handler); //updatePet - void updatePet(Pet body, Handler> handler); + void updatePet(Pet pet, Handler> handler); //updatePetWithForm void updatePetWithForm(Long petId, String name, String status, Handler> handler); diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiException.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiException.java similarity index 87% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiException.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiException.java index c618e243e0..3374dcfd63 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiException.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiException.java @@ -1,9 +1,9 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import java.io.File; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.ModelApiResponse; -import io.swagger.server.api.model.Pet; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.ModelApiResponse; +import org.openapitools.server.api.model.Pet; public final class PetApiException extends MainApiException { public PetApiException(int statusCode, String statusMessage) { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java similarity index 91% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java index 4746d13428..e2aabfc651 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import io.vertx.core.AbstractVerticle; import io.vertx.core.eventbus.Message; @@ -9,9 +9,9 @@ import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; import java.io.File; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.ModelApiResponse; -import io.swagger.server.api.model.Pet; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.ModelApiResponse; +import org.openapitools.server.api.model.Pet; import java.util.List; import java.util.Map; @@ -32,7 +32,7 @@ public class PetApiVerticle extends AbstractVerticle { public PetApiVerticle() { try { - Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.PetApiImpl"); + Class serviceImplClass = getClass().getClassLoader().loadClass("org.openapitools.server.api.verticle.PetApiImpl"); service = (PetApi)serviceImplClass.newInstance(); } catch (Exception e) { logUnexpectedError("PetApiVerticle constructor", e); @@ -48,13 +48,13 @@ public class PetApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "addPet"; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject petParam = message.body().getJsonObject("Pet"); + if (petParam == null) { + manageError(message, new MainApiException(400, "Pet is required"), serviceId); return; } - Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); - service.addPet(body, result -> { + Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class); + service.addPet(pet, result -> { if (result.succeeded()) message.reply(null); else { @@ -177,13 +177,13 @@ public class PetApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "updatePet"; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject petParam = message.body().getJsonObject("Pet"); + if (petParam == null) { + manageError(message, new MainApiException(400, "Pet is required"), serviceId); return; } - Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); - service.updatePet(body, result -> { + Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class); + service.updatePet(pet, result -> { if (result.succeeded()) message.reply(null); else { @@ -239,12 +239,8 @@ public class PetApiVerticle extends AbstractVerticle { Long petId = Json.mapper.readValue(petIdParam, Long.class); String additionalMetadataParam = message.body().getString("additionalMetadata"); String additionalMetadata = (additionalMetadataParam == null) ? null : additionalMetadataParam; - JsonObject fileParam = message.body().getJsonObject("file"); - if (fileParam == null) { - manageError(message, new MainApiException(400, "file is required"), serviceId); - return; - } - File file = Json.mapper.readValue(fileParam.encode(), File.class); + String fileParam = message.body().getString("file"); + File file = (fileParam == null) ? null : Json.mapper.readValue(fileParam, File.class); service.uploadFile(petId, additionalMetadata, file, result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApi.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApi.java similarity index 67% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApi.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApi.java index dc26dd8d30..1f348fa57a 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApi.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApi.java @@ -1,7 +1,7 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.Order; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.Order; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -20,6 +20,6 @@ public interface StoreApi { void getOrderById(Long orderId, Handler> handler); //placeOrder - void placeOrder(Order body, Handler> handler); + void placeOrder(Order order, Handler> handler); } diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiException.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiException.java similarity index 84% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiException.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiException.java index 3b8f0ab204..c8a3b7e5be 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiException.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiException.java @@ -1,7 +1,7 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.Order; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.Order; public final class StoreApiException extends MainApiException { public StoreApiException(int statusCode, String statusMessage) { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java similarity index 92% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java index e2f608589b..ebe4670ddc 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import io.vertx.core.AbstractVerticle; import io.vertx.core.eventbus.Message; @@ -8,8 +8,8 @@ import io.vertx.core.json.JsonObject; import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.Order; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.Order; import java.util.List; import java.util.Map; @@ -26,7 +26,7 @@ public class StoreApiVerticle extends AbstractVerticle { public StoreApiVerticle() { try { - Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.StoreApiImpl"); + Class serviceImplClass = getClass().getClassLoader().loadClass("org.openapitools.server.api.verticle.StoreApiImpl"); service = (StoreApi)serviceImplClass.newInstance(); } catch (Exception e) { logUnexpectedError("StoreApiVerticle constructor", e); @@ -111,13 +111,13 @@ public class StoreApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "placeOrder"; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject orderParam = message.body().getJsonObject("Order"); + if (orderParam == null) { + manageError(message, new MainApiException(400, "Order is required"), serviceId); return; } - Order body = Json.mapper.readValue(bodyParam.encode(), Order.class); - service.placeOrder(body, result -> { + Order order = Json.mapper.readValue(orderParam.encode(), Order.class); + service.placeOrder(order, result -> { if (result.succeeded()) message.reply(new JsonObject(Json.encode(result.result())).encodePrettily()); else { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApi.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApi.java similarity index 64% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApi.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApi.java index 5de0be646c..bb114d2c70 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApi.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApi.java @@ -1,7 +1,7 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.User; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -11,13 +11,13 @@ import java.util.Map; public interface UserApi { //createUser - void createUser(User body, Handler> handler); + void createUser(User user, Handler> handler); //createUsersWithArrayInput - void createUsersWithArrayInput(List body, Handler> handler); + void createUsersWithArrayInput(List user, Handler> handler); //createUsersWithListInput - void createUsersWithListInput(List body, Handler> handler); + void createUsersWithListInput(List user, Handler> handler); //deleteUser void deleteUser(String username, Handler> handler); @@ -32,6 +32,6 @@ public interface UserApi { void logoutUser(Handler> handler); //updateUser - void updateUser(String username, User body, Handler> handler); + void updateUser(String username, User user, Handler> handler); } diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiException.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiException.java similarity index 88% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiException.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiException.java index 337f5b4353..b3714d11af 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiException.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiException.java @@ -1,7 +1,7 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.User; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.User; public final class UserApiException extends MainApiException { public UserApiException(int statusCode, String statusMessage) { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java similarity index 89% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java rename to samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java index 5021215f4d..a356f37a67 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/async/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import io.vertx.core.AbstractVerticle; import io.vertx.core.eventbus.Message; @@ -8,8 +8,8 @@ import io.vertx.core.json.JsonObject; import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.User; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.User; import java.util.List; import java.util.Map; @@ -30,7 +30,7 @@ public class UserApiVerticle extends AbstractVerticle { public UserApiVerticle() { try { - Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.UserApiImpl"); + Class serviceImplClass = getClass().getClassLoader().loadClass("org.openapitools.server.api.verticle.UserApiImpl"); service = (UserApi)serviceImplClass.newInstance(); } catch (Exception e) { logUnexpectedError("UserApiVerticle constructor", e); @@ -46,13 +46,13 @@ public class UserApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUser"; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject userParam = message.body().getJsonObject("User"); + if (userParam == null) { + manageError(message, new MainApiException(400, "User is required"), serviceId); return; } - User body = Json.mapper.readValue(bodyParam.encode(), User.class); - service.createUser(body, result -> { + User user = Json.mapper.readValue(userParam.encode(), User.class); + service.createUser(user, result -> { if (result.succeeded()) message.reply(null); else { @@ -71,14 +71,14 @@ public class UserApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUsersWithArrayInput"; - JsonArray bodyParam = message.body().getJsonArray("body"); - if(bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonArray userParam = message.body().getJsonArray("User"); + if(userParam == null) { + manageError(message, new MainApiException(400, "User is required"), serviceId); return; } - List body = Json.mapper.readValue(bodyParam.encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); - service.createUsersWithArrayInput(body, result -> { + List user = Json.mapper.readValue(userParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class)); + service.createUsersWithArrayInput(user, result -> { if (result.succeeded()) message.reply(null); else { @@ -97,14 +97,14 @@ public class UserApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUsersWithListInput"; - JsonArray bodyParam = message.body().getJsonArray("body"); - if(bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonArray userParam = message.body().getJsonArray("User"); + if(userParam == null) { + manageError(message, new MainApiException(400, "User is required"), serviceId); return; } - List body = Json.mapper.readValue(bodyParam.encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); - service.createUsersWithListInput(body, result -> { + List user = Json.mapper.readValue(userParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class)); + service.createUsersWithListInput(user, result -> { if (result.succeeded()) message.reply(null); else { @@ -229,13 +229,13 @@ public class UserApiVerticle extends AbstractVerticle { return; } String username = usernameParam; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject userParam = message.body().getJsonObject("User"); + if (userParam == null) { + manageError(message, new MainApiException(400, "User is required"), serviceId); return; } - User body = Json.mapper.readValue(bodyParam.encode(), User.class); - service.updateUser(username, body, result -> { + User user = Json.mapper.readValue(userParam.encode(), User.class); + service.updateUser(username, user, result -> { if (result.succeeded()) message.reply(null); else { diff --git a/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json b/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json new file mode 100644 index 0000000000..6ccb348dca --- /dev/null +++ b/samples/server/petstore/java-vertx/async/src/main/resources/openapi.json @@ -0,0 +1,1083 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Swagger Petstore", + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService" : "http://swagger.io/terms/", + "contact" : { + "email" : "apiteam@swagger.io" + }, + "license" : { + "name" : "Apache-2.0", + "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version" : "1.0.0" + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + }, + "servers" : [ { + "url" : "http://petstore.swagger.io/v2" + } ], + "tags" : [ { + "name" : "pet", + "description" : "Everything about your Pets", + "externalDocs" : { + "description" : "Find out more", + "url" : "http://swagger.io" + } + }, { + "name" : "store", + "description" : "Access to Petstore orders" + }, { + "name" : "user", + "description" : "Operations about user", + "externalDocs" : { + "description" : "Find out more about our store", + "url" : "http://swagger.io" + } + } ], + "paths" : { + "/pet" : { + "put" : { + "tags" : [ "pet" ], + "summary" : "Update an existing pet", + "operationId" : "updatePet", + "requestBody" : { + "description" : "Pet object that needs to be added to the store", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "required" : true + }, + "responses" : { + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Pet not found", + "content" : { } + }, + "405" : { + "description" : "Validation exception", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "application/json", + "x-accepts" : "application/json", + "x-serviceid" : "updatePet", + "x-serviceid-varname" : "UPDATEPET_SERVICE_ID" + }, + "post" : { + "tags" : [ "pet" ], + "summary" : "Add a new pet to the store", + "operationId" : "addPet", + "requestBody" : { + "description" : "Pet object that needs to be added to the store", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "required" : true + }, + "responses" : { + "405" : { + "description" : "Invalid input", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "application/json", + "x-accepts" : "application/json", + "x-serviceid" : "addPet", + "x-serviceid-varname" : "ADDPET_SERVICE_ID" + } + }, + "/pet/findByStatus" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by status", + "description" : "Multiple status values can be provided with comma separated strings", + "operationId" : "findPetsByStatus", + "parameters" : [ { + "name" : "status", + "in" : "query", + "description" : "Status values that need to be considered for filter", + "required" : true, + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string", + "default" : "available", + "enum" : [ "available", "pending", "sold" ] + } + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + } + } + }, + "400" : { + "description" : "Invalid status value", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "findPetsByStatus", + "x-serviceid-varname" : "FINDPETSBYSTATUS_SERVICE_ID" + } + }, + "/pet/findByTags" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by tags", + "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId" : "findPetsByTags", + "parameters" : [ { + "name" : "tags", + "in" : "query", + "description" : "Tags to filter by", + "required" : true, + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + } + } + }, + "400" : { + "description" : "Invalid tag value", + "content" : { } + } + }, + "deprecated" : true, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "findPetsByTags", + "x-serviceid-varname" : "FINDPETSBYTAGS_SERVICE_ID" + } + }, + "/pet/{petId}" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Find pet by ID", + "description" : "Returns a single pet", + "operationId" : "getPetById", + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to return", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + } + }, + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Pet not found", + "content" : { } + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "getPetById", + "x-serviceid-varname" : "GETPETBYID_SERVICE_ID" + }, + "post" : { + "tags" : [ "pet" ], + "summary" : "Updates a pet in the store with form data", + "operationId" : "updatePetWithForm", + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet that needs to be updated", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "requestBody" : { + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "properties" : { + "name" : { + "type" : "string", + "description" : "Updated name of the pet" + }, + "status" : { + "type" : "string", + "description" : "Updated status of the pet" + } + } + } + } + } + }, + "responses" : { + "405" : { + "description" : "Invalid input", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "application/x-www-form-urlencoded", + "x-accepts" : "application/json", + "x-serviceid" : "updatePetWithForm", + "x-serviceid-varname" : "UPDATEPETWITHFORM_SERVICE_ID" + }, + "delete" : { + "tags" : [ "pet" ], + "summary" : "Deletes a pet", + "operationId" : "deletePet", + "parameters" : [ { + "name" : "api_key", + "in" : "header", + "schema" : { + "type" : "string" + } + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid pet value", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "deletePet", + "x-serviceid-varname" : "DELETEPET_SERVICE_ID" + } + }, + "/pet/{petId}/uploadImage" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "uploads an image", + "operationId" : "uploadFile", + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to update", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "requestBody" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "properties" : { + "additionalMetadata" : { + "type" : "string", + "description" : "Additional data to pass to server" + }, + "file" : { + "type" : "string", + "description" : "file to upload", + "format" : "binary" + } + } + } + } + } + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ApiResponse" + } + } + } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "multipart/form-data", + "x-accepts" : "application/json", + "x-serviceid" : "uploadFile", + "x-serviceid-varname" : "UPLOADFILE_SERVICE_ID" + } + }, + "/store/inventory" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Returns pet inventories by status", + "description" : "Returns a map of status codes to quantities", + "operationId" : "getInventory", + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } + } + } + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "getInventory", + "x-serviceid-varname" : "GETINVENTORY_SERVICE_ID" + } + }, + "/store/order" : { + "post" : { + "tags" : [ "store" ], + "summary" : "Place an order for a pet", + "operationId" : "placeOrder", + "requestBody" : { + "description" : "order placed for purchasing the pet", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + } + }, + "400" : { + "description" : "Invalid Order", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "placeOrder", + "x-serviceid-varname" : "PLACEORDER_SERVICE_ID" + } + }, + "/store/order/{orderId}" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Find purchase order by ID", + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of pet that needs to be fetched", + "required" : true, + "schema" : { + "maximum" : 5, + "minimum" : 1, + "type" : "integer", + "format" : "int64" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + } + }, + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Order not found", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "getOrderById", + "x-serviceid-varname" : "GETORDERBYID_SERVICE_ID" + }, + "delete" : { + "tags" : [ "store" ], + "summary" : "Delete purchase order by ID", + "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId" : "deleteOrder", + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Order not found", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "deleteOrder", + "x-serviceid-varname" : "DELETEORDER_SERVICE_ID" + } + }, + "/user" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Create user", + "description" : "This can only be done by the logged in user.", + "operationId" : "createUser", + "requestBody" : { + "description" : "Created user object", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, + "responses" : { + "default" : { + "description" : "successful operation", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "createUser", + "x-serviceid-varname" : "CREATEUSER_SERVICE_ID" + } + }, + "/user/createWithArray" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "operationId" : "createUsersWithArrayInput", + "requestBody" : { + "description" : "List of user object", + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } + } + }, + "required" : true + }, + "responses" : { + "default" : { + "description" : "successful operation", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "createUsersWithArrayInput", + "x-serviceid-varname" : "CREATEUSERSWITHARRAYINPUT_SERVICE_ID" + } + }, + "/user/createWithList" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "operationId" : "createUsersWithListInput", + "requestBody" : { + "description" : "List of user object", + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } + } + }, + "required" : true + }, + "responses" : { + "default" : { + "description" : "successful operation", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "createUsersWithListInput", + "x-serviceid-varname" : "CREATEUSERSWITHLISTINPUT_SERVICE_ID" + } + }, + "/user/login" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs user into the system", + "operationId" : "loginUser", + "parameters" : [ { + "name" : "username", + "in" : "query", + "description" : "The user name for login", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", + "schema" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + } + }, + "400" : { + "description" : "Invalid username/password supplied", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "loginUser", + "x-serviceid-varname" : "LOGINUSER_SERVICE_ID" + } + }, + "/user/logout" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs out current logged in user session", + "operationId" : "logoutUser", + "responses" : { + "default" : { + "description" : "successful operation", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "logoutUser", + "x-serviceid-varname" : "LOGOUTUSER_SERVICE_ID" + } + }, + "/user/{username}" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Get user by user name", + "operationId" : "getUserByName", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be fetched. Use user1 for testing.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + } + }, + "400" : { + "description" : "Invalid username supplied", + "content" : { } + }, + "404" : { + "description" : "User not found", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "getUserByName", + "x-serviceid-varname" : "GETUSERBYNAME_SERVICE_ID" + }, + "put" : { + "tags" : [ "user" ], + "summary" : "Updated user", + "description" : "This can only be done by the logged in user.", + "operationId" : "updateUser", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "name that need to be deleted", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Updated user object", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, + "responses" : { + "400" : { + "description" : "Invalid user supplied", + "content" : { } + }, + "404" : { + "description" : "User not found", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "updateUser", + "x-serviceid-varname" : "UPDATEUSER_SERVICE_ID" + }, + "delete" : { + "tags" : [ "user" ], + "summary" : "Delete user", + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be deleted", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied", + "content" : { } + }, + "404" : { + "description" : "User not found", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "deleteUser", + "x-serviceid-varname" : "DELETEUSER_SERVICE_ID" + } + } + }, + "components" : { + "schemas" : { + "Order" : { + "title" : "Pet Order", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } + }, + "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" + }, + "xml" : { + "name" : "Order" + } + }, + "Category" : { + "title" : "Pet category", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, + "xml" : { + "name" : "Category" + } + }, + "User" : { + "title" : "a User", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "type" : "integer", + "description" : "User Status", + "format" : "int32" + } + }, + "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" + }, + "xml" : { + "name" : "User" + } + }, + "Tag" : { + "title" : "Pet Tag", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, + "xml" : { + "name" : "Tag" + } + }, + "Pet" : { + "title" : "a Pet", + "required" : [ "name", "photoUrls" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "type" : "string", + "example" : "doggie" + }, + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } + }, + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/components/schemas/Tag" + } + }, + "status" : { + "type" : "string", + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] + } + }, + "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" + }, + "xml" : { + "name" : "Pet" + } + }, + "ApiResponse" : { + "title" : "An uploaded response", + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "description" : "Describes the result of uploading an image resource" + } + }, + "securitySchemes" : { + "petstore_auth" : { + "type" : "oauth2", + "flows" : { + "implicit" : { + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + } + } + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + } + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/async/src/main/resources/swagger.json b/samples/server/petstore/java-vertx/async/src/main/resources/swagger.json deleted file mode 100644 index 1535f18c6e..0000000000 --- a/samples/server/petstore/java-vertx/async/src/main/resources/swagger.json +++ /dev/null @@ -1,860 +0,0 @@ -{ - "swagger" : "2.0", - "info" : { - "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", - "version" : "1.0.0", - "title" : "Swagger Petstore", - "termsOfService" : "http://swagger.io/terms/", - "contact" : { - "email" : "apiteam@swagger.io" - }, - "license" : { - "name" : "Apache-2.0", - "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "host" : "petstore.swagger.io", - "basePath" : "/v2", - "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets", - "externalDocs" : { - "description" : "Find out more", - "url" : "http://swagger.io" - } - }, { - "name" : "store", - "description" : "Access to Petstore orders" - }, { - "name" : "user", - "description" : "Operations about user", - "externalDocs" : { - "description" : "Find out more about our store", - "url" : "http://swagger.io" - } - } ], - "schemes" : [ "http" ], - "paths" : { - "/pet" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "description" : "", - "operationId" : "addPet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "description" : "", - "operationId" : "updatePet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - }, - "405" : { - "description" : "Validation exception" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/pet/findByStatus" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by status", - "description" : "Multiple status values can be provided with comma separated strings", - "operationId" : "findPetsByStatus", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "status", - "in" : "query", - "description" : "Status values that need to be considered for filter", - "required" : true, - "type" : "array", - "items" : { - "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid status value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-accepts" : "application/json" - } - }, - "/pet/findByTags" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", - "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - "operationId" : "findPetsByTags", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "tags", - "in" : "query", - "description" : "Tags to filter by", - "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid tag value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "deprecated" : true, - "x-accepts" : "application/json" - } - }, - "/pet/{petId}" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Find pet by ID", - "description" : "Returns a single pet", - "operationId" : "getPetById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to return", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Pet" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "x-accepts" : "application/json" - }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Updates a pet in the store with form data", - "description" : "", - "operationId" : "updatePetWithForm", - "consumes" : [ "application/x-www-form-urlencoded" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet that needs to be updated", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "name", - "in" : "formData", - "description" : "Updated name of the pet", - "required" : false, - "type" : "string" - }, { - "name" : "status", - "in" : "formData", - "description" : "Updated status of the pet", - "required" : false, - "type" : "string" - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { - "tags" : [ "pet" ], - "summary" : "Deletes a pet", - "description" : "", - "operationId" : "deletePet", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "api_key", - "in" : "header", - "required" : false, - "type" : "string" - }, { - "name" : "petId", - "in" : "path", - "description" : "Pet id to delete", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "400" : { - "description" : "Invalid pet value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-accepts" : "application/json" - } - }, - "/pet/{petId}/uploadImage" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", - "description" : "", - "operationId" : "uploadFile", - "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to update", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "additionalMetadata", - "in" : "formData", - "description" : "Additional data to pass to server", - "required" : false, - "type" : "string" - }, { - "name" : "file", - "in" : "formData", - "description" : "file to upload", - "required" : false, - "type" : "file" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ApiResponse" - } - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-contentType" : "multipart/form-data", - "x-accepts" : "application/json" - } - }, - "/store/inventory" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Returns pet inventories by status", - "description" : "Returns a map of status codes to quantities", - "operationId" : "getInventory", - "produces" : [ "application/json" ], - "parameters" : [ ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int32" - } - } - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "x-accepts" : "application/json" - } - }, - "/store/order" : { - "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", - "description" : "", - "operationId" : "placeOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "order placed for purchasing the pet", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Order" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid Order" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/store/order/{orderId}" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Find purchase order by ID", - "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - "operationId" : "getOrderById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of pet that needs to be fetched", - "required" : true, - "type" : "integer", - "maximum" : 5, - "minimum" : 1, - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - }, - "x-accepts" : "application/json" - }, - "delete" : { - "tags" : [ "store" ], - "summary" : "Delete purchase order by ID", - "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - "operationId" : "deleteOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of the order that needs to be deleted", - "required" : true, - "type" : "string" - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - }, - "x-accepts" : "application/json" - } - }, - "/user" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Create user", - "description" : "This can only be done by the logged in user.", - "operationId" : "createUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Created user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/user/createWithArray" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithArrayInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/user/createWithList" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithListInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/user/login" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", - "description" : "", - "operationId" : "loginUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "query", - "description" : "The user name for login", - "required" : true, - "type" : "string" - }, { - "name" : "password", - "in" : "query", - "description" : "The password for login in clear text", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "string" - }, - "headers" : { - "X-Rate-Limit" : { - "type" : "integer", - "format" : "int32", - "description" : "calls per hour allowed by the user" - }, - "X-Expires-After" : { - "type" : "string", - "format" : "date-time", - "description" : "date in UTC when toekn expires" - } - } - }, - "400" : { - "description" : "Invalid username/password supplied" - } - }, - "x-accepts" : "application/json" - } - }, - "/user/logout" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", - "description" : "", - "operationId" : "logoutUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ ], - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "x-accepts" : "application/json" - } - }, - "/user/{username}" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Get user by user name", - "description" : "", - "operationId" : "getUserByName", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be fetched. Use user1 for testing. ", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/User" - } - }, - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "x-accepts" : "application/json" - }, - "put" : { - "tags" : [ "user" ], - "summary" : "Updated user", - "description" : "This can only be done by the logged in user.", - "operationId" : "updateUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "name that need to be deleted", - "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "description" : "Updated user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid user supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "delete" : { - "tags" : [ "user" ], - "summary" : "Delete user", - "description" : "This can only be done by the logged in user.", - "operationId" : "deleteUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be deleted", - "required" : true, - "type" : "string" - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "x-accepts" : "application/json" - } - } - }, - "securityDefinitions" : { - "petstore_auth" : { - "type" : "oauth2", - "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", - "flow" : "implicit", - "scopes" : { - "write:pets" : "modify pets in your account", - "read:pets" : "read your pets" - } - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - } - }, - "definitions" : { - "Order" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] - }, - "complete" : { - "type" : "boolean", - "default" : false - } - }, - "title" : "Pet Order", - "description" : "An order for a pets from the pet store", - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet category", - "description" : "A category for a pet", - "xml" : { - "name" : "Category" - } - }, - "User" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "username" : { - "type" : "string" - }, - "firstName" : { - "type" : "string" - }, - "lastName" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "password" : { - "type" : "string" - }, - "phone" : { - "type" : "string" - }, - "userStatus" : { - "type" : "integer", - "format" : "int32", - "description" : "User Status" - } - }, - "title" : "a User", - "description" : "A User who is purchasing from the pet store", - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet Tag", - "description" : "A tag for a pet", - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "type" : "object", - "required" : [ "name", "photoUrls" ], - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "category" : { - "$ref" : "#/definitions/Category" - }, - "name" : { - "type" : "string", - "example" : "doggie" - }, - "photoUrls" : { - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true - }, - "items" : { - "type" : "string" - } - }, - "tags" : { - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true - }, - "items" : { - "$ref" : "#/definitions/Tag" - } - }, - "status" : { - "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, - "title" : "a Pet", - "description" : "A pet for sale in the pet store", - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - }, - "title" : "An uploaded response", - "description" : "Describes the result of uploading an image resource" - } - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" - } -} \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/.openapi-generator-ignore b/samples/server/petstore/java-vertx/rx/.openapi-generator-ignore index c5fa491b4c..7484ee590a 100644 --- a/samples/server/petstore/java-vertx/rx/.openapi-generator-ignore +++ b/samples/server/petstore/java-vertx/rx/.openapi-generator-ignore @@ -1,11 +1,11 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen +# 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 Swagger Codgen to ignore just this file by uncommenting the following line: +# 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 (*): diff --git a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION index 855ff9501e..096bf47efe 100644 --- a/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx/rx/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/README.md b/samples/server/petstore/java-vertx/rx/README.md index 4e3fdccda9..e69de29bb2 100644 --- a/samples/server/petstore/java-vertx/rx/README.md +++ b/samples/server/petstore/java-vertx/rx/README.md @@ -1 +0,0 @@ -Project generated on : 2017-07-08T16:03:26.358+02:00 diff --git a/samples/server/petstore/java-vertx/rx/pom.xml b/samples/server/petstore/java-vertx/rx/pom.xml index 390b703a76..2a914afc4e 100644 --- a/samples/server/petstore/java-vertx/rx/pom.xml +++ b/samples/server/petstore/java-vertx/rx/pom.xml @@ -2,7 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 - io.swagger + org.openapitools java-vertx-rx-server 1.0.0-SNAPSHOT jar @@ -28,24 +28,25 @@ test - - io.vertx - vertx-unit - ${vertx.version} - test - + + io.vertx + vertx-unit + ${vertx.version} + test + - com.github.phiz71 - vertx-swagger-router - ${vertx-swagger-router.version} - + com.github.phiz71 + vertx-swagger-router + ${vertx-swagger-router.version} + + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-datatype-jsr310.version} + - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-datatype-jsr310.version} - @@ -75,7 +76,7 @@ implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> io.vertx.core.Starter - io.swagger.server.api.MainApiVerticle + org.openapitools.server.api.MainApiVerticle @@ -87,4 +88,4 @@ - + \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/MainApiException.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiException.java similarity index 93% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/MainApiException.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiException.java index 8eb8f720d6..4aef710c01 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/MainApiException.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiException.java @@ -1,4 +1,4 @@ -package io.swagger.server.api; +package org.openapitools.server.api; public class MainApiException extends Exception { private int statusCode; diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/MainApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiVerticle.java similarity index 88% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/MainApiVerticle.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiVerticle.java index aabd70b44a..695ca48e59 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/MainApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/MainApiVerticle.java @@ -1,4 +1,4 @@ -package io.swagger.server.api; +package org.openapitools.server.api; import java.nio.charset.Charset; @@ -42,7 +42,7 @@ public class MainApiVerticle extends AbstractVerticle { public void start(Future startFuture) throws Exception { Json.mapper.registerModule(new JavaTimeModule()); FileSystem vertxFileSystem = vertx.fileSystem(); - vertxFileSystem.readFile("swagger.json", readFile -> { + vertxFileSystem.readFile("openapi.json", readFile -> { if (readFile.succeeded()) { Swagger swagger = new SwaggerParser().parse(readFile.result().toString(Charset.forName("utf-8"))); Router swaggerRouter = SwaggerRouter.swaggerRouter(router, swagger, vertx.eventBus(), new OperationIdServiceIdResolver()); @@ -66,7 +66,7 @@ public class MainApiVerticle extends AbstractVerticle { public void deployVerticles(Future startFuture) { - vertx.deployVerticle("io.swagger.server.api.verticle.PetApiVerticle", res -> { + vertx.deployVerticle("org.openapitools.server.api.verticle.PetApiVerticle", res -> { if (res.succeeded()) { LOGGER.info("PetApiVerticle : Deployed"); } else { @@ -75,7 +75,7 @@ public class MainApiVerticle extends AbstractVerticle { } }); - vertx.deployVerticle("io.swagger.server.api.verticle.StoreApiVerticle", res -> { + vertx.deployVerticle("org.openapitools.server.api.verticle.StoreApiVerticle", res -> { if (res.succeeded()) { LOGGER.info("StoreApiVerticle : Deployed"); } else { @@ -84,7 +84,7 @@ public class MainApiVerticle extends AbstractVerticle { } }); - vertx.deployVerticle("io.swagger.server.api.verticle.UserApiVerticle", res -> { + vertx.deployVerticle("org.openapitools.server.api.verticle.UserApiVerticle", res -> { if (res.succeeded()) { LOGGER.info("UserApiVerticle : Deployed"); } else { diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Category.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Category.java similarity index 97% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Category.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Category.java index 1065963542..58721d64cd 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Category.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Category.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/ModelApiResponse.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java similarity index 98% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/ModelApiResponse.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java index ef5261c7ed..60e1945bf1 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/ModelApiResponse.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/ModelApiResponse.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Order.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Order.java similarity index 98% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Order.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Order.java index 0eaaa46f35..1815414b55 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Order.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Order.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Pet.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Pet.java similarity index 96% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Pet.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Pet.java index e975a8dc2b..be9ab39a49 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Pet.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Pet.java @@ -1,13 +1,13 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.server.api.model.Category; -import io.swagger.server.api.model.Tag; import java.util.ArrayList; import java.util.List; +import org.openapitools.server.api.model.Category; +import org.openapitools.server.api.model.Tag; /** * A pet for sale in the pet store diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Tag.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Tag.java similarity index 97% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Tag.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Tag.java index f00a458e3d..acb51386a8 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/model/Tag.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/Tag.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/User.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/User.java similarity index 98% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/User.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/User.java index 6e7331cd23..fedd3d6207 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/model/User.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/model/User.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.model; +package org.openapitools.server.api.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApi.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApi.java similarity index 72% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApi.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApi.java index 755000999a..ed8784f284 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApi.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApi.java @@ -1,9 +1,9 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import java.io.File; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.ModelApiResponse; -import io.swagger.server.api.model.Pet; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.ModelApiResponse; +import org.openapitools.server.api.model.Pet; import rx.Completable; import rx.Single; @@ -13,7 +13,7 @@ import java.util.Map; public interface PetApi { //addPet - public Completable addPet(Pet body); + public Completable addPet(Pet pet); //deletePet public Completable deletePet(Long petId,String apiKey); @@ -28,7 +28,7 @@ public interface PetApi { public Single getPetById(Long petId); //updatePet - public Completable updatePet(Pet body); + public Completable updatePet(Pet pet); //updatePetWithForm public Completable updatePetWithForm(Long petId,String name,String status); diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiException.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiException.java similarity index 87% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiException.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiException.java index c618e243e0..3374dcfd63 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiException.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiException.java @@ -1,9 +1,9 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import java.io.File; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.ModelApiResponse; -import io.swagger.server.api.model.Pet; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.ModelApiResponse; +import org.openapitools.server.api.model.Pet; public final class PetApiException extends MainApiException { public PetApiException(int statusCode, String statusMessage) { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java similarity index 91% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java index c3999ff191..80f8a99f2e 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/PetApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/PetApiVerticle.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import io.vertx.core.AbstractVerticle; import io.vertx.core.eventbus.Message; @@ -9,9 +9,9 @@ import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; import java.io.File; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.ModelApiResponse; -import io.swagger.server.api.model.Pet; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.ModelApiResponse; +import org.openapitools.server.api.model.Pet; import java.util.List; import java.util.Map; @@ -32,7 +32,7 @@ public class PetApiVerticle extends AbstractVerticle { public PetApiVerticle() { try { - Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.PetApiImpl"); + Class serviceImplClass = getClass().getClassLoader().loadClass("org.openapitools.server.api.verticle.PetApiImpl"); service = (PetApi)serviceImplClass.newInstance(); } catch (Exception e) { logUnexpectedError("PetApiVerticle constructor", e); @@ -48,13 +48,13 @@ public class PetApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "addPet"; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject petParam = message.body().getJsonObject("Pet"); + if (petParam == null) { + manageError(message, new MainApiException(400, "Pet is required"), serviceId); return; } - Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); - service.addPet(body).subscribe( + Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class); + service.addPet(pet).subscribe( () -> { message.reply(null); }, @@ -172,13 +172,13 @@ public class PetApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "updatePet"; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject petParam = message.body().getJsonObject("Pet"); + if (petParam == null) { + manageError(message, new MainApiException(400, "Pet is required"), serviceId); return; } - Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class); - service.updatePet(body).subscribe( + Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class); + service.updatePet(pet).subscribe( () -> { message.reply(null); }, @@ -232,12 +232,8 @@ public class PetApiVerticle extends AbstractVerticle { Long petId = Json.mapper.readValue(petIdParam, Long.class); String additionalMetadataParam = message.body().getString("additionalMetadata"); String additionalMetadata = (additionalMetadataParam == null) ? null : additionalMetadataParam; - JsonObject fileParam = message.body().getJsonObject("file"); - if (fileParam == null) { - manageError(message, new MainApiException(400, "file is required"), serviceId); - return; - } - File file = Json.mapper.readValue(fileParam.encode(), File.class); + String fileParam = message.body().getString("file"); + File file = (fileParam == null) ? null : Json.mapper.readValue(fileParam, File.class); service.uploadFile(petId, additionalMetadata, file).subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApi.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApi.java similarity index 65% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApi.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApi.java index 54b242527f..fd43dcbbdb 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApi.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApi.java @@ -1,7 +1,7 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.Order; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.Order; import rx.Completable; import rx.Single; @@ -20,6 +20,6 @@ public interface StoreApi { public Single getOrderById(Long orderId); //placeOrder - public Single placeOrder(Order body); + public Single placeOrder(Order order); } diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiException.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiException.java similarity index 84% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiException.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiException.java index 3b8f0ab204..c8a3b7e5be 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiException.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiException.java @@ -1,7 +1,7 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.Order; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.Order; public final class StoreApiException extends MainApiException { public StoreApiException(int statusCode, String statusMessage) { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java similarity index 92% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java index 8d15fb4c04..ced8cdcbb9 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/StoreApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/StoreApiVerticle.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import io.vertx.core.AbstractVerticle; import io.vertx.core.eventbus.Message; @@ -8,8 +8,8 @@ import io.vertx.core.json.JsonObject; import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.Order; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.Order; import java.util.List; import java.util.Map; @@ -26,7 +26,7 @@ public class StoreApiVerticle extends AbstractVerticle { public StoreApiVerticle() { try { - Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.StoreApiImpl"); + Class serviceImplClass = getClass().getClassLoader().loadClass("org.openapitools.server.api.verticle.StoreApiImpl"); service = (StoreApi)serviceImplClass.newInstance(); } catch (Exception e) { logUnexpectedError("StoreApiVerticle constructor", e); @@ -108,13 +108,13 @@ public class StoreApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "placeOrder"; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject orderParam = message.body().getJsonObject("Order"); + if (orderParam == null) { + manageError(message, new MainApiException(400, "Order is required"), serviceId); return; } - Order body = Json.mapper.readValue(bodyParam.encode(), Order.class); - service.placeOrder(body).subscribe( + Order order = Json.mapper.readValue(orderParam.encode(), Order.class); + service.placeOrder(order).subscribe( result -> { message.reply(new JsonObject(Json.encode(result)).encodePrettily()); }, diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApi.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApi.java similarity index 58% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApi.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApi.java index 356d3c809a..20ddbbb533 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApi.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApi.java @@ -1,7 +1,7 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.User; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.User; import rx.Completable; import rx.Single; @@ -11,13 +11,13 @@ import java.util.Map; public interface UserApi { //createUser - public Completable createUser(User body); + public Completable createUser(User user); //createUsersWithArrayInput - public Completable createUsersWithArrayInput(List body); + public Completable createUsersWithArrayInput(List user); //createUsersWithListInput - public Completable createUsersWithListInput(List body); + public Completable createUsersWithListInput(List user); //deleteUser public Completable deleteUser(String username); @@ -32,6 +32,6 @@ public interface UserApi { public Completable logoutUser(); //updateUser - public Completable updateUser(String username,User body); + public Completable updateUser(String username,User user); } diff --git a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiException.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiException.java similarity index 88% rename from samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiException.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiException.java index 337f5b4353..b3714d11af 100644 --- a/samples/server/petstore/java-vertx/async/src/main/java/io/swagger/server/api/verticle/UserApiException.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiException.java @@ -1,7 +1,7 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.User; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.User; public final class UserApiException extends MainApiException { public UserApiException(int statusCode, String statusMessage) { diff --git a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java similarity index 88% rename from samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java rename to samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java index fb175bd559..2700bc5b24 100644 --- a/samples/server/petstore/java-vertx/rx/src/main/java/io/swagger/server/api/verticle/UserApiVerticle.java +++ b/samples/server/petstore/java-vertx/rx/src/main/java/org/openapitools/server/api/verticle/UserApiVerticle.java @@ -1,4 +1,4 @@ -package io.swagger.server.api.verticle; +package org.openapitools.server.api.verticle; import io.vertx.core.AbstractVerticle; import io.vertx.core.eventbus.Message; @@ -8,8 +8,8 @@ import io.vertx.core.json.JsonObject; import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; -import io.swagger.server.api.MainApiException; -import io.swagger.server.api.model.User; +import org.openapitools.server.api.MainApiException; +import org.openapitools.server.api.model.User; import java.util.List; import java.util.Map; @@ -30,7 +30,7 @@ public class UserApiVerticle extends AbstractVerticle { public UserApiVerticle() { try { - Class serviceImplClass = getClass().getClassLoader().loadClass("io.swagger.server.api.verticle.UserApiImpl"); + Class serviceImplClass = getClass().getClassLoader().loadClass("org.openapitools.server.api.verticle.UserApiImpl"); service = (UserApi)serviceImplClass.newInstance(); } catch (Exception e) { logUnexpectedError("UserApiVerticle constructor", e); @@ -46,13 +46,13 @@ public class UserApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUser"; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject userParam = message.body().getJsonObject("User"); + if (userParam == null) { + manageError(message, new MainApiException(400, "User is required"), serviceId); return; } - User body = Json.mapper.readValue(bodyParam.encode(), User.class); - service.createUser(body).subscribe( + User user = Json.mapper.readValue(userParam.encode(), User.class); + service.createUser(user).subscribe( () -> { message.reply(null); }, @@ -70,14 +70,14 @@ public class UserApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUsersWithArrayInput"; - JsonArray bodyParam = message.body().getJsonArray("body"); - if(bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonArray userParam = message.body().getJsonArray("User"); + if(userParam == null) { + manageError(message, new MainApiException(400, "User is required"), serviceId); return; } - List body = Json.mapper.readValue(bodyParam.encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); - service.createUsersWithArrayInput(body).subscribe( + List user = Json.mapper.readValue(userParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class)); + service.createUsersWithArrayInput(user).subscribe( () -> { message.reply(null); }, @@ -95,14 +95,14 @@ public class UserApiVerticle extends AbstractVerticle { try { // Workaround for #allParams section clearing the vendorExtensions map String serviceId = "createUsersWithListInput"; - JsonArray bodyParam = message.body().getJsonArray("body"); - if(bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonArray userParam = message.body().getJsonArray("User"); + if(userParam == null) { + manageError(message, new MainApiException(400, "User is required"), serviceId); return; } - List body = Json.mapper.readValue(bodyParam.encode(), - Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class)); - service.createUsersWithListInput(body).subscribe( + List user = Json.mapper.readValue(userParam.encode(), + Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class)); + service.createUsersWithListInput(user).subscribe( () -> { message.reply(null); }, @@ -222,13 +222,13 @@ public class UserApiVerticle extends AbstractVerticle { return; } String username = usernameParam; - JsonObject bodyParam = message.body().getJsonObject("body"); - if (bodyParam == null) { - manageError(message, new MainApiException(400, "body is required"), serviceId); + JsonObject userParam = message.body().getJsonObject("User"); + if (userParam == null) { + manageError(message, new MainApiException(400, "User is required"), serviceId); return; } - User body = Json.mapper.readValue(bodyParam.encode(), User.class); - service.updateUser(username, body).subscribe( + User user = Json.mapper.readValue(userParam.encode(), User.class); + service.updateUser(username, user).subscribe( () -> { message.reply(null); }, diff --git a/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json b/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json new file mode 100644 index 0000000000..6ccb348dca --- /dev/null +++ b/samples/server/petstore/java-vertx/rx/src/main/resources/openapi.json @@ -0,0 +1,1083 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Swagger Petstore", + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "termsOfService" : "http://swagger.io/terms/", + "contact" : { + "email" : "apiteam@swagger.io" + }, + "license" : { + "name" : "Apache-2.0", + "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" + }, + "version" : "1.0.0" + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + }, + "servers" : [ { + "url" : "http://petstore.swagger.io/v2" + } ], + "tags" : [ { + "name" : "pet", + "description" : "Everything about your Pets", + "externalDocs" : { + "description" : "Find out more", + "url" : "http://swagger.io" + } + }, { + "name" : "store", + "description" : "Access to Petstore orders" + }, { + "name" : "user", + "description" : "Operations about user", + "externalDocs" : { + "description" : "Find out more about our store", + "url" : "http://swagger.io" + } + } ], + "paths" : { + "/pet" : { + "put" : { + "tags" : [ "pet" ], + "summary" : "Update an existing pet", + "operationId" : "updatePet", + "requestBody" : { + "description" : "Pet object that needs to be added to the store", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "required" : true + }, + "responses" : { + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Pet not found", + "content" : { } + }, + "405" : { + "description" : "Validation exception", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "application/json", + "x-accepts" : "application/json", + "x-serviceid" : "updatePet", + "x-serviceid-varname" : "UPDATEPET_SERVICE_ID" + }, + "post" : { + "tags" : [ "pet" ], + "summary" : "Add a new pet to the store", + "operationId" : "addPet", + "requestBody" : { + "description" : "Pet object that needs to be added to the store", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "required" : true + }, + "responses" : { + "405" : { + "description" : "Invalid input", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "application/json", + "x-accepts" : "application/json", + "x-serviceid" : "addPet", + "x-serviceid-varname" : "ADDPET_SERVICE_ID" + } + }, + "/pet/findByStatus" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by status", + "description" : "Multiple status values can be provided with comma separated strings", + "operationId" : "findPetsByStatus", + "parameters" : [ { + "name" : "status", + "in" : "query", + "description" : "Status values that need to be considered for filter", + "required" : true, + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string", + "default" : "available", + "enum" : [ "available", "pending", "sold" ] + } + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + } + } + }, + "400" : { + "description" : "Invalid status value", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "findPetsByStatus", + "x-serviceid-varname" : "FINDPETSBYSTATUS_SERVICE_ID" + } + }, + "/pet/findByTags" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Finds Pets by tags", + "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + "operationId" : "findPetsByTags", + "parameters" : [ { + "name" : "tags", + "in" : "query", + "description" : "Tags to filter by", + "required" : true, + "explode" : false, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "application/json" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Pet" + } + } + } + } + }, + "400" : { + "description" : "Invalid tag value", + "content" : { } + } + }, + "deprecated" : true, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "findPetsByTags", + "x-serviceid-varname" : "FINDPETSBYTAGS_SERVICE_ID" + } + }, + "/pet/{petId}" : { + "get" : { + "tags" : [ "pet" ], + "summary" : "Find pet by ID", + "description" : "Returns a single pet", + "operationId" : "getPetById", + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to return", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + } + }, + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Pet not found", + "content" : { } + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "getPetById", + "x-serviceid-varname" : "GETPETBYID_SERVICE_ID" + }, + "post" : { + "tags" : [ "pet" ], + "summary" : "Updates a pet in the store with form data", + "operationId" : "updatePetWithForm", + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet that needs to be updated", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "requestBody" : { + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "properties" : { + "name" : { + "type" : "string", + "description" : "Updated name of the pet" + }, + "status" : { + "type" : "string", + "description" : "Updated status of the pet" + } + } + } + } + } + }, + "responses" : { + "405" : { + "description" : "Invalid input", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "application/x-www-form-urlencoded", + "x-accepts" : "application/json", + "x-serviceid" : "updatePetWithForm", + "x-serviceid-varname" : "UPDATEPETWITHFORM_SERVICE_ID" + }, + "delete" : { + "tags" : [ "pet" ], + "summary" : "Deletes a pet", + "operationId" : "deletePet", + "parameters" : [ { + "name" : "api_key", + "in" : "header", + "schema" : { + "type" : "string" + } + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid pet value", + "content" : { } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "deletePet", + "x-serviceid-varname" : "DELETEPET_SERVICE_ID" + } + }, + "/pet/{petId}/uploadImage" : { + "post" : { + "tags" : [ "pet" ], + "summary" : "uploads an image", + "operationId" : "uploadFile", + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to update", + "required" : true, + "schema" : { + "type" : "integer", + "format" : "int64" + } + } ], + "requestBody" : { + "content" : { + "multipart/form-data" : { + "schema" : { + "properties" : { + "additionalMetadata" : { + "type" : "string", + "description" : "Additional data to pass to server" + }, + "file" : { + "type" : "string", + "description" : "file to upload", + "format" : "binary" + } + } + } + } + } + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/ApiResponse" + } + } + } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "x-contentType" : "multipart/form-data", + "x-accepts" : "application/json", + "x-serviceid" : "uploadFile", + "x-serviceid-varname" : "UPLOADFILE_SERVICE_ID" + } + }, + "/store/inventory" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Returns pet inventories by status", + "description" : "Returns a map of status codes to quantities", + "operationId" : "getInventory", + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "type" : "object", + "additionalProperties" : { + "type" : "integer", + "format" : "int32" + } + } + } + } + } + }, + "security" : [ { + "api_key" : [ ] + } ], + "x-accepts" : "application/json", + "x-serviceid" : "getInventory", + "x-serviceid-varname" : "GETINVENTORY_SERVICE_ID" + } + }, + "/store/order" : { + "post" : { + "tags" : [ "store" ], + "summary" : "Place an order for a pet", + "operationId" : "placeOrder", + "requestBody" : { + "description" : "order placed for purchasing the pet", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + } + }, + "400" : { + "description" : "Invalid Order", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "placeOrder", + "x-serviceid-varname" : "PLACEORDER_SERVICE_ID" + } + }, + "/store/order/{orderId}" : { + "get" : { + "tags" : [ "store" ], + "summary" : "Find purchase order by ID", + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of pet that needs to be fetched", + "required" : true, + "schema" : { + "maximum" : 5, + "minimum" : 1, + "type" : "integer", + "format" : "int64" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + } + }, + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Order not found", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "getOrderById", + "x-serviceid-varname" : "GETORDERBYID_SERVICE_ID" + }, + "delete" : { + "tags" : [ "store" ], + "summary" : "Delete purchase order by ID", + "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", + "operationId" : "deleteOrder", + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid ID supplied", + "content" : { } + }, + "404" : { + "description" : "Order not found", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "deleteOrder", + "x-serviceid-varname" : "DELETEORDER_SERVICE_ID" + } + }, + "/user" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Create user", + "description" : "This can only be done by the logged in user.", + "operationId" : "createUser", + "requestBody" : { + "description" : "Created user object", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, + "responses" : { + "default" : { + "description" : "successful operation", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "createUser", + "x-serviceid-varname" : "CREATEUSER_SERVICE_ID" + } + }, + "/user/createWithArray" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "operationId" : "createUsersWithArrayInput", + "requestBody" : { + "description" : "List of user object", + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } + } + }, + "required" : true + }, + "responses" : { + "default" : { + "description" : "successful operation", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "createUsersWithArrayInput", + "x-serviceid-varname" : "CREATEUSERSWITHARRAYINPUT_SERVICE_ID" + } + }, + "/user/createWithList" : { + "post" : { + "tags" : [ "user" ], + "summary" : "Creates list of users with given input array", + "operationId" : "createUsersWithListInput", + "requestBody" : { + "description" : "List of user object", + "content" : { + "*/*" : { + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/User" + } + } + } + }, + "required" : true + }, + "responses" : { + "default" : { + "description" : "successful operation", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "createUsersWithListInput", + "x-serviceid-varname" : "CREATEUSERSWITHLISTINPUT_SERVICE_ID" + } + }, + "/user/login" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs user into the system", + "operationId" : "loginUser", + "parameters" : [ { + "name" : "username", + "in" : "query", + "description" : "The user name for login", + "required" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "description" : "calls per hour allowed by the user", + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, + "X-Expires-After" : { + "description" : "date in UTC when toekn expires", + "schema" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + } + }, + "400" : { + "description" : "Invalid username/password supplied", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "loginUser", + "x-serviceid-varname" : "LOGINUSER_SERVICE_ID" + } + }, + "/user/logout" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Logs out current logged in user session", + "operationId" : "logoutUser", + "responses" : { + "default" : { + "description" : "successful operation", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "logoutUser", + "x-serviceid-varname" : "LOGOUTUSER_SERVICE_ID" + } + }, + "/user/{username}" : { + "get" : { + "tags" : [ "user" ], + "summary" : "Get user by user name", + "operationId" : "getUserByName", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be fetched. Use user1 for testing.", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + } + }, + "400" : { + "description" : "Invalid username supplied", + "content" : { } + }, + "404" : { + "description" : "User not found", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "getUserByName", + "x-serviceid-varname" : "GETUSERBYNAME_SERVICE_ID" + }, + "put" : { + "tags" : [ "user" ], + "summary" : "Updated user", + "description" : "This can only be done by the logged in user.", + "operationId" : "updateUser", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "name that need to be deleted", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "description" : "Updated user object", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/User" + } + } + }, + "required" : true + }, + "responses" : { + "400" : { + "description" : "Invalid user supplied", + "content" : { } + }, + "404" : { + "description" : "User not found", + "content" : { } + } + }, + "x-contentType" : "*/*", + "x-accepts" : "application/json", + "x-serviceid" : "updateUser", + "x-serviceid-varname" : "UPDATEUSER_SERVICE_ID" + }, + "delete" : { + "tags" : [ "user" ], + "summary" : "Delete user", + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "name" : "username", + "in" : "path", + "description" : "The name that needs to be deleted", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid username supplied", + "content" : { } + }, + "404" : { + "description" : "User not found", + "content" : { } + } + }, + "x-accepts" : "application/json", + "x-serviceid" : "deleteUser", + "x-serviceid-varname" : "DELETEUSER_SERVICE_ID" + } + } + }, + "components" : { + "schemas" : { + "Order" : { + "title" : "Pet Order", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "petId" : { + "type" : "integer", + "format" : "int64" + }, + "quantity" : { + "type" : "integer", + "format" : "int32" + }, + "shipDate" : { + "type" : "string", + "format" : "date-time" + }, + "status" : { + "type" : "string", + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ] + }, + "complete" : { + "type" : "boolean", + "default" : false + } + }, + "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" + }, + "xml" : { + "name" : "Order" + } + }, + "Category" : { + "title" : "Pet category", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + }, + "xml" : { + "name" : "Category" + } + }, + "User" : { + "title" : "a User", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "username" : { + "type" : "string" + }, + "firstName" : { + "type" : "string" + }, + "lastName" : { + "type" : "string" + }, + "email" : { + "type" : "string" + }, + "password" : { + "type" : "string" + }, + "phone" : { + "type" : "string" + }, + "userStatus" : { + "type" : "integer", + "description" : "User Status", + "format" : "int32" + } + }, + "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" + }, + "xml" : { + "name" : "User" + } + }, + "Tag" : { + "title" : "Pet Tag", + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + }, + "xml" : { + "name" : "Tag" + } + }, + "Pet" : { + "title" : "a Pet", + "required" : [ "name", "photoUrls" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "type" : "string", + "example" : "doggie" + }, + "photoUrls" : { + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + }, + "items" : { + "type" : "string" + } + }, + "tags" : { + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + }, + "items" : { + "$ref" : "#/components/schemas/Tag" + } + }, + "status" : { + "type" : "string", + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ] + } + }, + "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" + }, + "xml" : { + "name" : "Pet" + } + }, + "ApiResponse" : { + "title" : "An uploaded response", + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "description" : "Describes the result of uploading an image resource" + } + }, + "securitySchemes" : { + "petstore_auth" : { + "type" : "oauth2", + "flows" : { + "implicit" : { + "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", + "scopes" : { + "write:pets" : "modify pets in your account", + "read:pets" : "read your pets" + } + } + } + }, + "api_key" : { + "type" : "apiKey", + "name" : "api_key", + "in" : "header" + } + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/java-vertx/rx/src/main/resources/swagger.json b/samples/server/petstore/java-vertx/rx/src/main/resources/swagger.json deleted file mode 100644 index 1535f18c6e..0000000000 --- a/samples/server/petstore/java-vertx/rx/src/main/resources/swagger.json +++ /dev/null @@ -1,860 +0,0 @@ -{ - "swagger" : "2.0", - "info" : { - "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", - "version" : "1.0.0", - "title" : "Swagger Petstore", - "termsOfService" : "http://swagger.io/terms/", - "contact" : { - "email" : "apiteam@swagger.io" - }, - "license" : { - "name" : "Apache-2.0", - "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "host" : "petstore.swagger.io", - "basePath" : "/v2", - "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets", - "externalDocs" : { - "description" : "Find out more", - "url" : "http://swagger.io" - } - }, { - "name" : "store", - "description" : "Access to Petstore orders" - }, { - "name" : "user", - "description" : "Operations about user", - "externalDocs" : { - "description" : "Find out more about our store", - "url" : "http://swagger.io" - } - } ], - "schemes" : [ "http" ], - "paths" : { - "/pet" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "description" : "", - "operationId" : "addPet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "description" : "", - "operationId" : "updatePet", - "consumes" : [ "application/json", "application/xml" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Pet object that needs to be added to the store", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Pet" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - }, - "405" : { - "description" : "Validation exception" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/pet/findByStatus" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by status", - "description" : "Multiple status values can be provided with comma separated strings", - "operationId" : "findPetsByStatus", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "status", - "in" : "query", - "description" : "Status values that need to be considered for filter", - "required" : true, - "type" : "array", - "items" : { - "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid status value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-accepts" : "application/json" - } - }, - "/pet/findByTags" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", - "description" : "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - "operationId" : "findPetsByTags", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "tags", - "in" : "query", - "description" : "Tags to filter by", - "required" : true, - "type" : "array", - "items" : { - "type" : "string" - }, - "collectionFormat" : "csv" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/Pet" - } - } - }, - "400" : { - "description" : "Invalid tag value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "deprecated" : true, - "x-accepts" : "application/json" - } - }, - "/pet/{petId}" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Find pet by ID", - "description" : "Returns a single pet", - "operationId" : "getPetById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to return", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Pet" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "x-accepts" : "application/json" - }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Updates a pet in the store with form data", - "description" : "", - "operationId" : "updatePetWithForm", - "consumes" : [ "application/x-www-form-urlencoded" ], - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet that needs to be updated", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "name", - "in" : "formData", - "description" : "Updated name of the pet", - "required" : false, - "type" : "string" - }, { - "name" : "status", - "in" : "formData", - "description" : "Updated status of the pet", - "required" : false, - "type" : "string" - } ], - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { - "tags" : [ "pet" ], - "summary" : "Deletes a pet", - "description" : "", - "operationId" : "deletePet", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "api_key", - "in" : "header", - "required" : false, - "type" : "string" - }, { - "name" : "petId", - "in" : "path", - "description" : "Pet id to delete", - "required" : true, - "type" : "integer", - "format" : "int64" - } ], - "responses" : { - "400" : { - "description" : "Invalid pet value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-accepts" : "application/json" - } - }, - "/pet/{petId}/uploadImage" : { - "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", - "description" : "", - "operationId" : "uploadFile", - "consumes" : [ "multipart/form-data" ], - "produces" : [ "application/json" ], - "parameters" : [ { - "name" : "petId", - "in" : "path", - "description" : "ID of pet to update", - "required" : true, - "type" : "integer", - "format" : "int64" - }, { - "name" : "additionalMetadata", - "in" : "formData", - "description" : "Additional data to pass to server", - "required" : false, - "type" : "string" - }, { - "name" : "file", - "in" : "formData", - "description" : "file to upload", - "required" : false, - "type" : "file" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/ApiResponse" - } - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "x-contentType" : "multipart/form-data", - "x-accepts" : "application/json" - } - }, - "/store/inventory" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Returns pet inventories by status", - "description" : "Returns a map of status codes to quantities", - "operationId" : "getInventory", - "produces" : [ "application/json" ], - "parameters" : [ ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "object", - "additionalProperties" : { - "type" : "integer", - "format" : "int32" - } - } - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "x-accepts" : "application/json" - } - }, - "/store/order" : { - "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", - "description" : "", - "operationId" : "placeOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "order placed for purchasing the pet", - "required" : true, - "schema" : { - "$ref" : "#/definitions/Order" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid Order" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/store/order/{orderId}" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Find purchase order by ID", - "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - "operationId" : "getOrderById", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of pet that needs to be fetched", - "required" : true, - "type" : "integer", - "maximum" : 5, - "minimum" : 1, - "format" : "int64" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/Order" - } - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - }, - "x-accepts" : "application/json" - }, - "delete" : { - "tags" : [ "store" ], - "summary" : "Delete purchase order by ID", - "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - "operationId" : "deleteOrder", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "orderId", - "in" : "path", - "description" : "ID of the order that needs to be deleted", - "required" : true, - "type" : "string" - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - }, - "x-accepts" : "application/json" - } - }, - "/user" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Create user", - "description" : "This can only be done by the logged in user.", - "operationId" : "createUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "Created user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/user/createWithArray" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithArrayInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/user/createWithList" : { - "post" : { - "tags" : [ "user" ], - "summary" : "Creates list of users with given input array", - "description" : "", - "operationId" : "createUsersWithListInput", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "in" : "body", - "name" : "body", - "description" : "List of user object", - "required" : true, - "schema" : { - "type" : "array", - "items" : { - "$ref" : "#/definitions/User" - } - } - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - } - }, - "/user/login" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", - "description" : "", - "operationId" : "loginUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "query", - "description" : "The user name for login", - "required" : true, - "type" : "string" - }, { - "name" : "password", - "in" : "query", - "description" : "The password for login in clear text", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "type" : "string" - }, - "headers" : { - "X-Rate-Limit" : { - "type" : "integer", - "format" : "int32", - "description" : "calls per hour allowed by the user" - }, - "X-Expires-After" : { - "type" : "string", - "format" : "date-time", - "description" : "date in UTC when toekn expires" - } - } - }, - "400" : { - "description" : "Invalid username/password supplied" - } - }, - "x-accepts" : "application/json" - } - }, - "/user/logout" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", - "description" : "", - "operationId" : "logoutUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ ], - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "x-accepts" : "application/json" - } - }, - "/user/{username}" : { - "get" : { - "tags" : [ "user" ], - "summary" : "Get user by user name", - "description" : "", - "operationId" : "getUserByName", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be fetched. Use user1 for testing. ", - "required" : true, - "type" : "string" - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "schema" : { - "$ref" : "#/definitions/User" - } - }, - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "x-accepts" : "application/json" - }, - "put" : { - "tags" : [ "user" ], - "summary" : "Updated user", - "description" : "This can only be done by the logged in user.", - "operationId" : "updateUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "name that need to be deleted", - "required" : true, - "type" : "string" - }, { - "in" : "body", - "name" : "body", - "description" : "Updated user object", - "required" : true, - "schema" : { - "$ref" : "#/definitions/User" - } - } ], - "responses" : { - "400" : { - "description" : "Invalid user supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "delete" : { - "tags" : [ "user" ], - "summary" : "Delete user", - "description" : "This can only be done by the logged in user.", - "operationId" : "deleteUser", - "produces" : [ "application/xml", "application/json" ], - "parameters" : [ { - "name" : "username", - "in" : "path", - "description" : "The name that needs to be deleted", - "required" : true, - "type" : "string" - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "x-accepts" : "application/json" - } - } - }, - "securityDefinitions" : { - "petstore_auth" : { - "type" : "oauth2", - "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", - "flow" : "implicit", - "scopes" : { - "write:pets" : "modify pets in your account", - "read:pets" : "read your pets" - } - }, - "api_key" : { - "type" : "apiKey", - "name" : "api_key", - "in" : "header" - } - }, - "definitions" : { - "Order" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "petId" : { - "type" : "integer", - "format" : "int64" - }, - "quantity" : { - "type" : "integer", - "format" : "int32" - }, - "shipDate" : { - "type" : "string", - "format" : "date-time" - }, - "status" : { - "type" : "string", - "description" : "Order Status", - "enum" : [ "placed", "approved", "delivered" ] - }, - "complete" : { - "type" : "boolean", - "default" : false - } - }, - "title" : "Pet Order", - "description" : "An order for a pets from the pet store", - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet category", - "description" : "A category for a pet", - "xml" : { - "name" : "Category" - } - }, - "User" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "username" : { - "type" : "string" - }, - "firstName" : { - "type" : "string" - }, - "lastName" : { - "type" : "string" - }, - "email" : { - "type" : "string" - }, - "password" : { - "type" : "string" - }, - "phone" : { - "type" : "string" - }, - "userStatus" : { - "type" : "integer", - "format" : "int32", - "description" : "User Status" - } - }, - "title" : "a User", - "description" : "A User who is purchasing from the pet store", - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet Tag", - "description" : "A tag for a pet", - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "type" : "object", - "required" : [ "name", "photoUrls" ], - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "category" : { - "$ref" : "#/definitions/Category" - }, - "name" : { - "type" : "string", - "example" : "doggie" - }, - "photoUrls" : { - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true - }, - "items" : { - "type" : "string" - } - }, - "tags" : { - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true - }, - "items" : { - "$ref" : "#/definitions/Tag" - } - }, - "status" : { - "type" : "string", - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ] - } - }, - "title" : "a Pet", - "description" : "A pet for sale in the pet store", - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - }, - "title" : "An uploaded response", - "description" : "Describes the result of uploading an image resource" - } - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" - } -} \ No newline at end of file