From f94ff32b0cbad527a34d0e2330e128d5323f8800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20C=C3=B4t=C3=A9?= Date: Tue, 27 Aug 2019 11:13:12 -0400 Subject: [PATCH] [Play Framework] Regenerate the samples. It was very outdated (#3760) * Generate the samples for Play Framework. It was very outdated * Add java-play-framework to the ensure-up-to-date script * Update samples --- bin/utils/ensure-up-to-date | 1 + .../.openapi-generator/VERSION | 2 +- .../app/apimodels/Category.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/User.java | 16 +- .../puppies/store/apis/PetApiController.java | 34 +- .../store/apis/PetApiControllerImp.java | 4 +- .../apis/PetApiControllerImpInterface.java | 4 +- .../store/apis/StoreApiController.java | 14 +- .../store/apis/StoreApiControllerImp.java | 2 +- .../apis/StoreApiControllerImpInterface.java | 2 +- .../puppies/store/apis/UserApiController.java | 56 +- .../store/apis/UserApiControllerImp.java | 8 +- .../apis/UserApiControllerImpInterface.java | 8 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../public/openapi.json | 875 ++--- .../.openapi-generator/VERSION | 2 +- .../app/apimodels/Category.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/User.java | 16 +- .../app/controllers/PetApiController.java | 141 +- .../app/controllers/PetApiControllerImp.java | 28 +- .../PetApiControllerImpInterface.java | 14 +- .../app/controllers/StoreApiController.java | 71 +- .../controllers/StoreApiControllerImp.java | 18 +- .../StoreApiControllerImpInterface.java | 8 +- .../app/controllers/UserApiController.java | 129 +- .../app/controllers/UserApiControllerImp.java | 20 +- .../UserApiControllerImpInterface.java | 14 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../public/openapi.json | 875 ++--- .../.openapi-generator/VERSION | 2 +- .../app/apimodels/Category.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/User.java | 16 +- .../app/controllers/PetApiController.java | 30 +- .../app/controllers/StoreApiController.java | 12 +- .../app/controllers/UserApiController.java | 48 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../public/openapi.json | 875 ++--- .../.openapi-generator/VERSION | 2 +- .../AdditionalPropertiesAnyType.java | 77 + .../apimodels/AdditionalPropertiesArray.java | 78 + .../AdditionalPropertiesBoolean.java | 77 + .../apimodels/AdditionalPropertiesClass.java | 320 +- .../AdditionalPropertiesInteger.java | 77 + .../apimodels/AdditionalPropertiesNumber.java | 78 + .../apimodels/AdditionalPropertiesObject.java | 77 + .../apimodels/AdditionalPropertiesString.java | 77 + .../app/apimodels/Animal.java | 2 +- .../app/apimodels/Capitalization.java | 12 +- .../app/apimodels/Cat.java | 3 +- .../app/apimodels/CatAllOf.java | 74 + .../app/apimodels/Category.java | 7 +- .../app/apimodels/ClassModel.java | 2 +- .../app/apimodels/Client.java | 2 +- .../app/apimodels/Dog.java | 3 +- .../app/apimodels/DogAllOf.java | 74 + .../app/apimodels/EnumArrays.java | 14 +- .../app/apimodels/EnumClass.java | 6 +- .../app/apimodels/EnumTest.java | 34 +- .../app/apimodels/FileSchemaTestClass.java | 2 +- .../app/apimodels/FormatTest.java | 26 +- .../app/apimodels/HasOnlyReadOnly.java | 4 +- .../app/apimodels/MapTest.java | 24 +- ...ropertiesAndAdditionalPropertiesClass.java | 4 +- .../app/apimodels/Model200Response.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/ModelReturn.java | 2 +- .../app/apimodels/Name.java | 8 +- .../app/apimodels/NumberOnly.java | 2 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/OuterComposite.java | 6 +- .../app/apimodels/OuterEnum.java | 6 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/ReadOnlyFirst.java | 4 +- .../app/apimodels/SpecialModelName.java | 2 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/TypeHolderDefault.java | 176 + .../app/apimodels/TypeHolderExample.java | 176 + .../app/apimodels/User.java | 16 +- .../app/apimodels/XmlItem.java | 770 +++++ .../controllers/AnotherFakeApiController.java | 16 +- .../AnotherFakeApiControllerImp.java | 2 +- .../AnotherFakeApiControllerImpInterface.java | 2 +- .../app/controllers/FakeApiController.java | 207 +- .../app/controllers/FakeApiControllerImp.java | 26 +- .../FakeApiControllerImpInterface.java | 17 +- .../FakeClassnameTags123ApiController.java | 14 +- .../FakeClassnameTags123ApiControllerImp.java | 2 +- ...snameTags123ApiControllerImpInterface.java | 2 +- .../app/controllers/PetApiController.java | 44 +- .../app/controllers/PetApiControllerImp.java | 6 +- .../PetApiControllerImpInterface.java | 6 +- .../app/controllers/StoreApiController.java | 14 +- .../controllers/StoreApiControllerImp.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../app/controllers/UserApiController.java | 56 +- .../app/controllers/UserApiControllerImp.java | 8 +- .../UserApiControllerImpInterface.java | 8 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../conf/routes | 5 +- .../public/openapi.json | 2905 ++++++++++------- .../.openapi-generator/VERSION | 2 +- .../app/apimodels/Category.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/User.java | 16 +- .../app/controllers/PetApiController.java | 30 +- .../app/controllers/PetApiControllerImp.java | 4 +- .../PetApiControllerImpInterface.java | 4 +- .../app/controllers/StoreApiController.java | 12 +- .../controllers/StoreApiControllerImp.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../app/controllers/UserApiController.java | 48 +- .../app/controllers/UserApiControllerImp.java | 8 +- .../UserApiControllerImpInterface.java | 8 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../public/openapi.json | 875 ++--- .../.openapi-generator/VERSION | 2 +- .../app/apimodels/Category.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/User.java | 16 +- .../app/controllers/PetApiController.java | 34 +- .../app/controllers/PetApiControllerImp.java | 4 +- .../PetApiControllerImpInterface.java | 4 +- .../app/controllers/StoreApiController.java | 14 +- .../controllers/StoreApiControllerImp.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../app/controllers/UserApiController.java | 56 +- .../app/controllers/UserApiControllerImp.java | 8 +- .../UserApiControllerImpInterface.java | 8 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../public/openapi.json | 875 ++--- .../.openapi-generator/VERSION | 2 +- .../app/apimodels/Category.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/User.java | 16 +- .../app/controllers/PetApiController.java | 34 +- .../app/controllers/PetApiControllerImp.java | 4 +- .../app/controllers/StoreApiController.java | 14 +- .../controllers/StoreApiControllerImp.java | 2 +- .../app/controllers/UserApiController.java | 56 +- .../app/controllers/UserApiControllerImp.java | 8 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../public/openapi.json | 875 ++--- .../.openapi-generator/VERSION | 2 +- .../app/apimodels/Category.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/User.java | 16 +- .../app/controllers/PetApiController.java | 34 +- .../app/controllers/PetApiControllerImp.java | 4 +- .../PetApiControllerImpInterface.java | 4 +- .../app/controllers/StoreApiController.java | 14 +- .../controllers/StoreApiControllerImp.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../app/controllers/UserApiController.java | 56 +- .../app/controllers/UserApiControllerImp.java | 8 +- .../UserApiControllerImpInterface.java | 8 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../.openapi-generator/VERSION | 2 +- .../app/apimodels/Category.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/User.java | 16 +- .../app/controllers/PetApiController.java | 34 +- .../app/controllers/PetApiControllerImp.java | 4 +- .../PetApiControllerImpInterface.java | 4 +- .../app/controllers/StoreApiController.java | 14 +- .../controllers/StoreApiControllerImp.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../app/controllers/UserApiController.java | 56 +- .../app/controllers/UserApiControllerImp.java | 8 +- .../UserApiControllerImpInterface.java | 8 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../public/openapi.json | 875 ++--- .../.openapi-generator/VERSION | 2 +- .../app/apimodels/Category.java | 4 +- .../app/apimodels/ModelApiResponse.java | 6 +- .../app/apimodels/Order.java | 16 +- .../app/apimodels/Pet.java | 14 +- .../app/apimodels/Tag.java | 4 +- .../app/apimodels/User.java | 16 +- .../app/controllers/PetApiController.java | 34 +- .../app/controllers/PetApiControllerImp.java | 4 +- .../PetApiControllerImpInterface.java | 4 +- .../app/controllers/StoreApiController.java | 14 +- .../controllers/StoreApiControllerImp.java | 2 +- .../StoreApiControllerImpInterface.java | 2 +- .../app/controllers/UserApiController.java | 56 +- .../app/controllers/UserApiControllerImp.java | 8 +- .../UserApiControllerImpInterface.java | 8 +- .../app/openapitools/OpenAPIUtils.java | 4 +- .../java-play-framework/public/openapi.json | 875 ++--- 216 files changed, 8807 insertions(+), 5933 deletions(-) create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java diff --git a/bin/utils/ensure-up-to-date b/bin/utils/ensure-up-to-date index a29346ad2cd..66e2fca4b52 100755 --- a/bin/utils/ensure-up-to-date +++ b/bin/utils/ensure-up-to-date @@ -62,6 +62,7 @@ declare -a scripts=( "./bin/dart-flutter-petstore.sh" "./bin/dart-petstore.sh" "./bin/dart2-petstore.sh" +"./bin/java-play-framework-petstore-server-all.sh" #"./bin/elm-petstore-all.sh" "./bin/meta-codegen.sh" # OTHERS diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java index 9f0206575f5..86c8ed0cdef 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Category.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java index 07493e84825..91638ac8c60 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java index d1aaa38d002..91d6d09e7f7 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Order.java @@ -13,16 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java index 5e5ff376294..627f21f8c09 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Pet.java @@ -16,13 +16,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java index 15a8774252a..1a9079ff345 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/Tag.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java index 689de768893..8df0a650670 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/apimodels/User.java @@ -12,28 +12,28 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java index 7932fea7b2a..253f6e33751 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiController.java @@ -39,17 +39,17 @@ public class PetApiController extends Controller { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public class PetApiController extends Controller { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public class PetApiController extends Controller { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java index 2eb66e8fbb9..8b6dde9c2d1 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImp.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java index 19b38fe2142..39679e11f45 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java index 2aaae94f8df..225d3009543 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiController.java @@ -61,17 +61,17 @@ public class StoreApiController extends Controller { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java index 4166031e908..fe2cf4f6808 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java index 387836d8380..4f2aadae998 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java index 8190c6f6f6a..5e103c7eeb6 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java @@ -38,53 +38,53 @@ public class UserApiController extends Controller { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public class UserApiController extends Controller { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java index 85a70248c4a..d53c2a82c11 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java @@ -12,17 +12,17 @@ import javax.validation.constraints.*; public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java index d103affead0..4904073cbc2 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java index c707ca74ac7..385ef97a008 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json index ac1d4504782..50b8a737319 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json +++ b/samples/server/petstore/java-play-framework-api-package-override/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,189 +39,222 @@ } } }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "responses" : { + "405" : { + "content" : { }, + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "post" : { + "summary" : "Update an existing pet", "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-codegen-request-body-name" : "body", "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", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ], - "default" : "available" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "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, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -236,34 +266,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -272,12 +303,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -349,13 +349,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -364,58 +364,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,71 +438,29 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "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", - "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" - }, "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { "type" : "string" @@ -511,25 +468,68 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "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" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -747,45 +776,23 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updated user", "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-codegen-request-body-name" : "body", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,35 +800,6 @@ "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, @@ -831,38 +809,76 @@ "complete" : false, "status" : "placed" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -883,89 +899,39 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "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" - }, + "title" : "a User", + "type" : "object", "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", "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" ], @@ -984,17 +950,62 @@ } ], "status" : "available" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1003,17 +1014,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1022,12 +1028,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } } diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java index 9f0206575f5..86c8ed0cdef 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Category.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java index 07493e84825..91638ac8c60 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java index d1aaa38d002..91d6d09e7f7 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Order.java @@ -13,16 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java index 5e5ff376294..627f21f8c09 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Pet.java @@ -16,13 +16,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java index 15a8774252a..1a9079ff345 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/Tag.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/apimodels/User.java b/samples/server/petstore/java-play-framework-async/app/apimodels/User.java index 689de768893..8df0a650670 100644 --- a/samples/server/petstore/java-play-framework-async/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-async/app/apimodels/User.java @@ -12,28 +12,28 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java index 0dd34c6888f..1344ffe7afb 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiController.java @@ -17,9 +17,6 @@ import java.io.File; import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; - import javax.validation.constraints.*; import play.Configuration; @@ -41,25 +38,23 @@ public class PetApiController extends Controller { @ApiAction - public CompletionStage addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + public Result addPet() throws Exception { + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.addPet(pet) - return ok(); - }); + imp.addPet(body); + return ok(); } @ApiAction - public CompletionStage deletePet(Long petId) throws Exception { + public Result deletePet(Long petId) throws Exception { String valueapiKey = request().getHeader("api_key"); String apiKey; if (valueapiKey != null) { @@ -67,14 +62,12 @@ public class PetApiController extends Controller { } else { apiKey = null; } - return CompletableFuture.supplyAsync(() -> { - imp.deletePet(petId, apiKey) - return ok(); - }); + imp.deletePet(petId, apiKey); + return ok(); } @ApiAction - public CompletionStage findPetsByStatus() throws Exception { + public Result findPetsByStatus() throws Exception { String[] statusArray = request().queryString().get("status"); if (statusArray == null) { throw new IllegalArgumentException("'status' parameter is required"); @@ -87,22 +80,18 @@ public class PetApiController extends Controller { status.add(curParam); } } - CompletionStage> stage = imp.findPetsByStatus(status).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - for (Pet curItem : obj) { - OpenAPIUtils.validate(curItem); - } + List obj = imp.findPetsByStatus(status); + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + OpenAPIUtils.validate(curItem); } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage findPetsByTags() throws Exception { + public Result findPetsByTags() throws Exception { String[] tagsArray = request().queryString().get("tags"); if (tagsArray == null) { throw new IllegalArgumentException("'tags' parameter is required"); @@ -115,93 +104,77 @@ public class PetApiController extends Controller { tags.add(curParam); } } - CompletionStage> stage = imp.findPetsByTags(tags).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - for (Pet curItem : obj) { - OpenAPIUtils.validate(curItem); - } + List obj = imp.findPetsByTags(tags); + if (configuration.getBoolean("useOutputBeanValidation")) { + for (Pet curItem : obj) { + OpenAPIUtils.validate(curItem); } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage getPetById(Long petId) throws Exception { - CompletionStage stage = imp.getPetById(petId).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getPetById(Long petId) throws Exception { + Pet obj = imp.getPetById(petId); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + public Result updatePet() throws Exception { + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.updatePet(pet) - return ok(); - }); + imp.updatePet(body); + return ok(); } @ApiAction - public CompletionStage updatePetWithForm(Long petId) throws Exception { + public Result updatePetWithForm(Long petId) throws Exception { String valuename = (request().body().asMultipartFormData().asFormUrlEncoded().get("name"))[0]; String name; if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } - return CompletableFuture.supplyAsync(() -> { - imp.updatePetWithForm(petId, name, status) - return ok(); - }); + imp.updatePetWithForm(petId, name, status); + return ok(); } @ApiAction - public CompletionStage uploadFile(Long petId) throws Exception { + public Result uploadFile(Long petId) throws Exception { String valueadditionalMetadata = (request().body().asMultipartFormData().asFormUrlEncoded().get("additionalMetadata"))[0]; String additionalMetadata; if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - CompletionStage stage = imp.uploadFile(petId, additionalMetadata, file).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java index a0cb57281b9..c025993f7c1 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -23,31 +23,25 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public CompletionStage> findPetsByStatus( @NotNull List status) throws Exception { + public List findPetsByStatus( @NotNull List status) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new ArrayList(); - }); + return new ArrayList(); } @Override - public CompletionStage> findPetsByTags( @NotNull List tags) throws Exception { + public List findPetsByTags( @NotNull List tags) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new ArrayList(); - }); + return new ArrayList(); } @Override - public CompletionStage getPetById(Long petId) throws Exception { + public Pet getPetById(Long petId) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new Pet(); - }); + return new Pet(); } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } @@ -57,11 +51,9 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public CompletionStage uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception { + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new ModelApiResponse(); - }); + return new ModelApiResponse(); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java index 64b60d9ab75..307c6c18cfb 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/PetApiControllerImpInterface.java @@ -8,27 +8,25 @@ import play.mvc.Http; import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; - CompletionStage> findPetsByStatus( @NotNull List status) throws Exception; + List findPetsByStatus( @NotNull List status) throws Exception; - CompletionStage> findPetsByTags( @NotNull List tags) throws Exception; + List findPetsByTags( @NotNull List tags) throws Exception; - CompletionStage getPetById(Long petId) throws Exception; + Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; - CompletionStage uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; + ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java index 9c112f2e9d6..831f15dfe3c 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiController.java @@ -16,9 +16,6 @@ import java.io.File; import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; - import javax.validation.constraints.*; import play.Configuration; @@ -40,59 +37,45 @@ public class StoreApiController extends Controller { @ApiAction - public CompletionStage deleteOrder(String orderId) throws Exception { - return CompletableFuture.supplyAsync(() -> { - imp.deleteOrder(orderId) - return ok(); - }); + public Result deleteOrder(String orderId) throws Exception { + imp.deleteOrder(orderId); + return ok(); } @ApiAction - public CompletionStage getInventory() throws Exception { - CompletionStage> stage = imp.getInventory().thenApply(obj -> { - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getInventory() throws Exception { + Map obj = imp.getInventory(); + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { - CompletionStage stage = imp.getOrderById(orderId).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + Order obj = imp.getOrderById(orderId); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + public Result placeOrder() throws Exception { + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - CompletionStage stage = imp.placeOrder(order).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + Order obj = imp.placeOrder(body); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java index adcd9a11adc..7c57d3d096c 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImp.java @@ -17,27 +17,21 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface { } @Override - public CompletionStage> getInventory() throws Exception { + public Map getInventory() throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new HashMap(); - }); + return new HashMap(); } @Override - public CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { + public Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new Order(); - }); + return new Order(); } @Override - public CompletionStage placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new Order(); - }); + return new Order(); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java index 86fda5b54fb..b42e4d6d3d0 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/StoreApiControllerImpInterface.java @@ -7,8 +7,6 @@ import play.mvc.Http; import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @@ -16,10 +14,10 @@ import javax.validation.constraints.*; public interface StoreApiControllerImpInterface { void deleteOrder(String orderId) throws Exception; - CompletionStage> getInventory() throws Exception; + Map getInventory() throws Exception; - CompletionStage getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; + Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - CompletionStage placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java index 35c1134b0f4..aa3bbd80ba1 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java @@ -16,9 +16,6 @@ import java.io.File; import openapitools.OpenAPIUtils; import com.fasterxml.jackson.core.type.TypeReference; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; - import javax.validation.constraints.*; import play.Configuration; @@ -40,87 +37,75 @@ public class UserApiController extends Controller { @ApiAction - public CompletionStage createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + public Result createUser() throws Exception { + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.createUser(user) - return ok(); - }); + imp.createUser(body); + return ok(); } @ApiAction - public CompletionStage createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + public Result createUsersWithArrayInput() throws Exception { + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.createUsersWithArrayInput(user) - return ok(); - }); + imp.createUsersWithArrayInput(body); + return ok(); } @ApiAction - public CompletionStage createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + public Result createUsersWithListInput() throws Exception { + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.createUsersWithListInput(user) - return ok(); - }); + imp.createUsersWithListInput(body); + return ok(); } @ApiAction - public CompletionStage deleteUser(String username) throws Exception { - return CompletableFuture.supplyAsync(() -> { - imp.deleteUser(username) - return ok(); - }); + public Result deleteUser(String username) throws Exception { + imp.deleteUser(username); + return ok(); } @ApiAction - public CompletionStage getUserByName(String username) throws Exception { - CompletionStage stage = imp.getUserByName(username).thenApply(obj -> { - if (configuration.getBoolean("useOutputBeanValidation")) { - OpenAPIUtils.validate(obj); - } - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + public Result getUserByName(String username) throws Exception { + User obj = imp.getUserByName(username); + if (configuration.getBoolean("useOutputBeanValidation")) { + OpenAPIUtils.validate(obj); + } + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage loginUser() throws Exception { + public Result loginUser() throws Exception { String valueusername = request().getQueryString("username"); String username; if (valueusername != null) { @@ -135,38 +120,30 @@ public class UserApiController extends Controller { } else { throw new IllegalArgumentException("'password' parameter is required"); } - CompletionStage stage = imp.loginUser(username, password).thenApply(obj -> { - return obj; - }); - stage.thenApply(obj -> { - JsonNode result = mapper.valueToTree(obj); - return ok(result); - }); + String obj = imp.loginUser(username, password); + JsonNode result = mapper.valueToTree(obj); + return ok(result); } @ApiAction - public CompletionStage logoutUser() throws Exception { - return CompletableFuture.supplyAsync(() -> { - imp.logoutUser() - return ok(); - }); + public Result logoutUser() throws Exception { + imp.logoutUser(); + return ok(); } @ApiAction - public CompletionStage updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + public Result updateUser(String username) throws Exception { + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - return CompletableFuture.supplyAsync(() -> { - imp.updateUser(username, user) - return ok(); - }); + imp.updateUser(username, body); + return ok(); } } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java index ebaae2d462b..0ea7a808b9a 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ import javax.validation.constraints.*; public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -32,19 +32,15 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { } @Override - public CompletionStage getUserByName(String username) throws Exception { + public User getUserByName(String username) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new User(); - }); + return new User(); } @Override - public CompletionStage loginUser( @NotNull String username, @NotNull String password) throws Exception { + public String loginUser( @NotNull String username, @NotNull String password) throws Exception { //Do your magic!!! - return CompletableFuture.supplyAsync(() -> { - return new String(); - }); + return new String(); } @Override @@ -53,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java index 62140ddabea..1290c84835f 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java @@ -7,27 +7,25 @@ import play.mvc.Http; import java.util.List; import java.util.ArrayList; import java.util.HashMap; -import java.util.concurrent.CompletionStage; -import java.util.concurrent.CompletableFuture; import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; - CompletionStage getUserByName(String username) throws Exception; + User getUserByName(String username) throws Exception; - CompletionStage loginUser( @NotNull String username, @NotNull String password) throws Exception; + String loginUser( @NotNull String username, @NotNull String password) throws Exception; void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java index c707ca74ac7..385ef97a008 100644 --- a/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-async/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-async/public/openapi.json b/samples/server/petstore/java-play-framework-async/public/openapi.json index ac1d4504782..50b8a737319 100644 --- a/samples/server/petstore/java-play-framework-async/public/openapi.json +++ b/samples/server/petstore/java-play-framework-async/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,189 +39,222 @@ } } }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "responses" : { + "405" : { + "content" : { }, + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "post" : { + "summary" : "Update an existing pet", "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-codegen-request-body-name" : "body", "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", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ], - "default" : "available" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "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, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -236,34 +266,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -272,12 +303,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -349,13 +349,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -364,58 +364,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,71 +438,29 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "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", - "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" - }, "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { "type" : "string" @@ -511,25 +468,68 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "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" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -747,45 +776,23 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updated user", "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-codegen-request-body-name" : "body", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,35 +800,6 @@ "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, @@ -831,38 +809,76 @@ "complete" : false, "status" : "placed" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -883,89 +899,39 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "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" - }, + "title" : "a User", + "type" : "object", "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", "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" ], @@ -984,17 +950,62 @@ } ], "status" : "available" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1003,17 +1014,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1022,12 +1028,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } } diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java index 9f0206575f5..86c8ed0cdef 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Category.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java index 07493e84825..91638ac8c60 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java index d1aaa38d002..91d6d09e7f7 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Order.java @@ -13,16 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java index 5e5ff376294..627f21f8c09 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Pet.java @@ -16,13 +16,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java index 15a8774252a..1a9079ff345 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/Tag.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java index 689de768893..8df0a650670 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/apimodels/User.java @@ -12,28 +12,28 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java index 916fd313b61..c00e111435b 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/PetApiController.java @@ -37,15 +37,15 @@ public class PetApiController extends Controller { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @@ -103,15 +103,15 @@ public class PetApiController extends Controller { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @@ -123,14 +123,14 @@ public class PetApiController extends Controller { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } return ok(); } @@ -142,7 +142,7 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); return ok(); diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java index 928173a5b55..c6b50d59972 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/StoreApiController.java @@ -51,15 +51,15 @@ public class StoreApiController extends Controller { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java index 58bebfd7e1e..9886a7b377a 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java @@ -36,49 +36,49 @@ public class UserApiController extends Controller { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } @@ -119,15 +119,15 @@ public class UserApiController extends Controller { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } return ok(); } diff --git a/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java index c707ca74ac7..385ef97a008 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json index ac1d4504782..50b8a737319 100644 --- a/samples/server/petstore/java-play-framework-controller-only/public/openapi.json +++ b/samples/server/petstore/java-play-framework-controller-only/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,189 +39,222 @@ } } }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "responses" : { + "405" : { + "content" : { }, + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "post" : { + "summary" : "Update an existing pet", "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-codegen-request-body-name" : "body", "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", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ], - "default" : "available" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "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, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -236,34 +266,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -272,12 +303,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -349,13 +349,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -364,58 +364,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,71 +438,29 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "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", - "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" - }, "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { "type" : "string" @@ -511,25 +468,68 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "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" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -747,45 +776,23 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updated user", "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-codegen-request-body-name" : "body", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,35 +800,6 @@ "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, @@ -831,38 +809,76 @@ "complete" : false, "status" : "placed" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -883,89 +899,39 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "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" - }, + "title" : "a User", + "type" : "object", "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", "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" ], @@ -984,17 +950,62 @@ } ], "status" : "available" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1003,17 +1014,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1022,12 +1028,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java new file mode 100644 index 00000000000..0d9f1a4dc74 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesAnyType.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesAnyType + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesAnyType extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; + return Objects.equals(name, additionalPropertiesAnyType.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java new file mode 100644 index 00000000000..0b169be3610 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesArray.java @@ -0,0 +1,78 @@ +package apimodels; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesArray + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesArray extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; + return Objects.equals(name, additionalPropertiesArray.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java new file mode 100644 index 00000000000..7658378e516 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesBoolean.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesBoolean + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesBoolean extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; + return Objects.equals(name, additionalPropertiesBoolean.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBoolean {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java index 0d1d7a1fd98..a41e1e9d215 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesClass.java @@ -1,5 +1,6 @@ package apimodels; +import java.math.BigDecimal; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -14,61 +15,296 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class AdditionalPropertiesClass { - @JsonProperty("map_property") - private Map mapProperty = null; + @JsonProperty("map_string") + private Map mapString = null; - @JsonProperty("map_of_map_property") - private Map> mapOfMapProperty = null; + @JsonProperty("map_number") + private Map mapNumber = null; - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + @JsonProperty("map_integer") + private Map mapInteger = null; + + @JsonProperty("map_boolean") + private Map mapBoolean = null; + + @JsonProperty("map_array_integer") + private Map> mapArrayInteger = null; + + @JsonProperty("map_array_anytype") + private Map> mapArrayAnytype = null; + + @JsonProperty("map_map_string") + private Map> mapMapString = null; + + @JsonProperty("map_map_anytype") + private Map> mapMapAnytype = null; + + @JsonProperty("anytype_1") + private Object anytype1; + + @JsonProperty("anytype_2") + private Object anytype2; + + @JsonProperty("anytype_3") + private Object anytype3; + + public AdditionalPropertiesClass mapString(Map mapString) { + this.mapString = mapString; return this; } - public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { - if (this.mapProperty == null) { - this.mapProperty = new HashMap<>(); + public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { + if (this.mapString == null) { + this.mapString = new HashMap<>(); } - this.mapProperty.put(key, mapPropertyItem); + this.mapString.put(key, mapStringItem); return this; } /** - * Get mapProperty - * @return mapProperty + * Get mapString + * @return mapString **/ - public Map getMapProperty() { - return mapProperty; + public Map getMapString() { + return mapString; } - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; + public void setMapString(Map mapString) { + this.mapString = mapString; } - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public AdditionalPropertiesClass mapNumber(Map mapNumber) { + this.mapNumber = mapNumber; return this; } - public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { - if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap<>(); + public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { + if (this.mapNumber == null) { + this.mapNumber = new HashMap<>(); } - this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + this.mapNumber.put(key, mapNumberItem); return this; } /** - * Get mapOfMapProperty - * @return mapOfMapProperty + * Get mapNumber + * @return mapNumber **/ @Valid - public Map> getMapOfMapProperty() { - return mapOfMapProperty; + public Map getMapNumber() { + return mapNumber; } - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; + public void setMapNumber(Map mapNumber) { + this.mapNumber = mapNumber; + } + + public AdditionalPropertiesClass mapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + return this; + } + + public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { + if (this.mapInteger == null) { + this.mapInteger = new HashMap<>(); + } + this.mapInteger.put(key, mapIntegerItem); + return this; + } + + /** + * Get mapInteger + * @return mapInteger + **/ + public Map getMapInteger() { + return mapInteger; + } + + public void setMapInteger(Map mapInteger) { + this.mapInteger = mapInteger; + } + + public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + return this; + } + + public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { + if (this.mapBoolean == null) { + this.mapBoolean = new HashMap<>(); + } + this.mapBoolean.put(key, mapBooleanItem); + return this; + } + + /** + * Get mapBoolean + * @return mapBoolean + **/ + public Map getMapBoolean() { + return mapBoolean; + } + + public void setMapBoolean(Map mapBoolean) { + this.mapBoolean = mapBoolean; + } + + public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + return this; + } + + public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { + if (this.mapArrayInteger == null) { + this.mapArrayInteger = new HashMap<>(); + } + this.mapArrayInteger.put(key, mapArrayIntegerItem); + return this; + } + + /** + * Get mapArrayInteger + * @return mapArrayInteger + **/ + @Valid + public Map> getMapArrayInteger() { + return mapArrayInteger; + } + + public void setMapArrayInteger(Map> mapArrayInteger) { + this.mapArrayInteger = mapArrayInteger; + } + + public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + return this; + } + + public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { + if (this.mapArrayAnytype == null) { + this.mapArrayAnytype = new HashMap<>(); + } + this.mapArrayAnytype.put(key, mapArrayAnytypeItem); + return this; + } + + /** + * Get mapArrayAnytype + * @return mapArrayAnytype + **/ + @Valid + public Map> getMapArrayAnytype() { + return mapArrayAnytype; + } + + public void setMapArrayAnytype(Map> mapArrayAnytype) { + this.mapArrayAnytype = mapArrayAnytype; + } + + public AdditionalPropertiesClass mapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + return this; + } + + public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { + if (this.mapMapString == null) { + this.mapMapString = new HashMap<>(); + } + this.mapMapString.put(key, mapMapStringItem); + return this; + } + + /** + * Get mapMapString + * @return mapMapString + **/ + @Valid + public Map> getMapMapString() { + return mapMapString; + } + + public void setMapMapString(Map> mapMapString) { + this.mapMapString = mapMapString; + } + + public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + return this; + } + + public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { + if (this.mapMapAnytype == null) { + this.mapMapAnytype = new HashMap<>(); + } + this.mapMapAnytype.put(key, mapMapAnytypeItem); + return this; + } + + /** + * Get mapMapAnytype + * @return mapMapAnytype + **/ + @Valid + public Map> getMapMapAnytype() { + return mapMapAnytype; + } + + public void setMapMapAnytype(Map> mapMapAnytype) { + this.mapMapAnytype = mapMapAnytype; + } + + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = anytype1; + return this; + } + + /** + * Get anytype1 + * @return anytype1 + **/ + @Valid + public Object getAnytype1() { + return anytype1; + } + + public void setAnytype1(Object anytype1) { + this.anytype1 = anytype1; + } + + public AdditionalPropertiesClass anytype2(Object anytype2) { + this.anytype2 = anytype2; + return this; + } + + /** + * Get anytype2 + * @return anytype2 + **/ + @Valid + public Object getAnytype2() { + return anytype2; + } + + public void setAnytype2(Object anytype2) { + this.anytype2 = anytype2; + } + + public AdditionalPropertiesClass anytype3(Object anytype3) { + this.anytype3 = anytype3; + return this; + } + + /** + * Get anytype3 + * @return anytype3 + **/ + @Valid + public Object getAnytype3() { + return anytype3; + } + + public void setAnytype3(Object anytype3) { + this.anytype3 = anytype3; } @@ -81,13 +317,22 @@ public class AdditionalPropertiesClass { return false; } AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); + return Objects.equals(mapString, additionalPropertiesClass.mapString) && + Objects.equals(mapNumber, additionalPropertiesClass.mapNumber) && + Objects.equals(mapInteger, additionalPropertiesClass.mapInteger) && + Objects.equals(mapBoolean, additionalPropertiesClass.mapBoolean) && + Objects.equals(mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && + Objects.equals(mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && + Objects.equals(mapMapString, additionalPropertiesClass.mapMapString) && + Objects.equals(mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && + Objects.equals(anytype1, additionalPropertiesClass.anytype1) && + Objects.equals(anytype2, additionalPropertiesClass.anytype2) && + Objects.equals(anytype3, additionalPropertiesClass.anytype3); } @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); } @SuppressWarnings("StringBufferReplaceableByString") @@ -96,8 +341,17 @@ public class AdditionalPropertiesClass { StringBuilder sb = new StringBuilder(); sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); + sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); + sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); + sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); + sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); + sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); + sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); + sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); + sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java new file mode 100644 index 00000000000..ed3671bfeeb --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesInteger.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesInteger + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesInteger extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; + return Objects.equals(name, additionalPropertiesInteger.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesInteger {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java new file mode 100644 index 00000000000..d3590987e61 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesNumber.java @@ -0,0 +1,78 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesNumber + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesNumber extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; + return Objects.equals(name, additionalPropertiesNumber.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumber {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java new file mode 100644 index 00000000000..5b27a250f25 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesObject.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesObject + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesObject extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; + return Objects.equals(name, additionalPropertiesObject.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObject {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java new file mode 100644 index 00000000000..bbd9f654142 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/AdditionalPropertiesString.java @@ -0,0 +1,77 @@ +package apimodels; + +import java.util.HashMap; +import java.util.Map; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * AdditionalPropertiesString + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class AdditionalPropertiesString extends HashMap { + @JsonProperty("name") + private String name; + + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; + return Objects.equals(name, additionalPropertiesString.name) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode()); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesString {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java index 2202fe1078e..f79d687c4f9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Animal.java @@ -14,7 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Animal { @JsonProperty("className") - private String className = null; + private String className; @JsonProperty("color") private String color = "red"; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java index f78ceeb9d0b..cd5031205e8 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Capitalization.java @@ -12,22 +12,22 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Capitalization { @JsonProperty("smallCamel") - private String smallCamel = null; + private String smallCamel; @JsonProperty("CapitalCamel") - private String capitalCamel = null; + private String capitalCamel; @JsonProperty("small_Snake") - private String smallSnake = null; + private String smallSnake; @JsonProperty("Capital_Snake") - private String capitalSnake = null; + private String capitalSnake; @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints = null; + private String scAETHFlowPoints; @JsonProperty("ATT_NAME") - private String ATT_NAME = null; + private String ATT_NAME; public Capitalization smallCamel(String smallCamel) { this.smallCamel = smallCamel; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java index 5e8dfb06c05..0c0aa9fd204 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Cat.java @@ -1,6 +1,7 @@ package apimodels; import apimodels.Animal; +import apimodels.CatAllOf; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; @@ -13,7 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Cat extends Animal { @JsonProperty("declawed") - private Boolean declawed = null; + private Boolean declawed; public Cat declawed(Boolean declawed) { this.declawed = declawed; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java new file mode 100644 index 00000000000..04a1572284c --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/CatAllOf.java @@ -0,0 +1,74 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * CatAllOf + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class CatAllOf { + @JsonProperty("declawed") + private Boolean declawed; + + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; + } + + /** + * Get declawed + * @return declawed + **/ + public Boolean getDeclawed() { + return declawed; + } + + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java index c2a4222a8aa..54b0afb8d7f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Category.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name = "default-name"; public Category id(Long id) { this.id = id; @@ -43,7 +43,8 @@ public class Category { * Get name * @return name **/ - public String getName() { + @NotNull + public String getName() { return name; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java index ee8cd40ca40..84a3fbddbf8 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ClassModel.java @@ -12,7 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ClassModel { @JsonProperty("_class") - private String propertyClass = null; + private String propertyClass; public ClassModel propertyClass(String propertyClass) { this.propertyClass = propertyClass; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java index f14be52cf46..90da55b8e99 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Client.java @@ -12,7 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Client { @JsonProperty("client") - private String client = null; + private String client; public Client client(String client) { this.client = client; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java index 27e3f5fdb25..7e4fe30c682 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Dog.java @@ -1,6 +1,7 @@ package apimodels; import apimodels.Animal; +import apimodels.DogAllOf; import com.fasterxml.jackson.annotation.*; import java.util.Set; import javax.validation.*; @@ -13,7 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Dog extends Animal { @JsonProperty("breed") - private String breed = null; + private String breed; public Dog breed(String breed) { this.breed = breed; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java new file mode 100644 index 00000000000..c49367934f9 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/DogAllOf.java @@ -0,0 +1,74 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * DogAllOf + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class DogAllOf { + @JsonProperty("breed") + private String breed; + + public DogAllOf breed(String breed) { + this.breed = breed; + return this; + } + + /** + * Get breed + * @return breed + **/ + public String getBreed() { + return breed; + } + + public void setBreed(String breed) { + this.breed = breed; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java index 5f2c63d116d..1c5806205d0 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumArrays.java @@ -34,18 +34,18 @@ public class EnumArrays { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol = null; + private JustSymbolEnum justSymbol; /** * Gets or Sets arrayEnum @@ -68,13 +68,13 @@ public class EnumArrays { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java index c0f2b0ad97e..647abcf5342 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumClass.java @@ -29,13 +29,13 @@ public enum EnumClass { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java index 861a7e57777..9bafde9f409 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/EnumTest.java @@ -35,18 +35,18 @@ public class EnumTest { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_string") - private EnumStringEnum enumString = null; + private EnumStringEnum enumString; /** * Gets or Sets enumStringRequired @@ -71,18 +71,18 @@ public class EnumTest { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired = null; + private EnumStringRequiredEnum enumStringRequired; /** * Gets or Sets enumInteger @@ -105,18 +105,18 @@ public class EnumTest { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger = null; + private EnumIntegerEnum enumInteger; /** * Gets or Sets enumNumber @@ -139,21 +139,21 @@ public class EnumTest { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("enum_number") - private EnumNumberEnum enumNumber = null; + private EnumNumberEnum enumNumber; @JsonProperty("outerEnum") - private OuterEnum outerEnum = null; + private OuterEnum outerEnum; public EnumTest enumString(EnumStringEnum enumString) { this.enumString = enumString; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java index d01ed397a32..839ab49292c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FileSchemaTestClass.java @@ -14,7 +14,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class FileSchemaTestClass { @JsonProperty("file") - private java.io.File file = null; + private java.io.File file; @JsonProperty("files") private List files = null; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java index b16bbd537f4..e01fd150a45 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/FormatTest.java @@ -17,43 +17,43 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class FormatTest { @JsonProperty("integer") - private Integer integer = null; + private Integer integer; @JsonProperty("int32") - private Integer int32 = null; + private Integer int32; @JsonProperty("int64") - private Long int64 = null; + private Long int64; @JsonProperty("number") - private BigDecimal number = null; + private BigDecimal number; @JsonProperty("float") - private Float _float = null; + private Float _float; @JsonProperty("double") - private Double _double = null; + private Double _double; @JsonProperty("string") - private String string = null; + private String string; @JsonProperty("byte") - private byte[] _byte = null; + private byte[] _byte; @JsonProperty("binary") - private InputStream binary = null; + private InputStream binary; @JsonProperty("date") - private LocalDate date = null; + private LocalDate date; @JsonProperty("dateTime") - private OffsetDateTime dateTime = null; + private OffsetDateTime dateTime; @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("password") - private String password = null; + private String password; public FormatTest integer(Integer integer) { this.integer = integer; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java index 17d09b40692..20a101fd6b7 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/HasOnlyReadOnly.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class HasOnlyReadOnly { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("foo") - private String foo = null; + private String foo; public HasOnlyReadOnly bar(String bar) { this.bar = bar; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java index 5c1518d4cd3..3b6a62bf399 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MapTest.java @@ -1,6 +1,5 @@ package apimodels; -import apimodels.StringBooleanMap; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -39,13 +38,13 @@ public class MapTest { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @@ -56,7 +55,7 @@ public class MapTest { private Map directMap = null; @JsonProperty("indirect_map") - private StringBooleanMap indirectMap = null; + private Map indirectMap = null; public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; @@ -134,21 +133,28 @@ public class MapTest { this.directMap = directMap; } - public MapTest indirectMap(StringBooleanMap indirectMap) { + public MapTest indirectMap(Map indirectMap) { this.indirectMap = indirectMap; return this; } + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + /** * Get indirectMap * @return indirectMap **/ - @Valid - public StringBooleanMap getIndirectMap() { + public Map getIndirectMap() { return indirectMap; } - public void setIndirectMap(StringBooleanMap indirectMap) { + public void setIndirectMap(Map indirectMap) { this.indirectMap = indirectMap; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java index e52678fa5c4..461c704af66 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/MixedPropertiesAndAdditionalPropertiesClass.java @@ -18,10 +18,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") - private UUID uuid = null; + private UUID uuid; @JsonProperty("dateTime") - private OffsetDateTime dateTime = null; + private OffsetDateTime dateTime; @JsonProperty("map") private Map map = null; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java index b17e0ed8a79..895a9578a35 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Model200Response.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Model200Response { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("class") - private String propertyClass = null; + private String propertyClass; public Model200Response name(Integer name) { this.name = name; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java index a5505482e08..0a884c19815 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java index 89d3a0e25ff..f92e2c16411 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelReturn.java @@ -12,7 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelReturn { @JsonProperty("return") - private Integer _return = null; + private Integer _return; public ModelReturn _return(Integer _return) { this._return = _return; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java index 7bfcff1e5be..36d4fa5e545 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Name.java @@ -12,16 +12,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Name { @JsonProperty("name") - private Integer name = null; + private Integer name; @JsonProperty("snake_case") - private Integer snakeCase = null; + private Integer snakeCase; @JsonProperty("property") - private String property = null; + private String property; @JsonProperty("123Number") - private Integer _123number = null; + private Integer _123number; public Name name(Integer name) { this.name = name; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java index a54fece6268..0d35aae626b 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/NumberOnly.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class NumberOnly { @JsonProperty("JustNumber") - private BigDecimal justNumber = null; + private BigDecimal justNumber; public NumberOnly justNumber(BigDecimal justNumber) { this.justNumber = justNumber; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java index 404beae15bc..fa71fb1d7ef 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Order.java @@ -13,16 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java index 92a8ca4c95a..22c5a23259f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterComposite.java @@ -13,13 +13,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class OuterComposite { @JsonProperty("my_number") - private BigDecimal myNumber = null; + private BigDecimal myNumber; @JsonProperty("my_string") - private String myString = null; + private String myString; @JsonProperty("my_boolean") - private Boolean myBoolean = null; + private Boolean myBoolean; public OuterComposite myNumber(BigDecimal myNumber) { this.myNumber = myNumber; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java index f5026996917..98cd7feae6a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/OuterEnum.java @@ -29,13 +29,13 @@ public enum OuterEnum { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java index aaa139c566d..cf7ff2912d9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Pet.java @@ -16,13 +16,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java index 693aa7eba34..4457994d7ae 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ReadOnlyFirst.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ReadOnlyFirst { @JsonProperty("bar") - private String bar = null; + private String bar; @JsonProperty("baz") - private String baz = null; + private String baz; public ReadOnlyFirst bar(String bar) { this.bar = bar; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java index b8f387377d0..9b1f8f6ebe3 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/SpecialModelName.java @@ -12,7 +12,7 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class SpecialModelName { @JsonProperty("$special[property.name]") - private Long $specialPropertyName = null; + private Long $specialPropertyName; public SpecialModelName $specialPropertyName(Long $specialPropertyName) { this.$specialPropertyName = $specialPropertyName; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java index 5426c883569..ae8f84e74bc 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/Tag.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java new file mode 100644 index 00000000000..a12511e94fd --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderDefault.java @@ -0,0 +1,176 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * TypeHolderDefault + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class TypeHolderDefault { + @JsonProperty("string_item") + private String stringItem = "what"; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem = true; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList<>(); + + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + **/ + @NotNull + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull +@Valid + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; + return Objects.equals(stringItem, typeHolderDefault.stringItem) && + Objects.equals(numberItem, typeHolderDefault.numberItem) && + Objects.equals(integerItem, typeHolderDefault.integerItem) && + Objects.equals(boolItem, typeHolderDefault.boolItem) && + Objects.equals(arrayItem, typeHolderDefault.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java new file mode 100644 index 00000000000..3165a322afa --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/TypeHolderExample.java @@ -0,0 +1,176 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * TypeHolderExample + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class TypeHolderExample { + @JsonProperty("string_item") + private String stringItem; + + @JsonProperty("number_item") + private BigDecimal numberItem; + + @JsonProperty("integer_item") + private Integer integerItem; + + @JsonProperty("bool_item") + private Boolean boolItem; + + @JsonProperty("array_item") + private List arrayItem = new ArrayList<>(); + + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; + } + + /** + * Get stringItem + * @return stringItem + **/ + @NotNull + public String getStringItem() { + return stringItem; + } + + public void setStringItem(String stringItem) { + this.stringItem = stringItem; + } + + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * @return numberItem + **/ + @NotNull +@Valid + public BigDecimal getNumberItem() { + return numberItem; + } + + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * @return integerItem + **/ + @NotNull + public Integer getIntegerItem() { + return integerItem; + } + + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * @return boolItem + **/ + @NotNull + public Boolean getBoolItem() { + return boolItem; + } + + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * @return arrayItem + **/ + @NotNull + public List getArrayItem() { + return arrayItem; + } + + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TypeHolderExample typeHolderExample = (TypeHolderExample) o; + return Objects.equals(stringItem, typeHolderExample.stringItem) && + Objects.equals(numberItem, typeHolderExample.numberItem) && + Objects.equals(integerItem, typeHolderExample.integerItem) && + Objects.equals(boolItem, typeHolderExample.boolItem) && + Objects.equals(arrayItem, typeHolderExample.arrayItem); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java index 0308cc92681..91739a288c9 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/User.java @@ -12,28 +12,28 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java new file mode 100644 index 00000000000..6cf480a9e7e --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/XmlItem.java @@ -0,0 +1,770 @@ +package apimodels; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * XmlItem + */ + +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class XmlItem { + @JsonProperty("attribute_string") + private String attributeString; + + @JsonProperty("attribute_number") + private BigDecimal attributeNumber; + + @JsonProperty("attribute_integer") + private Integer attributeInteger; + + @JsonProperty("attribute_boolean") + private Boolean attributeBoolean; + + @JsonProperty("wrapped_array") + private List wrappedArray = null; + + @JsonProperty("name_string") + private String nameString; + + @JsonProperty("name_number") + private BigDecimal nameNumber; + + @JsonProperty("name_integer") + private Integer nameInteger; + + @JsonProperty("name_boolean") + private Boolean nameBoolean; + + @JsonProperty("name_array") + private List nameArray = null; + + @JsonProperty("name_wrapped_array") + private List nameWrappedArray = null; + + @JsonProperty("prefix_string") + private String prefixString; + + @JsonProperty("prefix_number") + private BigDecimal prefixNumber; + + @JsonProperty("prefix_integer") + private Integer prefixInteger; + + @JsonProperty("prefix_boolean") + private Boolean prefixBoolean; + + @JsonProperty("prefix_array") + private List prefixArray = null; + + @JsonProperty("prefix_wrapped_array") + private List prefixWrappedArray = null; + + @JsonProperty("namespace_string") + private String namespaceString; + + @JsonProperty("namespace_number") + private BigDecimal namespaceNumber; + + @JsonProperty("namespace_integer") + private Integer namespaceInteger; + + @JsonProperty("namespace_boolean") + private Boolean namespaceBoolean; + + @JsonProperty("namespace_array") + private List namespaceArray = null; + + @JsonProperty("namespace_wrapped_array") + private List namespaceWrappedArray = null; + + @JsonProperty("prefix_ns_string") + private String prefixNsString; + + @JsonProperty("prefix_ns_number") + private BigDecimal prefixNsNumber; + + @JsonProperty("prefix_ns_integer") + private Integer prefixNsInteger; + + @JsonProperty("prefix_ns_boolean") + private Boolean prefixNsBoolean; + + @JsonProperty("prefix_ns_array") + private List prefixNsArray = null; + + @JsonProperty("prefix_ns_wrapped_array") + private List prefixNsWrappedArray = null; + + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; + } + + /** + * Get attributeString + * @return attributeString + **/ + public String getAttributeString() { + return attributeString; + } + + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; + } + + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; + } + + /** + * Get attributeNumber + * @return attributeNumber + **/ + @Valid + public BigDecimal getAttributeNumber() { + return attributeNumber; + } + + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + } + + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; + } + + /** + * Get attributeInteger + * @return attributeInteger + **/ + public Integer getAttributeInteger() { + return attributeInteger; + } + + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + } + + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; + } + + /** + * Get attributeBoolean + * @return attributeBoolean + **/ + public Boolean getAttributeBoolean() { + return attributeBoolean; + } + + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + } + + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (wrappedArray == null) { + wrappedArray = new ArrayList<>(); + } + wrappedArray.add(wrappedArrayItem); + return this; + } + + /** + * Get wrappedArray + * @return wrappedArray + **/ + public List getWrappedArray() { + return wrappedArray; + } + + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * @return nameString + **/ + public String getNameString() { + return nameString; + } + + public void setNameString(String nameString) { + this.nameString = nameString; + } + + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * @return nameNumber + **/ + @Valid + public BigDecimal getNameNumber() { + return nameNumber; + } + + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * @return nameInteger + **/ + public Integer getNameInteger() { + return nameInteger; + } + + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * @return nameBoolean + **/ + public Boolean getNameBoolean() { + return nameBoolean; + } + + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (nameArray == null) { + nameArray = new ArrayList<>(); + } + nameArray.add(nameArrayItem); + return this; + } + + /** + * Get nameArray + * @return nameArray + **/ + public List getNameArray() { + return nameArray; + } + + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (nameWrappedArray == null) { + nameWrappedArray = new ArrayList<>(); + } + nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + /** + * Get nameWrappedArray + * @return nameWrappedArray + **/ + public List getNameWrappedArray() { + return nameWrappedArray; + } + + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * @return prefixString + **/ + public String getPrefixString() { + return prefixString; + } + + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * @return prefixNumber + **/ + @Valid + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * @return prefixInteger + **/ + public Integer getPrefixInteger() { + return prefixInteger; + } + + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * @return prefixBoolean + **/ + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (prefixArray == null) { + prefixArray = new ArrayList<>(); + } + prefixArray.add(prefixArrayItem); + return this; + } + + /** + * Get prefixArray + * @return prefixArray + **/ + public List getPrefixArray() { + return prefixArray; + } + + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (prefixWrappedArray == null) { + prefixWrappedArray = new ArrayList<>(); + } + prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + /** + * Get prefixWrappedArray + * @return prefixWrappedArray + **/ + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * @return namespaceString + **/ + public String getNamespaceString() { + return namespaceString; + } + + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * @return namespaceNumber + **/ + @Valid + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * @return namespaceInteger + **/ + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * @return namespaceBoolean + **/ + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (namespaceArray == null) { + namespaceArray = new ArrayList<>(); + } + namespaceArray.add(namespaceArrayItem); + return this; + } + + /** + * Get namespaceArray + * @return namespaceArray + **/ + public List getNamespaceArray() { + return namespaceArray; + } + + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (namespaceWrappedArray == null) { + namespaceWrappedArray = new ArrayList<>(); + } + namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + /** + * Get namespaceWrappedArray + * @return namespaceWrappedArray + **/ + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * @return prefixNsString + **/ + public String getPrefixNsString() { + return prefixNsString; + } + + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * @return prefixNsNumber + **/ + @Valid + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * @return prefixNsInteger + **/ + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * @return prefixNsBoolean + **/ + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (prefixNsArray == null) { + prefixNsArray = new ArrayList<>(); + } + prefixNsArray.add(prefixNsArrayItem); + return this; + } + + /** + * Get prefixNsArray + * @return prefixNsArray + **/ + public List getPrefixNsArray() { + return prefixNsArray; + } + + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (prefixNsWrappedArray == null) { + prefixNsWrappedArray = new ArrayList<>(); + } + prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + /** + * Get prefixNsWrappedArray + * @return prefixNsWrappedArray + **/ + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + XmlItem xmlItem = (XmlItem) o; + return Objects.equals(attributeString, xmlItem.attributeString) && + Objects.equals(attributeNumber, xmlItem.attributeNumber) && + Objects.equals(attributeInteger, xmlItem.attributeInteger) && + Objects.equals(attributeBoolean, xmlItem.attributeBoolean) && + Objects.equals(wrappedArray, xmlItem.wrappedArray) && + Objects.equals(nameString, xmlItem.nameString) && + Objects.equals(nameNumber, xmlItem.nameNumber) && + Objects.equals(nameInteger, xmlItem.nameInteger) && + Objects.equals(nameBoolean, xmlItem.nameBoolean) && + Objects.equals(nameArray, xmlItem.nameArray) && + Objects.equals(nameWrappedArray, xmlItem.nameWrappedArray) && + Objects.equals(prefixString, xmlItem.prefixString) && + Objects.equals(prefixNumber, xmlItem.prefixNumber) && + Objects.equals(prefixInteger, xmlItem.prefixInteger) && + Objects.equals(prefixBoolean, xmlItem.prefixBoolean) && + Objects.equals(prefixArray, xmlItem.prefixArray) && + Objects.equals(prefixWrappedArray, xmlItem.prefixWrappedArray) && + Objects.equals(namespaceString, xmlItem.namespaceString) && + Objects.equals(namespaceNumber, xmlItem.namespaceNumber) && + Objects.equals(namespaceInteger, xmlItem.namespaceInteger) && + Objects.equals(namespaceBoolean, xmlItem.namespaceBoolean) && + Objects.equals(namespaceArray, xmlItem.namespaceArray) && + Objects.equals(namespaceWrappedArray, xmlItem.namespaceWrappedArray) && + Objects.equals(prefixNsString, xmlItem.prefixNsString) && + Objects.equals(prefixNsNumber, xmlItem.prefixNsNumber) && + Objects.equals(prefixNsInteger, xmlItem.prefixNsInteger) && + Objects.equals(prefixNsBoolean, xmlItem.prefixNsBoolean) && + Objects.equals(prefixNsArray, xmlItem.prefixNsArray) && + Objects.equals(prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + } + + @Override + public int hashCode() { + return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java index 3056c5a319a..aa22bcb3ff8 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiController.java @@ -36,18 +36,18 @@ public class AnotherFakeApiController extends Controller { @ApiAction - public Result testSpecialTags() throws Exception { - JsonNode nodeclient = request().body().asJson(); - Client client; - if (nodeclient != null) { - client = mapper.readValue(nodeclient.toString(), Client.class); + public Result call123testSpecialTags() throws Exception { + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(client); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Client' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Client obj = imp.testSpecialTags(client); + Client obj = imp.call123testSpecialTags(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java index 28461fdd91a..cb14f49165c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImp.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; public class AnotherFakeApiControllerImp implements AnotherFakeApiControllerImpInterface { @Override - public Client testSpecialTags(Client client) throws Exception { + public Client call123testSpecialTags(Client body) throws Exception { //Do your magic!!! return new Client(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java index 28d1da8e37b..ebc18b14f24 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/AnotherFakeApiControllerImpInterface.java @@ -11,6 +11,6 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface AnotherFakeApiControllerImpInterface { - Client testSpecialTags(Client client) throws Exception; + Client call123testSpecialTags(Client body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java index fb501df6b6f..508aacee714 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiController.java @@ -9,6 +9,7 @@ import java.util.Map; import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; +import apimodels.XmlItem; import play.mvc.Controller; import play.mvc.Result; @@ -43,6 +44,22 @@ public class FakeApiController extends Controller { } + @ApiAction + public Result createXmlItem() throws Exception { + JsonNode nodexmlItem = request().body().asJson(); + XmlItem xmlItem; + if (nodexmlItem != null) { + xmlItem = mapper.readValue(nodexmlItem.toString(), XmlItem.class); + if (configuration.getBoolean("useInputBeanValidation")) { + OpenAPIUtils.validate(xmlItem); + } + } else { + throw new IllegalArgumentException("'XmlItem' parameter is required"); + } + imp.createXmlItem(xmlItem); + return ok(); + } + @ApiAction public Result fakeOuterBooleanSerialize() throws Exception { JsonNode nodebody = request().body().asJson(); @@ -62,17 +79,17 @@ public class FakeApiController extends Controller { @ApiAction public Result fakeOuterCompositeSerialize() throws Exception { - JsonNode nodeouterComposite = request().body().asJson(); - OuterComposite outerComposite; - if (nodeouterComposite != null) { - outerComposite = mapper.readValue(nodeouterComposite.toString(), OuterComposite.class); + JsonNode nodebody = request().body().asJson(); + OuterComposite body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), OuterComposite.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(outerComposite); + OpenAPIUtils.validate(body); } } else { - outerComposite = null; + body = null; } - OuterComposite obj = imp.fakeOuterCompositeSerialize(outerComposite); + OuterComposite obj = imp.fakeOuterCompositeSerialize(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } @@ -119,31 +136,31 @@ public class FakeApiController extends Controller { @ApiAction public Result testBodyWithFileSchema() throws Exception { - JsonNode nodefileSchemaTestClass = request().body().asJson(); - FileSchemaTestClass fileSchemaTestClass; - if (nodefileSchemaTestClass != null) { - fileSchemaTestClass = mapper.readValue(nodefileSchemaTestClass.toString(), FileSchemaTestClass.class); + JsonNode nodebody = request().body().asJson(); + FileSchemaTestClass body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), FileSchemaTestClass.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(fileSchemaTestClass); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'FileSchemaTestClass' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.testBodyWithFileSchema(fileSchemaTestClass); + imp.testBodyWithFileSchema(body); return ok(); } @ApiAction public Result testBodyWithQueryParams() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } String valuequery = request().getQueryString("query"); String query; @@ -152,23 +169,23 @@ public class FakeApiController extends Controller { } else { throw new IllegalArgumentException("'query' parameter is required"); } - imp.testBodyWithQueryParams(query, user); + imp.testBodyWithQueryParams(query, body); return ok(); } @ApiAction public Result testClientModel() throws Exception { - JsonNode nodeclient = request().body().asJson(); - Client client; - if (nodeclient != null) { - client = mapper.readValue(nodeclient.toString(), Client.class); + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(client); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Client' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Client obj = imp.testClientModel(client); + Client obj = imp.testClientModel(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } @@ -225,7 +242,7 @@ public class FakeApiController extends Controller { if (valuestring != null) { string = valuestring; } else { - string = "null"; + string = null; } String valuepatternWithoutDelimiter = (request().body().asMultipartFormData().asFormUrlEncoded().get("pattern_without_delimiter"))[0]; String patternWithoutDelimiter; @@ -261,14 +278,14 @@ public class FakeApiController extends Controller { if (valuepassword != null) { password = valuepassword; } else { - password = "null"; + password = null; } String valueparamCallback = (request().body().asMultipartFormData().asFormUrlEncoded().get("callback"))[0]; String paramCallback; if (valueparamCallback != null) { paramCallback = valueparamCallback; } else { - paramCallback = "null"; + paramCallback = null; } imp.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); return ok(); @@ -342,21 +359,69 @@ public class FakeApiController extends Controller { return ok(); } + @ApiAction + public Result testGroupParameters() throws Exception { + String valuerequiredStringGroup = request().getQueryString("required_string_group"); + Integer requiredStringGroup; + if (valuerequiredStringGroup != null) { + requiredStringGroup = Integer.parseInt(valuerequiredStringGroup); + } else { + throw new IllegalArgumentException("'required_string_group' parameter is required"); + } + String valuerequiredInt64Group = request().getQueryString("required_int64_group"); + Long requiredInt64Group; + if (valuerequiredInt64Group != null) { + requiredInt64Group = Long.parseLong(valuerequiredInt64Group); + } else { + throw new IllegalArgumentException("'required_int64_group' parameter is required"); + } + String valuestringGroup = request().getQueryString("string_group"); + Integer stringGroup; + if (valuestringGroup != null) { + stringGroup = Integer.parseInt(valuestringGroup); + } else { + stringGroup = null; + } + String valueint64Group = request().getQueryString("int64_group"); + Long int64Group; + if (valueint64Group != null) { + int64Group = Long.parseLong(valueint64Group); + } else { + int64Group = null; + } + String valuerequiredBooleanGroup = request().getHeader("required_boolean_group"); + Boolean requiredBooleanGroup; + if (valuerequiredBooleanGroup != null) { + requiredBooleanGroup = Boolean.valueOf(valuerequiredBooleanGroup); + } else { + throw new IllegalArgumentException("'required_boolean_group' parameter is required"); + } + String valuebooleanGroup = request().getHeader("boolean_group"); + Boolean booleanGroup; + if (valuebooleanGroup != null) { + booleanGroup = Boolean.valueOf(valuebooleanGroup); + } else { + booleanGroup = null; + } + imp.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); + return ok(); + } + @ApiAction public Result testInlineAdditionalProperties() throws Exception { - JsonNode noderequestBody = request().body().asJson(); - Map requestBody; - if (noderequestBody != null) { - requestBody = mapper.readValue(noderequestBody.toString(), new TypeReference>(){}); + JsonNode nodeparam = request().body().asJson(); + Map param; + if (nodeparam != null) { + param = mapper.readValue(nodeparam.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (Map.Entry entry : requestBody.entrySet()) { + for (Map.Entry entry : param.entrySet()) { OpenAPIUtils.validate(entry.getValue()); } } } else { - throw new IllegalArgumentException("'request_body' parameter is required"); + throw new IllegalArgumentException("'param' parameter is required"); } - imp.testInlineAdditionalProperties(requestBody); + imp.testInlineAdditionalProperties(param); return ok(); } @@ -379,4 +444,70 @@ public class FakeApiController extends Controller { imp.testJsonFormData(param, param2); return ok(); } + + @ApiAction + public Result testQueryParameterCollectionFormat() throws Exception { + String[] pipeArray = request().queryString().get("pipe"); + if (pipeArray == null) { + throw new IllegalArgumentException("'pipe' parameter is required"); + } + List pipeList = OpenAPIUtils.parametersToList("csv", pipeArray); + List pipe = new ArrayList(); + for (String curParam : pipeList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + pipe.add(curParam); + } + } + String[] ioutilArray = request().queryString().get("ioutil"); + if (ioutilArray == null) { + throw new IllegalArgumentException("'ioutil' parameter is required"); + } + List ioutilList = OpenAPIUtils.parametersToList("csv", ioutilArray); + List ioutil = new ArrayList(); + for (String curParam : ioutilList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + ioutil.add(curParam); + } + } + String[] httpArray = request().queryString().get("http"); + if (httpArray == null) { + throw new IllegalArgumentException("'http' parameter is required"); + } + List httpList = OpenAPIUtils.parametersToList("space", httpArray); + List http = new ArrayList(); + for (String curParam : httpList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + http.add(curParam); + } + } + String[] urlArray = request().queryString().get("url"); + if (urlArray == null) { + throw new IllegalArgumentException("'url' parameter is required"); + } + List urlList = OpenAPIUtils.parametersToList("csv", urlArray); + List url = new ArrayList(); + for (String curParam : urlList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + url.add(curParam); + } + } + String[] contextArray = request().queryString().get("context"); + if (contextArray == null) { + throw new IllegalArgumentException("'context' parameter is required"); + } + List contextList = OpenAPIUtils.parametersToList("multi", contextArray); + List context = new ArrayList(); + for (String curParam : contextList) { + if (!curParam.isEmpty()) { + //noinspection UseBulkOperation + context.add(curParam); + } + } + imp.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + return ok(); + } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java index a3316211927..d50832ef3b1 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImp.java @@ -9,6 +9,7 @@ import java.util.Map; import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; +import apimodels.XmlItem; import play.mvc.Http; import java.util.List; @@ -18,6 +19,11 @@ import java.io.FileInputStream; import javax.validation.constraints.*; public class FakeApiControllerImp implements FakeApiControllerImpInterface { + @Override + public void createXmlItem(XmlItem xmlItem) throws Exception { + //Do your magic!!! + } + @Override public Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception { //Do your magic!!! @@ -25,7 +31,7 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface { } @Override - public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws Exception { + public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Exception { //Do your magic!!! return new OuterComposite(); } @@ -43,17 +49,17 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface { } @Override - public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws Exception { + public void testBodyWithFileSchema(FileSchemaTestClass body) throws Exception { //Do your magic!!! } @Override - public void testBodyWithQueryParams( @NotNull String query, User user) throws Exception { + public void testBodyWithQueryParams( @NotNull String query, User body) throws Exception { //Do your magic!!! } @Override - public Client testClientModel(Client client) throws Exception { + public Client testClientModel(Client body) throws Exception { //Do your magic!!! return new Client(); } @@ -69,7 +75,12 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface { } @Override - public void testInlineAdditionalProperties(Map requestBody) throws Exception { + public void testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws Exception { + //Do your magic!!! + } + + @Override + public void testInlineAdditionalProperties(Map param) throws Exception { //Do your magic!!! } @@ -78,4 +89,9 @@ public class FakeApiControllerImp implements FakeApiControllerImpInterface { //Do your magic!!! } + @Override + public void testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context) throws Exception { + //Do your magic!!! + } + } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java index e36e7c50120..3363805d153 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeApiControllerImpInterface.java @@ -9,6 +9,7 @@ import java.util.Map; import java.time.OffsetDateTime; import apimodels.OuterComposite; import apimodels.User; +import apimodels.XmlItem; import play.mvc.Http; import java.util.List; @@ -19,26 +20,32 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface FakeApiControllerImpInterface { + void createXmlItem(XmlItem xmlItem) throws Exception; + Boolean fakeOuterBooleanSerialize(Boolean body) throws Exception; - OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws Exception; + OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws Exception; BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws Exception; String fakeOuterStringSerialize(String body) throws Exception; - void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws Exception; + void testBodyWithFileSchema(FileSchemaTestClass body) throws Exception; - void testBodyWithQueryParams( @NotNull String query, User user) throws Exception; + void testBodyWithQueryParams( @NotNull String query, User body) throws Exception; - Client testClientModel(Client client) throws Exception; + Client testClientModel(Client body) throws Exception; void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, Http.MultipartFormData.FilePart binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws Exception; void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws Exception; - void testInlineAdditionalProperties(Map requestBody) throws Exception; + void testGroupParameters( @NotNull Integer requiredStringGroup, Boolean requiredBooleanGroup, @NotNull Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws Exception; + + void testInlineAdditionalProperties(Map param) throws Exception; void testJsonFormData(String param, String param2) throws Exception; + void testQueryParameterCollectionFormat( @NotNull List pipe, @NotNull List ioutil, @NotNull List http, @NotNull List url, @NotNull List context) throws Exception; + } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java index 748cb9f2af4..760b0a39416 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiController.java @@ -37,17 +37,17 @@ public class FakeClassnameTags123ApiController extends Controller { @ApiAction public Result testClassname() throws Exception { - JsonNode nodeclient = request().body().asJson(); - Client client; - if (nodeclient != null) { - client = mapper.readValue(nodeclient.toString(), Client.class); + JsonNode nodebody = request().body().asJson(); + Client body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Client.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(client); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Client' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Client obj = imp.testClassname(client); + Client obj = imp.testClassname(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java index 8427478bcdd..7d18dc42afb 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImp.java @@ -11,7 +11,7 @@ import javax.validation.constraints.*; public class FakeClassnameTags123ApiControllerImp implements FakeClassnameTags123ApiControllerImpInterface { @Override - public Client testClassname(Client client) throws Exception { + public Client testClassname(Client body) throws Exception { //Do your magic!!! return new Client(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java index 224e8fbd897..8ea6e6598f1 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/FakeClassnameTags123ApiControllerImpInterface.java @@ -11,6 +11,6 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface FakeClassnameTags123ApiControllerImpInterface { - Client testClassname(Client client) throws Exception; + Client testClassname(Client body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java index 4b5720896ee..e4427543e64 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ public class PetApiController extends Controller { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public class PetApiController extends Controller { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public class PetApiController extends Controller { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); @@ -185,13 +185,13 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } - Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); - if ((file == null || ((File) file.getFile()).length() == 0)) { - throw new IllegalArgumentException("'file' file cannot be empty"); + Http.MultipartFormData.FilePart requiredFile = request().body().asMultipartFormData().getFile("requiredFile"); + if ((requiredFile == null || ((File) requiredFile.getFile()).length() == 0)) { + throw new IllegalArgumentException("'requiredFile' file cannot be empty"); } - ModelApiResponse obj = imp.uploadFileWithRequiredFile(petId, file, additionalMetadata); + ModelApiResponse obj = imp.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java index 85e0c60ef6c..3d028b31863 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } @@ -57,7 +57,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart file, String additionalMetadata) throws Exception { + public ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart requiredFile, String additionalMetadata) throws Exception { //Do your magic!!! return new ModelApiResponse(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java index 1a87f77ac02..a6c88443756 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,12 +23,12 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; ModelApiResponse uploadFile(Long petId, String additionalMetadata, Http.MultipartFormData.FilePart file) throws Exception; - ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart file, String additionalMetadata) throws Exception; + ModelApiResponse uploadFileWithRequiredFile(Long petId, Http.MultipartFormData.FilePart requiredFile, String additionalMetadata) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java index 03d64c1346c..831f15dfe3c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public class StoreApiController extends Controller { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java index f2ededef32f..7c57d3d096c 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d40..b42e4d6d3d0 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java index 439fa190f58..aa3bbd80ba1 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ public class UserApiController extends Controller { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public class UserApiController extends Controller { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java index 63aafa7df25..0ea7a808b9a 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ import javax.validation.constraints.*; public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java index ee09b11e325..1290c84835f 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java index c707ca74ac7..385ef97a008 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes index 08762f3f8eb..29ab19d9951 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes +++ b/samples/server/petstore/java-play-framework-fake-endpoints/conf/routes @@ -6,9 +6,10 @@ GET /api controllers.ApiDocController.api #Functions for AnotherFake API -PATCH /v2/another-fake/dummy controllers.AnotherFakeApiController.testSpecialTags() +PATCH /v2/another-fake/dummy controllers.AnotherFakeApiController.call123testSpecialTags() #Functions for Fake API +POST /v2/fake/create_xml_item controllers.FakeApiController.createXmlItem() POST /v2/fake/outer/boolean controllers.FakeApiController.fakeOuterBooleanSerialize() POST /v2/fake/outer/composite controllers.FakeApiController.fakeOuterCompositeSerialize() POST /v2/fake/outer/number controllers.FakeApiController.fakeOuterNumberSerialize() @@ -18,8 +19,10 @@ PUT /v2/fake/body-with-query-params controllers.FakeApiC PATCH /v2/fake controllers.FakeApiController.testClientModel() POST /v2/fake controllers.FakeApiController.testEndpointParameters() GET /v2/fake controllers.FakeApiController.testEnumParameters() +DELETE /v2/fake controllers.FakeApiController.testGroupParameters() POST /v2/fake/inline-additionalProperties controllers.FakeApiController.testInlineAdditionalProperties() GET /v2/fake/jsonFormData controllers.FakeApiController.testJsonFormData() +PUT /v2/fake/test-query-paramters controllers.FakeApiController.testQueryParameterCollectionFormat() #Functions for FakeClassnameTags123 API PATCH /v2/fake_classname_test controllers.FakeClassnameTags123ApiController.testClassname() diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json index 6a55a7238e0..6b960fe5db4 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json +++ b/samples/server/petstore/java-play-framework-fake-endpoints/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io:80/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,34 +39,31 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { - "400" : { - "description" : "Invalid ID supplied", - "content" : { } - }, - "404" : { - "description" : "Pet not found", - "content" : { } + "200" : { + "content" : { }, + "description" : "successful operation" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" }, - "post" : { - "tags" : [ "pet" ], - "summary" : "Add a new pet to the store", - "operationId" : "addPet", + "put" : { + "operationId" : "updatePet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -82,149 +76,197 @@ } } }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { + "200" : { + "content" : { }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Pet not found" + }, "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Update an existing pet", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", "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", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ], - "default" : "available" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "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, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { - "tags" : [ "pet" ], - "summary" : "Find pet by ID", - "description" : "Returns a single pet", - "operationId" : "getPetById", + "delete" : { + "operationId" : "deletePet", "parameters" : [ { - "name" : "petId", + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", "in" : "path", - "description" : "ID of pet to return", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", + "tags" : [ "pet" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "Returns a single pet", + "operationId" : "getPetById", + "parameters" : [ { + "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -236,34 +278,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -272,12 +315,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -286,61 +329,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -349,13 +361,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -364,58 +376,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +434,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,71 +450,29 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/store/order/{order_id}" : { - "get" : { - "tags" : [ "store" ], - "summary" : "Find purchase order by ID", - "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - "operationId" : "getOrderById", - "parameters" : [ { - "name" : "order_id", - "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" - }, "delete" : { - "tags" : [ "store" ], - "summary" : "Delete purchase order by ID", "description" : "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", "operationId" : "deleteOrder", "parameters" : [ { - "name" : "order_id", - "in" : "path", "description" : "ID of the order that needs to be deleted", + "in" : "path", + "name" : "order_id", "required" : true, "schema" : { "type" : "string" @@ -511,25 +480,68 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "order_id", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +549,97 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -631,67 +647,93 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "X-Expires-After" : { "description" : "date in UTC when token expires", "schema" : { - "type" : "string", - "format" : "date-time" - } - } - }, - "content" : { - "application/xml" : { - "schema" : { - "type" : "string" - } - }, - "application/json" : { - "schema" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -699,7 +741,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +752,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -747,56 +788,31 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updated user", "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-codegen-request-body-name" : "body", + "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/fake_classname_test" : { "patch" : { - "tags" : [ "fake_classname_tags 123#$%^" ], - "summary" : "To test class name in snake case", "description" : "To test class name in snake case", "operationId" : "testClassname", "requestBody" : { - "description" : "client model", "content" : { "application/json" : { "schema" : { @@ -804,96 +820,160 @@ } } }, + "description" : "client model", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Client" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key_query" : [ ] } ], + "summary" : "To test class name in snake case", + "tags" : [ "fake_classname_tags 123#$%^" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/fake" : { - "get" : { + "delete" : { + "description" : "Fake endpoint to test group parameters (optional)", + "operationId" : "testGroupParameters", + "parameters" : [ { + "description" : "Required String in group parameters", + "in" : "query", + "name" : "required_string_group", + "required" : true, + "schema" : { + "type" : "integer" + } + }, { + "description" : "Required Boolean in group parameters", + "in" : "header", + "name" : "required_boolean_group", + "required" : true, + "schema" : { + "type" : "boolean" + } + }, { + "description" : "Required Integer in group parameters", + "in" : "query", + "name" : "required_int64_group", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + }, { + "description" : "String in group parameters", + "in" : "query", + "name" : "string_group", + "schema" : { + "type" : "integer" + } + }, { + "description" : "Boolean in group parameters", + "in" : "header", + "name" : "boolean_group", + "schema" : { + "type" : "boolean" + } + }, { + "description" : "Integer in group parameters", + "in" : "query", + "name" : "int64_group", + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Someting wrong" + } + }, + "summary" : "Fake endpoint to test group parameters (optional)", "tags" : [ "fake" ], - "summary" : "To test enum parameters", + "x-group-parameters" : true, + "x-accepts" : "application/json" + }, + "get" : { "description" : "To test enum parameters", "operationId" : "testEnumParameters", "parameters" : [ { - "name" : "enum_header_string_array", - "in" : "header", "description" : "Header parameter enum test (string array)", - "style" : "simple", "explode" : false, - "schema" : { - "type" : "array", - "items" : { - "type" : "string", - "enum" : [ ">", "$" ], - "default" : "$" - } - } - }, { - "name" : "enum_header_string", "in" : "header", - "description" : "Header parameter enum test (string)", + "name" : "enum_header_string_array", "schema" : { - "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" - } - }, { - "name" : "enum_query_string_array", - "in" : "query", - "description" : "Query parameter enum test (string array)", - "style" : "form", - "explode" : false, - "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "$", "enum" : [ ">", "$" ], - "default" : "$" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "simple" }, { - "name" : "enum_query_string", - "in" : "query", - "description" : "Query parameter enum test (string)", + "description" : "Header parameter enum test (string)", + "in" : "header", + "name" : "enum_header_string", "schema" : { - "type" : "string", + "default" : "-efg", "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "type" : "string" } }, { + "description" : "Query parameter enum test (string array)", + "explode" : false, + "in" : "query", + "name" : "enum_query_string_array", + "schema" : { + "items" : { + "default" : "$", + "enum" : [ ">", "$" ], + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" + }, { + "description" : "Query parameter enum test (string)", + "in" : "query", + "name" : "enum_query_string", + "schema" : { + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ], + "type" : "string" + } + }, { + "description" : "Query parameter enum test (double)", + "in" : "query", "name" : "enum_query_integer", - "in" : "query", - "description" : "Query parameter enum test (double)", "schema" : { - "type" : "integer", + "enum" : [ 1, -2 ], "format" : "int32", - "enum" : [ 1, -2 ] + "type" : "integer" } }, { - "name" : "enum_query_double", - "in" : "query", "description" : "Query parameter enum test (double)", + "in" : "query", + "name" : "enum_query_double", "schema" : { - "type" : "number", + "enum" : [ 1.1, -1.2 ], "format" : "double", - "enum" : [ 1.1, -1.2 ] + "type" : "number" } } ], "requestBody" : { @@ -902,19 +982,19 @@ "schema" : { "properties" : { "enum_form_string_array" : { - "type" : "array", "description" : "Form parameter enum test (string array)", "items" : { - "type" : "string", + "default" : "$", "enum" : [ ">", "$" ], - "default" : "$" - } + "type" : "string" + }, + "type" : "array" }, "enum_form_string" : { - "type" : "string", + "default" : "-efg", "description" : "Form parameter enum test (string)", "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" + "type" : "string" } } } @@ -923,135 +1003,23 @@ }, "responses" : { "400" : { - "description" : "Invalid request", - "content" : { } + "content" : { }, + "description" : "Invalid request" }, "404" : { - "description" : "Not found", - "content" : { } + "content" : { }, + "description" : "Not found" } }, - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "post" : { + "summary" : "To test enum parameters", "tags" : [ "fake" ], - "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", - "description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", - "operationId" : "testEndpointParameters", - "requestBody" : { - "content" : { - "application/x-www-form-urlencoded" : { - "schema" : { - "required" : [ "byte", "double", "number", "pattern_without_delimiter" ], - "properties" : { - "integer" : { - "maximum" : 100, - "minimum" : 10, - "type" : "integer", - "description" : "None" - }, - "int32" : { - "maximum" : 200, - "minimum" : 20, - "type" : "integer", - "description" : "None", - "format" : "int32" - }, - "int64" : { - "type" : "integer", - "description" : "None", - "format" : "int64" - }, - "number" : { - "maximum" : 543.2, - "minimum" : 32.1, - "type" : "number", - "description" : "None" - }, - "float" : { - "maximum" : 987.6, - "type" : "number", - "description" : "None", - "format" : "float" - }, - "double" : { - "maximum" : 123.4, - "minimum" : 67.8, - "type" : "number", - "description" : "None", - "format" : "double" - }, - "string" : { - "pattern" : "/[a-z]/i", - "type" : "string", - "description" : "None" - }, - "pattern_without_delimiter" : { - "pattern" : "^[A-Z].*", - "type" : "string", - "description" : "None" - }, - "byte" : { - "type" : "string", - "description" : "None", - "format" : "byte" - }, - "binary" : { - "type" : "string", - "description" : "None", - "format" : "binary" - }, - "date" : { - "type" : "string", - "description" : "None", - "format" : "date" - }, - "dateTime" : { - "type" : "string", - "description" : "None", - "format" : "date-time" - }, - "password" : { - "maxLength" : 64, - "minLength" : 10, - "type" : "string", - "description" : "None", - "format" : "password" - }, - "callback" : { - "type" : "string", - "description" : "None" - } - } - } - } - }, - "required" : true - }, - "responses" : { - "400" : { - "description" : "Invalid username supplied", - "content" : { } - }, - "404" : { - "description" : "User not found", - "content" : { } - } - }, - "security" : [ { - "http_basic_test" : [ ] - } ], "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" }, "patch" : { - "tags" : [ "fake" ], - "summary" : "To test \"client\" model", "description" : "To test \"client\" model", "operationId" : "testClientModel", "requestBody" : { - "description" : "client model", "content" : { "application/json" : { "schema" : { @@ -1059,31 +1027,145 @@ } } }, + "description" : "client model", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Client" } } - } + }, + "description" : "successful operation" } }, + "summary" : "To test \"client\" model", + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" + }, + "post" : { + "description" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", + "operationId" : "testEndpointParameters", + "requestBody" : { + "content" : { + "application/x-www-form-urlencoded" : { + "schema" : { + "properties" : { + "integer" : { + "description" : "None", + "format" : "int32", + "maximum" : 100, + "minimum" : 10, + "type" : "integer" + }, + "int32" : { + "description" : "None", + "format" : "int32", + "maximum" : 200, + "minimum" : 20, + "type" : "integer" + }, + "int64" : { + "description" : "None", + "format" : "int64", + "type" : "integer" + }, + "number" : { + "description" : "None", + "maximum" : 543.2, + "minimum" : 32.1, + "type" : "number" + }, + "float" : { + "description" : "None", + "format" : "float", + "maximum" : 987.6, + "type" : "number" + }, + "double" : { + "description" : "None", + "format" : "double", + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number" + }, + "string" : { + "description" : "None", + "pattern" : "/[a-z]/i", + "type" : "string" + }, + "pattern_without_delimiter" : { + "description" : "None", + "pattern" : "^[A-Z].*", + "type" : "string" + }, + "byte" : { + "description" : "None", + "format" : "byte", + "type" : "string" + }, + "binary" : { + "description" : "None", + "format" : "binary", + "type" : "string" + }, + "date" : { + "description" : "None", + "format" : "date", + "type" : "string" + }, + "dateTime" : { + "description" : "None", + "format" : "date-time", + "type" : "string" + }, + "password" : { + "description" : "None", + "format" : "password", + "maxLength" : 64, + "minLength" : 10, + "type" : "string" + }, + "callback" : { + "description" : "None", + "type" : "string" + } + }, + "required" : [ "byte", "double", "number", "pattern_without_delimiter" ] + } + } + }, + "required" : true + }, + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "security" : [ { + "http_basic_test" : [ ] + } ], + "summary" : "Fake endpoint for testing various parameters\n假端點\n偽のエンドポイント\n가짜 엔드 포인트\n", + "tags" : [ "fake" ], + "x-contentType" : "application/x-www-form-urlencoded", + "x-accepts" : "application/json" } }, "/fake/outer/number" : { "post" : { - "tags" : [ "fake" ], "description" : "Test serialization of outer number types", "operationId" : "fakeOuterNumberSerialize", "requestBody" : { - "description" : "Input number as post body", "content" : { "*/*" : { "schema" : { @@ -1091,31 +1173,32 @@ } } }, + "description" : "Input number as post body", "required" : false }, "responses" : { "200" : { - "description" : "Output number", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/OuterNumber" } } - } + }, + "description" : "Output number" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } }, "/fake/outer/string" : { "post" : { - "tags" : [ "fake" ], "description" : "Test serialization of outer string types", "operationId" : "fakeOuterStringSerialize", "requestBody" : { - "description" : "Input string as post body", "content" : { "*/*" : { "schema" : { @@ -1123,31 +1206,32 @@ } } }, + "description" : "Input string as post body", "required" : false }, "responses" : { "200" : { - "description" : "Output string", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/OuterString" } } - } + }, + "description" : "Output string" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } }, "/fake/outer/boolean" : { "post" : { - "tags" : [ "fake" ], "description" : "Test serialization of outer boolean types", "operationId" : "fakeOuterBooleanSerialize", "requestBody" : { - "description" : "Input boolean as post body", "content" : { "*/*" : { "schema" : { @@ -1155,31 +1239,32 @@ } } }, + "description" : "Input boolean as post body", "required" : false }, "responses" : { "200" : { - "description" : "Output boolean", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/OuterBoolean" } } - } + }, + "description" : "Output boolean" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } }, "/fake/outer/composite" : { "post" : { - "tags" : [ "fake" ], "description" : "Test serialization of object with outer number type", "operationId" : "fakeOuterCompositeSerialize", "requestBody" : { - "description" : "Input composite as post body", "content" : { "*/*" : { "schema" : { @@ -1187,44 +1272,45 @@ } } }, + "description" : "Input composite as post body", "required" : false }, "responses" : { "200" : { - "description" : "Output composite", "content" : { "*/*" : { "schema" : { "$ref" : "#/components/schemas/OuterComposite" } } - } + }, + "description" : "Output composite" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "*/*" } }, "/fake/jsonFormData" : { "get" : { - "tags" : [ "fake" ], - "summary" : "test json serialization of form data", "operationId" : "testJsonFormData", "requestBody" : { "content" : { "application/x-www-form-urlencoded" : { "schema" : { - "required" : [ "param", "param2" ], "properties" : { "param" : { - "type" : "string", - "description" : "field1" + "description" : "field1", + "type" : "string" }, "param2" : { - "type" : "string", - "description" : "field2" + "description" : "field2", + "type" : "string" } - } + }, + "required" : [ "param", "param2" ] } } }, @@ -1232,50 +1318,52 @@ }, "responses" : { "200" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "test json serialization of form data", + "tags" : [ "fake" ], "x-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/fake/inline-additionalProperties" : { "post" : { - "tags" : [ "fake" ], - "summary" : "test inline additionalProperties", "operationId" : "testInlineAdditionalProperties", "requestBody" : { - "description" : "request body", "content" : { "application/json" : { "schema" : { - "type" : "object", "additionalProperties" : { "type" : "string" - } + }, + "type" : "object" } } }, + "description" : "request body", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "test inline additionalProperties", + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "param", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/fake/body-with-query-params" : { "put" : { - "tags" : [ "fake" ], "operationId" : "testBodyWithQueryParams", "parameters" : [ { - "name" : "query", "in" : "query", + "name" : "query", "required" : true, "schema" : { "type" : "string" @@ -1293,22 +1381,74 @@ }, "responses" : { "200" : { - "description" : "Success", - "content" : { } + "content" : { }, + "description" : "Success" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, + "/fake/create_xml_item" : { + "post" : { + "description" : "this route creates an XmlItem", + "operationId" : "createXmlItem", + "requestBody" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "application/xml; charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "application/xml; charset=utf-16" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "text/xml" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "text/xml; charset=utf-8" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + }, + "text/xml; charset=utf-16" : { + "schema" : { + "$ref" : "#/components/schemas/XmlItem" + } + } + }, + "description" : "XmlItem Body", + "required" : true + }, + "responses" : { + "200" : { + "content" : { }, + "description" : "successful operation" + } + }, + "summary" : "creates an XmlItem", + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "XmlItem", + "x-contentType" : "application/xml", + "x-accepts" : "application/json" + } + }, "/another-fake/dummy" : { "patch" : { - "tags" : [ "$another-fake?" ], - "summary" : "To test special tags", - "description" : "To test special tags", - "operationId" : "test_special_tags", + "description" : "To test special tags and operation ID starting with number", + "operationId" : "123_test_@#$%_special_tags", "requestBody" : { - "description" : "client model", "content" : { "application/json" : { "schema" : { @@ -1316,27 +1456,30 @@ } } }, + "description" : "client model", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/Client" } } - } + }, + "description" : "successful operation" } }, + "summary" : "To test special tags", + "tags" : [ "$another-fake?" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, "/fake/body-with-file-schema" : { "put" : { - "tags" : [ "fake" ], "description" : "For this test, the body for this request much reference a schema named `File`.", "operationId" : "testBodyWithFileSchema", "requestBody" : { @@ -1351,45 +1494,117 @@ }, "responses" : { "200" : { - "description" : "Success", - "content" : { } + "content" : { }, + "description" : "Success" } }, + "tags" : [ "fake" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "application/json", "x-accepts" : "application/json" } }, + "/fake/test-query-paramters" : { + "put" : { + "description" : "To test the collection format in query parameters", + "operationId" : "testQueryParameterCollectionFormat", + "parameters" : [ { + "explode" : false, + "in" : "query", + "name" : "pipe", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" + }, { + "in" : "query", + "name" : "ioutil", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + } + }, { + "in" : "query", + "name" : "http", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "style" : "spaceDelimited" + }, { + "explode" : false, + "in" : "query", + "name" : "url", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" + }, { + "explode" : true, + "in" : "query", + "name" : "context", + "required" : true, + "schema" : { + "items" : { + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" + } ], + "responses" : { + "200" : { + "content" : { }, + "description" : "Success" + } + }, + "tags" : [ "fake" ], + "x-accepts" : "application/json" + } + }, "/fake/{petId}/uploadImageWithRequiredFile" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image (required)", "operationId" : "uploadFileWithRequiredFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { "content" : { "multipart/form-data" : { "schema" : { - "required" : [ "file" ], "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, - "file" : { - "type" : "string", + "requiredFile" : { "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } - } + }, + "required" : [ "requiredFile" ] } } }, @@ -1397,19 +1612,21 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image (required)", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } @@ -1417,31 +1634,83 @@ }, "components" : { "schemas" : { - "Category" : { - "type" : "object", + "Order" : { + "example" : { + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "type" : "object", + "xml" : { + "name" : "Order" + } + }, + "Category" : { + "example" : { + "name" : "default-name", + "id" : 6 + }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" }, "name" : { + "default" : "default-name", "type" : "string" } }, - "example" : { - "name" : "name", - "id" : 6 - }, + "required" : [ "name" ], + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "type" : "object", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", "format" : "int64", + "type" : "integer", "x-is-unique" : true }, "username" : { @@ -1463,41 +1732,560 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "example" : { - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" - }, + "type" : "object", "xml" : { "name" : "User" } }, - "OuterNumber" : { - "type" : "number" - }, - "ArrayOfNumberOnly" : { - "type" : "object", + "Tag" : { + "example" : { + "name" : "name", + "id" : 1 + }, "properties" : { - "ArrayNumber" : { - "type" : "array", - "items" : { - "type" : "number" - } + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" } + }, + "type" : "object", + "xml" : { + "name" : "Tag" } }, - "Capitalization" : { + "Pet" : { + "example" : { + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "default-name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" + }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer", + "x-is-unique" : true + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], "type" : "object", + "xml" : { + "name" : "Pet" + } + }, + "ApiResponse" : { + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, + "properties" : { + "code" : { + "format" : "int32", + "type" : "integer" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "type" : "object" + }, + "$special[model.name]" : { + "properties" : { + "$special[property.name]" : { + "format" : "int64", + "type" : "integer" + } + }, + "type" : "object", + "xml" : { + "name" : "$special[model.name]" + } + }, + "Return" : { + "description" : "Model for testing reserved words", + "properties" : { + "return" : { + "format" : "int32", + "type" : "integer" + } + }, + "type" : "object", + "xml" : { + "name" : "Return" + } + }, + "Name" : { + "description" : "Model for testing model name same as property name", + "properties" : { + "name" : { + "format" : "int32", + "type" : "integer" + }, + "snake_case" : { + "format" : "int32", + "readOnly" : true, + "type" : "integer" + }, + "property" : { + "type" : "string" + }, + "123Number" : { + "readOnly" : true, + "type" : "integer" + } + }, + "required" : [ "name" ], + "type" : "object", + "xml" : { + "name" : "Name" + } + }, + "200_response" : { + "description" : "Model for testing model name starting with number", + "properties" : { + "name" : { + "format" : "int32", + "type" : "integer" + }, + "class" : { + "type" : "string" + } + }, + "type" : "object", + "xml" : { + "name" : "Name" + } + }, + "ClassModel" : { + "description" : "Model for testing model with \"_class\" property", + "properties" : { + "_class" : { + "type" : "string" + } + }, + "type" : "object" + }, + "Dog" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Dog_allOf" + } ] + }, + "Cat" : { + "allOf" : [ { + "$ref" : "#/components/schemas/Animal" + }, { + "$ref" : "#/components/schemas/Cat_allOf" + } ] + }, + "Animal" : { + "discriminator" : { + "propertyName" : "className" + }, + "properties" : { + "className" : { + "type" : "string" + }, + "color" : { + "default" : "red", + "type" : "string" + } + }, + "required" : [ "className" ], + "type" : "object" + }, + "AnimalFarm" : { + "items" : { + "$ref" : "#/components/schemas/Animal" + }, + "type" : "array" + }, + "format_test" : { + "properties" : { + "integer" : { + "maximum" : 1E+2, + "minimum" : 1E+1, + "type" : "integer" + }, + "int32" : { + "format" : "int32", + "maximum" : 2E+2, + "minimum" : 2E+1, + "type" : "integer" + }, + "int64" : { + "format" : "int64", + "type" : "integer" + }, + "number" : { + "maximum" : 543.2, + "minimum" : 32.1, + "type" : "number" + }, + "float" : { + "format" : "float", + "maximum" : 987.6, + "minimum" : 54.3, + "type" : "number" + }, + "double" : { + "format" : "double", + "maximum" : 123.4, + "minimum" : 67.8, + "type" : "number" + }, + "string" : { + "pattern" : "/[a-z]/i", + "type" : "string" + }, + "byte" : { + "format" : "byte", + "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", + "type" : "string" + }, + "binary" : { + "format" : "binary", + "type" : "string" + }, + "date" : { + "format" : "date", + "type" : "string" + }, + "dateTime" : { + "format" : "date-time", + "type" : "string" + }, + "uuid" : { + "example" : "72f98069-206d-4f12-9f12-3d1e525a8e84", + "format" : "uuid", + "type" : "string" + }, + "password" : { + "format" : "password", + "maxLength" : 64, + "minLength" : 10, + "type" : "string" + } + }, + "required" : [ "byte", "date", "number", "password" ], + "type" : "object" + }, + "EnumClass" : { + "default" : "-efg", + "enum" : [ "_abc", "-efg", "(xyz)" ], + "type" : "string" + }, + "Enum_Test" : { + "properties" : { + "enum_string" : { + "enum" : [ "UPPER", "lower", "" ], + "type" : "string" + }, + "enum_string_required" : { + "enum" : [ "UPPER", "lower", "" ], + "type" : "string" + }, + "enum_integer" : { + "enum" : [ 1, -1 ], + "format" : "int32", + "type" : "integer" + }, + "enum_number" : { + "enum" : [ 1.1, -1.2 ], + "format" : "double", + "type" : "number" + }, + "outerEnum" : { + "$ref" : "#/components/schemas/OuterEnum" + } + }, + "required" : [ "enum_string_required" ], + "type" : "object" + }, + "AdditionalPropertiesClass" : { + "properties" : { + "map_string" : { + "additionalProperties" : { + "type" : "string" + }, + "type" : "object" + }, + "map_number" : { + "additionalProperties" : { + "type" : "number" + }, + "type" : "object" + }, + "map_integer" : { + "additionalProperties" : { + "type" : "integer" + }, + "type" : "object" + }, + "map_boolean" : { + "additionalProperties" : { + "type" : "boolean" + }, + "type" : "object" + }, + "map_array_integer" : { + "additionalProperties" : { + "items" : { + "type" : "integer" + }, + "type" : "array" + }, + "type" : "object" + }, + "map_array_anytype" : { + "additionalProperties" : { + "items" : { + "properties" : { }, + "type" : "object" + }, + "type" : "array" + }, + "type" : "object" + }, + "map_map_string" : { + "additionalProperties" : { + "additionalProperties" : { + "type" : "string" + }, + "type" : "object" + }, + "type" : "object" + }, + "map_map_anytype" : { + "additionalProperties" : { + "additionalProperties" : { + "properties" : { }, + "type" : "object" + }, + "type" : "object" + }, + "type" : "object" + }, + "anytype_1" : { + "properties" : { }, + "type" : "object" + }, + "anytype_2" : { + "type" : "object" + }, + "anytype_3" : { + "properties" : { }, + "type" : "object" + } + }, + "type" : "object" + }, + "AdditionalPropertiesString" : { + "additionalProperties" : { + "type" : "string" + }, + "properties" : { + "name" : { + "type" : "string" + } + }, + "type" : "object" + }, + "AdditionalPropertiesInteger" : { + "additionalProperties" : { + "type" : "integer" + }, + "properties" : { + "name" : { + "type" : "string" + } + }, + "type" : "object" + }, + "AdditionalPropertiesNumber" : { + "additionalProperties" : { + "type" : "number" + }, + "properties" : { + "name" : { + "type" : "string" + } + }, + "type" : "object" + }, + "AdditionalPropertiesBoolean" : { + "additionalProperties" : { + "type" : "boolean" + }, + "properties" : { + "name" : { + "type" : "string" + } + }, + "type" : "object" + }, + "AdditionalPropertiesArray" : { + "additionalProperties" : { + "items" : { + "properties" : { }, + "type" : "object" + }, + "type" : "array" + }, + "properties" : { + "name" : { + "type" : "string" + } + }, + "type" : "object" + }, + "AdditionalPropertiesObject" : { + "additionalProperties" : { + "additionalProperties" : { + "properties" : { }, + "type" : "object" + }, + "type" : "object" + }, + "properties" : { + "name" : { + "type" : "string" + } + }, + "type" : "object" + }, + "AdditionalPropertiesAnyType" : { + "additionalProperties" : { + "properties" : { }, + "type" : "object" + }, + "properties" : { + "name" : { + "type" : "string" + } + }, + "type" : "object" + }, + "MixedPropertiesAndAdditionalPropertiesClass" : { + "properties" : { + "uuid" : { + "format" : "uuid", + "type" : "string" + }, + "dateTime" : { + "format" : "date-time", + "type" : "string" + }, + "map" : { + "additionalProperties" : { + "$ref" : "#/components/schemas/Animal" + }, + "type" : "object" + } + }, + "type" : "object" + }, + "List" : { + "properties" : { + "123-list" : { + "type" : "string" + } + }, + "type" : "object" + }, + "Client" : { + "example" : { + "client" : "client" + }, + "properties" : { + "client" : { + "type" : "string" + } + }, + "type" : "object" + }, + "ReadOnlyFirst" : { + "properties" : { + "bar" : { + "readOnly" : true, + "type" : "string" + }, + "baz" : { + "type" : "string" + } + }, + "type" : "object" + }, + "hasOnlyReadOnly" : { + "properties" : { + "bar" : { + "readOnly" : true, + "type" : "string" + }, + "foo" : { + "readOnly" : true, + "type" : "string" + } + }, + "type" : "object" + }, + "Capitalization" : { "properties" : { "smallCamel" : { "type" : "string" @@ -1515,314 +2303,134 @@ "type" : "string" }, "ATT_NAME" : { - "type" : "string", - "description" : "Name of the pet\n" + "description" : "Name of the pet\n", + "type" : "string" } - } + }, + "type" : "object" }, - "MixedPropertiesAndAdditionalPropertiesClass" : { - "type" : "object", + "MapTest" : { "properties" : { - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" - }, - "map" : { - "type" : "object", + "map_map_of_string" : { "additionalProperties" : { - "$ref" : "#/components/schemas/Animal" - } - } - } - }, - "ApiResponse" : { - "type" : "object", - "properties" : { - "code" : { - "type" : "integer", - "format" : "int32" + "additionalProperties" : { + "type" : "string" + }, + "type" : "object" + }, + "type" : "object" }, - "type" : { - "type" : "string" + "map_of_enum_string" : { + "additionalProperties" : { + "enum" : [ "UPPER", "lower" ], + "type" : "string" + }, + "type" : "object" }, - "message" : { - "type" : "string" + "direct_map" : { + "additionalProperties" : { + "type" : "boolean" + }, + "type" : "object" + }, + "indirect_map" : { + "additionalProperties" : { + "type" : "boolean" + }, + "type" : "object" } }, - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "type" : "object" }, - "Name" : { - "required" : [ "name" ], - "type" : "object", + "ArrayTest" : { "properties" : { - "name" : { - "type" : "integer", - "format" : "int32" + "array_of_string" : { + "items" : { + "type" : "string" + }, + "type" : "array" }, - "snake_case" : { - "type" : "integer", - "format" : "int32", - "readOnly" : true + "array_array_of_integer" : { + "items" : { + "items" : { + "format" : "int64", + "type" : "integer" + }, + "type" : "array" + }, + "type" : "array" }, - "property" : { - "type" : "string" - }, - "123Number" : { - "type" : "integer", - "readOnly" : true + "array_array_of_model" : { + "items" : { + "items" : { + "$ref" : "#/components/schemas/ReadOnlyFirst" + }, + "type" : "array" + }, + "type" : "array" } }, - "description" : "Model for testing model name same as property name", - "xml" : { - "name" : "Name" - } - }, - "EnumClass" : { - "type" : "string", - "enum" : [ "_abc", "-efg", "(xyz)" ], - "default" : "-efg" - }, - "List" : { - "type" : "object", - "properties" : { - "123-list" : { - "type" : "string" - } - }, - "example" : { - "123-list" : "123-list" - } + "type" : "object" }, "NumberOnly" : { - "type" : "object", "properties" : { "JustNumber" : { "type" : "number" } - } + }, + "type" : "object" }, - "200_response" : { - "type" : "object", + "ArrayOfNumberOnly" : { "properties" : { - "name" : { - "type" : "integer", - "format" : "int32" - }, - "class" : { - "type" : "string" + "ArrayNumber" : { + "items" : { + "type" : "number" + }, + "type" : "array" } }, - "description" : "Model for testing model name starting with number", - "xml" : { - "name" : "Name" - } - }, - "Client" : { - "type" : "object", - "properties" : { - "client" : { - "type" : "string" - } - }, - "example" : { - "client" : "client" - } - }, - "Dog" : { - "allOf" : [ { - "$ref" : "#/components/schemas/Animal" - }, { - "type" : "object", - "properties" : { - "breed" : { - "type" : "string" - } - } - } ] - }, - "Enum_Test" : { - "required" : [ "enum_string_required" ], - "type" : "object", - "properties" : { - "enum_string" : { - "type" : "string", - "enum" : [ "UPPER", "lower", "" ] - }, - "enum_string_required" : { - "type" : "string", - "enum" : [ "UPPER", "lower", "" ] - }, - "enum_integer" : { - "type" : "integer", - "format" : "int32", - "enum" : [ 1, -1 ] - }, - "enum_number" : { - "type" : "number", - "format" : "double", - "enum" : [ 1.1, -1.2 ] - }, - "outerEnum" : { - "$ref" : "#/components/schemas/OuterEnum" - } - } - }, - "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 - } - }, - "example" : { - "petId" : 6, - "quantity" : 1, - "id" : 0, - "shipDate" : "2000-01-23T04:56:07.000+00:00", - "complete" : false, - "status" : "placed" - }, - "xml" : { - "name" : "Order" - } - }, - "AdditionalPropertiesClass" : { - "type" : "object", - "properties" : { - "map_property" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "map_of_map_property" : { - "type" : "object", - "additionalProperties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - } - } - }, - "$special[model.name]" : { - "type" : "object", - "properties" : { - "$special[property.name]" : { - "type" : "integer", - "format" : "int64" - } - }, - "xml" : { - "name" : "$special[model.name]" - } - }, - "Return" : { - "type" : "object", - "properties" : { - "return" : { - "type" : "integer", - "format" : "int32" - } - }, - "description" : "Model for testing reserved words", - "xml" : { - "name" : "Return" - } - }, - "ReadOnlyFirst" : { - "type" : "object", - "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "baz" : { - "type" : "string" - } - } + "type" : "object" }, "ArrayOfArrayOfNumberOnly" : { - "type" : "object", "properties" : { "ArrayArrayNumber" : { - "type" : "array", "items" : { - "type" : "array", "items" : { "type" : "number" - } - } + }, + "type" : "array" + }, + "type" : "array" } - } + }, + "type" : "object" + }, + "EnumArrays" : { + "properties" : { + "just_symbol" : { + "enum" : [ ">=", "$" ], + "type" : "string" + }, + "array_enum" : { + "items" : { + "enum" : [ "fish", "crab" ], + "type" : "string" + }, + "type" : "array" + } + }, + "type" : "object" }, "OuterEnum" : { - "type" : "string", - "enum" : [ "placed", "approved", "delivered" ] - }, - "ArrayTest" : { - "type" : "object", - "properties" : { - "array_of_string" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "array_array_of_integer" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "type" : "integer", - "format" : "int64" - } - } - }, - "array_array_of_model" : { - "type" : "array", - "items" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ReadOnlyFirst" - } - } - } - } + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" }, "OuterComposite" : { - "type" : "object", + "example" : { + "my_string" : "my_string", + "my_number" : 0.8008281904610115, + "my_boolean" : true + }, "properties" : { "my_number" : { "type" : "number" @@ -1835,126 +2443,25 @@ "x-codegen-body-parameter-name" : "boolean_post_body" } }, - "example" : { - "my_string" : "my_string", - "my_number" : 0.80082819046101150206595775671303272247314453125, - "my_boolean" : true - } + "type" : "object" }, - "format_test" : { - "required" : [ "byte", "date", "number", "password" ], - "type" : "object", - "properties" : { - "integer" : { - "maximum" : 1E+2, - "minimum" : 1E+1, - "type" : "integer" - }, - "int32" : { - "maximum" : 2E+2, - "minimum" : 2E+1, - "type" : "integer", - "format" : "int32" - }, - "int64" : { - "type" : "integer", - "format" : "int64" - }, - "number" : { - "maximum" : 543.2, - "minimum" : 32.1, - "type" : "number" - }, - "float" : { - "maximum" : 987.6, - "minimum" : 54.3, - "type" : "number", - "format" : "float" - }, - "double" : { - "maximum" : 123.4, - "minimum" : 67.8, - "type" : "number", - "format" : "double" - }, - "string" : { - "pattern" : "/[a-z]/i", - "type" : "string" - }, - "byte" : { - "pattern" : "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$", - "type" : "string", - "format" : "byte" - }, - "binary" : { - "type" : "string", - "format" : "binary" - }, - "date" : { - "type" : "string", - "format" : "date" - }, - "dateTime" : { - "type" : "string", - "format" : "date-time" - }, - "uuid" : { - "type" : "string", - "format" : "uuid" - }, - "password" : { - "maxLength" : 64, - "minLength" : 10, - "type" : "string", - "format" : "password" - } - } - }, - "EnumArrays" : { - "type" : "object", - "properties" : { - "just_symbol" : { - "type" : "string", - "enum" : [ ">=", "$" ] - }, - "array_enum" : { - "type" : "array", - "items" : { - "type" : "string", - "enum" : [ "fish", "crab" ] - } - } - } + "OuterNumber" : { + "type" : "number" }, "OuterString" : { "type" : "string" }, - "ClassModel" : { - "type" : "object", - "properties" : { - "_class" : { - "type" : "string" - } - }, - "description" : "Model for testing model with \"_class\" property" - }, "OuterBoolean" : { "type" : "boolean", "x-codegen-body-parameter-name" : "boolean_post_body" }, - "FileSchemaTestClass" : { - "type" : "object", - "properties" : { - "file" : { - "$ref" : "#/components/schemas/File" - }, - "files" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/File" - } - } + "StringBooleanMap" : { + "additionalProperties" : { + "type" : "boolean" }, + "type" : "object" + }, + "FileSchemaTestClass" : { "example" : { "file" : { "sourceURI" : "sourceURI" @@ -1964,189 +2471,358 @@ }, { "sourceURI" : "sourceURI" } ] - } - }, - "Animal" : { - "required" : [ "className" ], - "type" : "object", + }, "properties" : { - "className" : { - "type" : "string" + "file" : { + "$ref" : "#/components/schemas/File" }, - "color" : { - "type" : "string", - "default" : "red" + "files" : { + "items" : { + "$ref" : "#/components/schemas/File" + }, + "type" : "array" } }, - "discriminator" : { - "propertyName" : "className" - } - }, - "StringBooleanMap" : { - "type" : "object", - "additionalProperties" : { - "type" : "boolean" - } - }, - "Cat" : { - "allOf" : [ { - "$ref" : "#/components/schemas/Animal" - }, { - "type" : "object", - "properties" : { - "declawed" : { - "type" : "boolean" - } - } - } ] - }, - "MapTest" : { - "type" : "object", - "properties" : { - "map_map_of_string" : { - "type" : "object", - "additionalProperties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } - }, - "map_of_enum_string" : { - "type" : "object", - "additionalProperties" : { - "type" : "string", - "enum" : [ "UPPER", "lower" ] - } - }, - "direct_map" : { - "type" : "object", - "additionalProperties" : { - "type" : "boolean" - } - }, - "indirect_map" : { - "$ref" : "#/components/schemas/StringBooleanMap" - } - } - }, - "Tag" : { - "type" : "object", - "properties" : { - "id" : { - "type" : "integer", - "format" : "int64" - }, - "name" : { - "type" : "string" - } - }, - "example" : { - "name" : "name", - "id" : 1 - }, - "xml" : { - "name" : "Tag" - } - }, - "AnimalFarm" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/Animal" - } + "type" : "object" }, "File" : { - "type" : "object", - "properties" : { - "sourceURI" : { - "type" : "string", - "description" : "Test capitalization" - } - }, + "description" : "Must be named `File` for test.", "example" : { "sourceURI" : "sourceURI" - } - }, - "Pet" : { - "required" : [ "name", "photoUrls" ], - "type" : "object", + }, "properties" : { - "id" : { - "type" : "integer", - "format" : "int64", - "x-is-unique" : true - }, - "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" ] + "sourceURI" : { + "description" : "Test capitalization", + "type" : "string" } }, - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 + "type" : "object" + }, + "TypeHolderDefault" : { + "properties" : { + "string_item" : { + "default" : "what", + "type" : "string" }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" + "number_item" : { + "type" : "number" + }, + "integer_item" : { + "type" : "integer" + }, + "bool_item" : { + "default" : true, + "type" : "boolean" + }, + "array_item" : { + "items" : { + "type" : "integer" + }, + "type" : "array" + } }, + "required" : [ "array_item", "bool_item", "integer_item", "number_item", "string_item" ], + "type" : "object" + }, + "TypeHolderExample" : { + "properties" : { + "string_item" : { + "example" : "what", + "type" : "string" + }, + "number_item" : { + "example" : 1.234, + "type" : "number" + }, + "integer_item" : { + "example" : -2, + "type" : "integer" + }, + "bool_item" : { + "example" : true, + "type" : "boolean" + }, + "array_item" : { + "example" : [ 0, 1, 2, 3 ], + "items" : { + "type" : "integer" + }, + "type" : "array" + } + }, + "required" : [ "array_item", "bool_item", "integer_item", "number_item", "string_item" ], + "type" : "object" + }, + "XmlItem" : { + "properties" : { + "attribute_string" : { + "example" : "string", + "type" : "string", + "xml" : { + "attribute" : true + } + }, + "attribute_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "attribute" : true + } + }, + "attribute_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "attribute" : true + } + }, + "attribute_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "attribute" : true + } + }, + "wrapped_array" : { + "items" : { + "type" : "integer" + }, + "type" : "array", + "xml" : { + "wrapped" : true + } + }, + "name_string" : { + "example" : "string", + "type" : "string", + "xml" : { + "name" : "xml_name_string" + } + }, + "name_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "name" : "xml_name_number" + } + }, + "name_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "name" : "xml_name_integer" + } + }, + "name_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "name" : "xml_name_boolean" + } + }, + "name_array" : { + "items" : { + "type" : "integer", + "xml" : { + "name" : "xml_name_array_item" + } + }, + "type" : "array" + }, + "name_wrapped_array" : { + "items" : { + "type" : "integer", + "xml" : { + "name" : "xml_name_wrapped_array_item" + } + }, + "type" : "array", + "xml" : { + "name" : "xml_name_wrapped_array", + "wrapped" : true + } + }, + "prefix_string" : { + "example" : "string", + "type" : "string", + "xml" : { + "prefix" : "ab" + } + }, + "prefix_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "prefix" : "cd" + } + }, + "prefix_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "prefix" : "ef" + } + }, + "prefix_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "prefix" : "gh" + } + }, + "prefix_array" : { + "items" : { + "type" : "integer", + "xml" : { + "prefix" : "ij" + } + }, + "type" : "array" + }, + "prefix_wrapped_array" : { + "items" : { + "type" : "integer", + "xml" : { + "prefix" : "mn" + } + }, + "type" : "array", + "xml" : { + "prefix" : "kl", + "wrapped" : true + } + }, + "namespace_string" : { + "example" : "string", + "type" : "string", + "xml" : { + "namespace" : "http://a.com/schema" + } + }, + "namespace_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "namespace" : "http://b.com/schema" + } + }, + "namespace_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "namespace" : "http://c.com/schema" + } + }, + "namespace_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "namespace" : "http://d.com/schema" + } + }, + "namespace_array" : { + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://e.com/schema" + } + }, + "type" : "array" + }, + "namespace_wrapped_array" : { + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://g.com/schema" + } + }, + "type" : "array", + "xml" : { + "namespace" : "http://f.com/schema", + "wrapped" : true + } + }, + "prefix_ns_string" : { + "example" : "string", + "type" : "string", + "xml" : { + "namespace" : "http://a.com/schema", + "prefix" : "a" + } + }, + "prefix_ns_number" : { + "example" : 1.234, + "type" : "number", + "xml" : { + "namespace" : "http://b.com/schema", + "prefix" : "b" + } + }, + "prefix_ns_integer" : { + "example" : -2, + "type" : "integer", + "xml" : { + "namespace" : "http://c.com/schema", + "prefix" : "c" + } + }, + "prefix_ns_boolean" : { + "example" : true, + "type" : "boolean", + "xml" : { + "namespace" : "http://d.com/schema", + "prefix" : "d" + } + }, + "prefix_ns_array" : { + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://e.com/schema", + "prefix" : "e" + } + }, + "type" : "array" + }, + "prefix_ns_wrapped_array" : { + "items" : { + "type" : "integer", + "xml" : { + "namespace" : "http://g.com/schema", + "prefix" : "g" + } + }, + "type" : "array", + "xml" : { + "namespace" : "http://f.com/schema", + "prefix" : "f", + "wrapped" : true + } + } + }, + "type" : "object", "xml" : { - "name" : "Pet" + "namespace" : "http://a.com/schema", + "prefix" : "pre" } }, - "hasOnlyReadOnly" : { - "type" : "object", + "Dog_allOf" : { "properties" : { - "bar" : { - "type" : "string", - "readOnly" : true - }, - "foo" : { - "type" : "string", - "readOnly" : true + "breed" : { + "type" : "string" + } + } + }, + "Cat_allOf" : { + "properties" : { + "declawed" : { + "type" : "boolean" } } } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -2155,21 +2831,22 @@ "read:pets" : "read your pets" } } - } - }, - "http_basic_test" : { - "type" : "http", - "scheme" : "basic" + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" }, "api_key_query" : { - "type" : "apiKey", + "in" : "query", "name" : "api_key_query", - "in" : "query" + "type" : "apiKey" + }, + "http_basic_test" : { + "scheme" : "basic", + "type" : "http" } } } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java index 44eb3a6bf7a..a4c373424f6 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Category.java @@ -11,10 +11,10 @@ import java.util.Objects; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java index 81a2333008b..666fa5ac4a1 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/ModelApiResponse.java @@ -11,13 +11,13 @@ import java.util.Objects; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java index a142a597426..b6b87b74345 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Order.java @@ -12,16 +12,16 @@ import java.util.Objects; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -46,18 +46,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java index ec14d76b41f..50aa303e7ae 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Pet.java @@ -15,13 +15,13 @@ import java.util.Objects; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -52,18 +52,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java index 80b1d783b33..7d0207c0258 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/Tag.java @@ -11,10 +11,10 @@ import java.util.Objects; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java index 221a9f30591..2ef166c2838 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/apimodels/User.java @@ -11,28 +11,28 @@ import java.util.Objects; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java index 63ed0f01c34..1fa710bf5bc 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiController.java @@ -35,14 +35,14 @@ public class PetApiController extends Controller { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -106,14 +106,14 @@ public class PetApiController extends Controller { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -124,14 +124,14 @@ public class PetApiController extends Controller { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -144,7 +144,7 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java index 6c5234d33bc..ed9b151a238 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImp.java @@ -12,7 +12,7 @@ import java.io.FileInputStream; public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -40,7 +40,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java index 05a5a2002fb..144362644af 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/PetApiControllerImpInterface.java @@ -12,7 +12,7 @@ import java.util.HashMap; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -22,7 +22,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java index 214a6a6afb4..029baa761df 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiController.java @@ -54,14 +54,14 @@ public class StoreApiController extends Controller { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); JsonNode result = mapper.valueToTree(obj); return ok(result); } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java index fb964dab3ed..b0d2d8f88a1 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImp.java @@ -28,7 +28,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java index 33f503ffd7f..7a9c3fd82e8 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/StoreApiControllerImpInterface.java @@ -17,6 +17,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById(Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java index 03e8392793c..9b78e828229 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java @@ -34,40 +34,40 @@ public class UserApiController extends Controller { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -113,14 +113,14 @@ public class UserApiController extends Controller { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java index cc9d1fdc8b4..8bf12fe7c82 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java @@ -11,17 +11,17 @@ import java.io.FileInputStream; public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -48,7 +48,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java index fdb3d301177..8c5a5ee0af6 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java @@ -11,11 +11,11 @@ import java.util.HashMap; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -25,6 +25,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java index 0fdd8c3cb4a..6c40f54de9d 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/openapitools/OpenAPIUtils.java @@ -79,6 +79,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json index ac1d4504782..50b8a737319 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-bean-validation/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,189 +39,222 @@ } } }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "responses" : { + "405" : { + "content" : { }, + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "post" : { + "summary" : "Update an existing pet", "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-codegen-request-body-name" : "body", "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", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ], - "default" : "available" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "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, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -236,34 +266,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -272,12 +303,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -349,13 +349,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -364,58 +364,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,71 +438,29 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "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", - "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" - }, "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { "type" : "string" @@ -511,25 +468,68 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "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" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -747,45 +776,23 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updated user", "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-codegen-request-body-name" : "body", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,35 +800,6 @@ "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, @@ -831,38 +809,76 @@ "complete" : false, "status" : "placed" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -883,89 +899,39 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "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" - }, + "title" : "a User", + "type" : "object", "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", "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" ], @@ -984,17 +950,62 @@ } ], "status" : "available" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1003,17 +1014,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1022,12 +1028,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java index 9f0206575f5..86c8ed0cdef 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Category.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java index 07493e84825..91638ac8c60 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java index d1aaa38d002..91d6d09e7f7 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Order.java @@ -13,16 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java index 5e5ff376294..627f21f8c09 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Pet.java @@ -16,13 +16,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java index 15a8774252a..1a9079ff345 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/Tag.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java index 689de768893..8df0a650670 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/apimodels/User.java @@ -12,28 +12,28 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java index 3bbbe36662a..f94630bf20c 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiController.java @@ -40,17 +40,17 @@ public class PetApiController extends Controller { @ApiAction public Result addPet() throws IOException { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -127,17 +127,17 @@ public class PetApiController extends Controller { @ApiAction public Result updatePet() throws IOException { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -148,14 +148,14 @@ public class PetApiController extends Controller { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -168,7 +168,7 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java index 2e129c9336f..e8d4a8b504a 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) { + public void addPet(Pet body) { //Do your magic!!! } @@ -41,7 +41,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public void updatePet(Pet pet) { + public void updatePet(Pet body) { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java index eaa035009c2..6efc073d0f2 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) ; + void addPet(Pet body) ; void deletePet(Long petId, String apiKey) ; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) ; - void updatePet(Pet pet) ; + void updatePet(Pet body) ; void updatePetWithForm(Long petId, String name, String status) ; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java index 0a29344d5ea..0836d1945e2 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiController.java @@ -62,17 +62,17 @@ public class StoreApiController extends Controller { @ApiAction public Result placeOrder() throws IOException { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java index e5cab1016f2..6406ee40e1f 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface { } @Override - public Order placeOrder(Order order) { + public Order placeOrder(Order body) { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java index 9a61d254de2..70d313028c6 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) ; - Order placeOrder(Order order) ; + Order placeOrder(Order body) ; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java index 1b5d4522954..07e8f831618 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java @@ -39,53 +39,53 @@ public class UserApiController extends Controller { @ApiAction public Result createUser() throws IOException { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws IOException { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws IOException { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -134,17 +134,17 @@ public class UserApiController extends Controller { @ApiAction public Result updateUser(String username) throws IOException { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java index 979dfab18ac..a6a588b6c8e 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ import javax.validation.constraints.*; public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) { + public void createUser(User body) { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) { + public void createUsersWithArrayInput(List body) { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) { + public void createUsersWithListInput(List body) { //Do your magic!!! } @@ -49,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { } @Override - public void updateUser(String username, User user) { + public void updateUser(String username, User body) { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java index 3d48559fd3e..c79d4b93820 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) ; + void createUser(User body) ; - void createUsersWithArrayInput(List user) ; + void createUsersWithArrayInput(List body) ; - void createUsersWithListInput(List user) ; + void createUsersWithListInput(List body) ; void deleteUser(String username) ; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() ; - void updateUser(String username, User user) ; + void updateUser(String username, User body) ; } diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java index c707ca74ac7..385ef97a008 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json index ac1d4504782..50b8a737319 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-exception-handling/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,189 +39,222 @@ } } }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "responses" : { + "405" : { + "content" : { }, + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "post" : { + "summary" : "Update an existing pet", "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-codegen-request-body-name" : "body", "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", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ], - "default" : "available" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "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, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -236,34 +266,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -272,12 +303,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -349,13 +349,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -364,58 +364,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,71 +438,29 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "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", - "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" - }, "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { "type" : "string" @@ -511,25 +468,68 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "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" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -747,45 +776,23 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updated user", "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-codegen-request-body-name" : "body", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,35 +800,6 @@ "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, @@ -831,38 +809,76 @@ "complete" : false, "status" : "placed" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -883,89 +899,39 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "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" - }, + "title" : "a User", + "type" : "object", "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", "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" ], @@ -984,17 +950,62 @@ } ], "status" : "available" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1003,17 +1014,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1022,12 +1028,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } } diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java index 9f0206575f5..86c8ed0cdef 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Category.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java index 07493e84825..91638ac8c60 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java index d1aaa38d002..91d6d09e7f7 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Order.java @@ -13,16 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java index 5e5ff376294..627f21f8c09 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Pet.java @@ -16,13 +16,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java index 15a8774252a..1a9079ff345 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/Tag.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java index 689de768893..8df0a650670 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/apimodels/User.java @@ -12,28 +12,28 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java index 74dc88d8ad6..dc9fa0cbbdf 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ public class PetApiController extends Controller { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public class PetApiController extends Controller { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public class PetApiController extends Controller { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java index 15bee18486e..3af35ea5303 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; public class PetApiControllerImp { - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public class PetApiControllerImp { } - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java index e84ba99993d..db21a0523d9 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public class StoreApiController extends Controller { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java index 5ee1178d5ff..119afe97fbf 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public class StoreApiControllerImp { } - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java index d0e01ef7720..d4365213a67 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ public class UserApiController extends Controller { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public class UserApiController extends Controller { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java index f4e968cc679..569811fe095 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ import javax.validation.constraints.*; public class UserApiControllerImp { - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public class UserApiControllerImp { } - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java index c707ca74ac7..385ef97a008 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json index ac1d4504782..50b8a737319 100644 --- a/samples/server/petstore/java-play-framework-no-interface/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-interface/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,189 +39,222 @@ } } }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "responses" : { + "405" : { + "content" : { }, + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "post" : { + "summary" : "Update an existing pet", "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-codegen-request-body-name" : "body", "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", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ], - "default" : "available" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "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, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -236,34 +266,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -272,12 +303,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -349,13 +349,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -364,58 +364,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,71 +438,29 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "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", - "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" - }, "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { "type" : "string" @@ -511,25 +468,68 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "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" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -747,45 +776,23 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updated user", "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-codegen-request-body-name" : "body", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,35 +800,6 @@ "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, @@ -831,38 +809,76 @@ "complete" : false, "status" : "placed" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -883,89 +899,39 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "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" - }, + "title" : "a User", + "type" : "object", "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", "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" ], @@ -984,17 +950,62 @@ } ], "status" : "available" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1003,17 +1014,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1022,12 +1028,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java index 9f0206575f5..86c8ed0cdef 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Category.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java index 07493e84825..91638ac8c60 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java index d1aaa38d002..91d6d09e7f7 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Order.java @@ -13,16 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java index 5e5ff376294..627f21f8c09 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Pet.java @@ -16,13 +16,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java index 15a8774252a..1a9079ff345 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/Tag.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java index 689de768893..8df0a650670 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/apimodels/User.java @@ -12,28 +12,28 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java index 8dff1940237..1344ffe7afb 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ public class PetApiController extends Controller { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public class PetApiController extends Controller { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public class PetApiController extends Controller { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java index 2cd201c4bc3..c025993f7c1 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java index 96163267580..307c6c18cfb 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java index 03d64c1346c..831f15dfe3c 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public class StoreApiController extends Controller { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java index f2ededef32f..7c57d3d096c 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d40..b42e4d6d3d0 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java index 439fa190f58..aa3bbd80ba1 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ public class UserApiController extends Controller { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public class UserApiController extends Controller { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java index 63aafa7df25..0ea7a808b9a 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ import javax.validation.constraints.*; public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java index ee09b11e325..1290c84835f 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java index c707ca74ac7..385ef97a008 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java index 9f0206575f5..86c8ed0cdef 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Category.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java index 07493e84825..91638ac8c60 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java index d1aaa38d002..91d6d09e7f7 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Order.java @@ -13,16 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java index 5e5ff376294..627f21f8c09 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Pet.java @@ -16,13 +16,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java index 15a8774252a..1a9079ff345 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/Tag.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java index 689de768893..8df0a650670 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/apimodels/User.java @@ -12,28 +12,28 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java index 9e1c362bfb0..9059f7e2d91 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiController.java @@ -38,17 +38,17 @@ public class PetApiController extends Controller { public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -125,17 +125,17 @@ public class PetApiController extends Controller { public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -146,14 +146,14 @@ public class PetApiController extends Controller { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -166,7 +166,7 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java index 2cd201c4bc3..c025993f7c1 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java index 96163267580..307c6c18cfb 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java index 5c73582f93d..da1876d0b99 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiController.java @@ -60,17 +60,17 @@ public class StoreApiController extends Controller { public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java index f2ededef32f..7c57d3d096c 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d40..b42e4d6d3d0 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java index 9dd1065fa8e..6bb02042260 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java @@ -37,53 +37,53 @@ public class UserApiController extends Controller { public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -132,17 +132,17 @@ public class UserApiController extends Controller { public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java index 63aafa7df25..0ea7a808b9a 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ import javax.validation.constraints.*; public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java index ee09b11e325..1290c84835f 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java index fca771cfb00..aff8786b457 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/openapitools/OpenAPIUtils.java @@ -93,6 +93,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json index ac1d4504782..50b8a737319 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,189 +39,222 @@ } } }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "responses" : { + "405" : { + "content" : { }, + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "post" : { + "summary" : "Update an existing pet", "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-codegen-request-body-name" : "body", "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", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ], - "default" : "available" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "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, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -236,34 +266,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -272,12 +303,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -349,13 +349,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -364,58 +364,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,71 +438,29 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "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", - "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" - }, "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { "type" : "string" @@ -511,25 +468,68 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "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" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -747,45 +776,23 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updated user", "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-codegen-request-body-name" : "body", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,35 +800,6 @@ "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, @@ -831,38 +809,76 @@ "complete" : false, "status" : "placed" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -883,89 +899,39 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "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" - }, + "title" : "a User", + "type" : "object", "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", "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" ], @@ -984,17 +950,62 @@ } ], "status" : "available" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1003,17 +1014,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1022,12 +1028,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } } diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION index dde25ef08e8..d1a8f58b388 100644 --- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.1-SNAPSHOT \ No newline at end of file +4.1.2-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Category.java b/samples/server/petstore/java-play-framework/app/apimodels/Category.java index 9f0206575f5..86c8ed0cdef 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Category.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Category.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Category { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Category id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java index 07493e84825..91638ac8c60 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/ModelApiResponse.java @@ -12,13 +12,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class ModelApiResponse { @JsonProperty("code") - private Integer code = null; + private Integer code; @JsonProperty("type") - private String type = null; + private String type; @JsonProperty("message") - private String message = null; + private String message; public ModelApiResponse code(Integer code) { this.code = code; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Order.java b/samples/server/petstore/java-play-framework/app/apimodels/Order.java index d1aaa38d002..91d6d09e7f7 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Order.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Order.java @@ -13,16 +13,16 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Order { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("petId") - private Long petId = null; + private Long petId; @JsonProperty("quantity") - private Integer quantity = null; + private Integer quantity; @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; + private OffsetDateTime shipDate; /** * Order Status @@ -47,18 +47,18 @@ public class Order { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; @JsonProperty("complete") private Boolean complete = false; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java index 5e5ff376294..627f21f8c09 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Pet.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Pet.java @@ -16,13 +16,13 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Pet { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("category") - private Category category = null; + private Category category; @JsonProperty("name") - private String name = null; + private String name; @JsonProperty("photoUrls") private List photoUrls = new ArrayList<>(); @@ -53,18 +53,18 @@ public class Pet { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } } @JsonProperty("status") - private StatusEnum status = null; + private StatusEnum status; public Pet id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java index 15a8774252a..1a9079ff345 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/Tag.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/Tag.java @@ -12,10 +12,10 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class Tag { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("name") - private String name = null; + private String name; public Tag id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/apimodels/User.java b/samples/server/petstore/java-play-framework/app/apimodels/User.java index 689de768893..8df0a650670 100644 --- a/samples/server/petstore/java-play-framework/app/apimodels/User.java +++ b/samples/server/petstore/java-play-framework/app/apimodels/User.java @@ -12,28 +12,28 @@ import javax.validation.constraints.*; @SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) public class User { @JsonProperty("id") - private Long id = null; + private Long id; @JsonProperty("username") - private String username = null; + private String username; @JsonProperty("firstName") - private String firstName = null; + private String firstName; @JsonProperty("lastName") - private String lastName = null; + private String lastName; @JsonProperty("email") - private String email = null; + private String email; @JsonProperty("password") - private String password = null; + private String password; @JsonProperty("phone") - private String phone = null; + private String phone; @JsonProperty("userStatus") - private Integer userStatus = null; + private Integer userStatus; public User id(Long id) { this.id = id; diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java index 8dff1940237..1344ffe7afb 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java @@ -39,17 +39,17 @@ public class PetApiController extends Controller { @ApiAction public Result addPet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.addPet(pet); + imp.addPet(body); return ok(); } @@ -126,17 +126,17 @@ public class PetApiController extends Controller { @ApiAction public Result updatePet() throws Exception { - JsonNode nodepet = request().body().asJson(); - Pet pet; - if (nodepet != null) { - pet = mapper.readValue(nodepet.toString(), Pet.class); + JsonNode nodebody = request().body().asJson(); + Pet body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Pet.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(pet); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Pet' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updatePet(pet); + imp.updatePet(body); return ok(); } @@ -147,14 +147,14 @@ public class PetApiController extends Controller { if (valuename != null) { name = valuename; } else { - name = "null"; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; if (valuestatus != null) { status = valuestatus; } else { - status = "null"; + status = null; } imp.updatePetWithForm(petId, name, status); return ok(); @@ -167,7 +167,7 @@ public class PetApiController extends Controller { if (valueadditionalMetadata != null) { additionalMetadata = valueadditionalMetadata; } else { - additionalMetadata = "null"; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file); diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java index 2cd201c4bc3..c025993f7c1 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImp.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; public class PetApiControllerImp implements PetApiControllerImpInterface { @Override - public void addPet(Pet pet) throws Exception { + public void addPet(Pet body) throws Exception { //Do your magic!!! } @@ -41,7 +41,7 @@ public class PetApiControllerImp implements PetApiControllerImpInterface { } @Override - public void updatePet(Pet pet) throws Exception { + public void updatePet(Pet body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java index 96163267580..307c6c18cfb 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiControllerImpInterface.java @@ -13,7 +13,7 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface PetApiControllerImpInterface { - void addPet(Pet pet) throws Exception; + void addPet(Pet body) throws Exception; void deletePet(Long petId, String apiKey) throws Exception; @@ -23,7 +23,7 @@ public interface PetApiControllerImpInterface { Pet getPetById(Long petId) throws Exception; - void updatePet(Pet pet) throws Exception; + void updatePet(Pet body) throws Exception; void updatePetWithForm(Long petId, String name, String status) throws Exception; diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java index 03d64c1346c..831f15dfe3c 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiController.java @@ -61,17 +61,17 @@ public class StoreApiController extends Controller { @ApiAction public Result placeOrder() throws Exception { - JsonNode nodeorder = request().body().asJson(); - Order order; - if (nodeorder != null) { - order = mapper.readValue(nodeorder.toString(), Order.class); + JsonNode nodebody = request().body().asJson(); + Order body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), Order.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(order); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'Order' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - Order obj = imp.placeOrder(order); + Order obj = imp.placeOrder(body); if (configuration.getBoolean("useOutputBeanValidation")) { OpenAPIUtils.validate(obj); } diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java index f2ededef32f..7c57d3d096c 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImp.java @@ -29,7 +29,7 @@ public class StoreApiControllerImp implements StoreApiControllerImpInterface { } @Override - public Order placeOrder(Order order) throws Exception { + public Order placeOrder(Order body) throws Exception { //Do your magic!!! return new Order(); } diff --git a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java index 4a8c5d27d40..b42e4d6d3d0 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/StoreApiControllerImpInterface.java @@ -18,6 +18,6 @@ public interface StoreApiControllerImpInterface { Order getOrderById( @Min(1) @Max(5)Long orderId) throws Exception; - Order placeOrder(Order order) throws Exception; + Order placeOrder(Order body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index 439fa190f58..aa3bbd80ba1 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -38,53 +38,53 @@ public class UserApiController extends Controller { @ApiAction public Result createUser() throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUser(user); + imp.createUser(body); return ok(); } @ApiAction public Result createUsersWithArrayInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithArrayInput(user); + imp.createUsersWithArrayInput(body); return ok(); } @ApiAction public Result createUsersWithListInput() throws Exception { - JsonNode nodeuser = request().body().asJson(); - List user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), new TypeReference>(){}); + JsonNode nodebody = request().body().asJson(); + List body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), new TypeReference>(){}); if (configuration.getBoolean("useInputBeanValidation")) { - for (User curItem : user) { + for (User curItem : body) { OpenAPIUtils.validate(curItem); } } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.createUsersWithListInput(user); + imp.createUsersWithListInput(body); return ok(); } @@ -133,17 +133,17 @@ public class UserApiController extends Controller { @ApiAction public Result updateUser(String username) throws Exception { - JsonNode nodeuser = request().body().asJson(); - User user; - if (nodeuser != null) { - user = mapper.readValue(nodeuser.toString(), User.class); + JsonNode nodebody = request().body().asJson(); + User body; + if (nodebody != null) { + body = mapper.readValue(nodebody.toString(), User.class); if (configuration.getBoolean("useInputBeanValidation")) { - OpenAPIUtils.validate(user); + OpenAPIUtils.validate(body); } } else { - throw new IllegalArgumentException("'User' parameter is required"); + throw new IllegalArgumentException("'body' parameter is required"); } - imp.updateUser(username, user); + imp.updateUser(username, body); return ok(); } } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java index 63aafa7df25..0ea7a808b9a 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java @@ -12,17 +12,17 @@ import javax.validation.constraints.*; public class UserApiControllerImp implements UserApiControllerImpInterface { @Override - public void createUser(User user) throws Exception { + public void createUser(User body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithArrayInput(List user) throws Exception { + public void createUsersWithArrayInput(List body) throws Exception { //Do your magic!!! } @Override - public void createUsersWithListInput(List user) throws Exception { + public void createUsersWithListInput(List body) throws Exception { //Do your magic!!! } @@ -49,7 +49,7 @@ public class UserApiControllerImp implements UserApiControllerImpInterface { } @Override - public void updateUser(String username, User user) throws Exception { + public void updateUser(String username, User body) throws Exception { //Do your magic!!! } diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java index ee09b11e325..1290c84835f 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java @@ -12,11 +12,11 @@ import javax.validation.constraints.*; @SuppressWarnings("RedundantThrows") public interface UserApiControllerImpInterface { - void createUser(User user) throws Exception; + void createUser(User body) throws Exception; - void createUsersWithArrayInput(List user) throws Exception; + void createUsersWithArrayInput(List body) throws Exception; - void createUsersWithListInput(List user) throws Exception; + void createUsersWithListInput(List body) throws Exception; void deleteUser(String username) throws Exception; @@ -26,6 +26,6 @@ public interface UserApiControllerImpInterface { void logoutUser() throws Exception; - void updateUser(String username, User user) throws Exception; + void updateUser(String username, User body) throws Exception; } diff --git a/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java b/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java index c707ca74ac7..385ef97a008 100644 --- a/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java +++ b/samples/server/petstore/java-play-framework/app/openapitools/OpenAPIUtils.java @@ -98,6 +98,6 @@ public class OpenAPIUtils { } public static String formatDatetime(Date date) { - return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX").format(date); + return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSXXX", Locale.ROOT).format(date); } -} \ No newline at end of file +} diff --git a/samples/server/petstore/java-play-framework/public/openapi.json b/samples/server/petstore/java-play-framework/public/openapi.json index ac1d4504782..50b8a737319 100644 --- a/samples/server/petstore/java-play-framework/public/openapi.json +++ b/samples/server/petstore/java-play-framework/public/openapi.json @@ -1,35 +1,32 @@ { "openapi" : "3.0.1", "info" : { - "title" : "OpenAPI Petstore", "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", "license" : { "name" : "Apache-2.0", "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" }, + "title" : "OpenAPI Petstore", "version" : "1.0.0" }, "servers" : [ { "url" : "http://petstore.swagger.io/v2" } ], "tags" : [ { - "name" : "pet", - "description" : "Everything about your Pets" + "description" : "Everything about your Pets", + "name" : "pet" }, { - "name" : "store", - "description" : "Access to Petstore orders" + "description" : "Access to Petstore orders", + "name" : "store" }, { - "name" : "user", - "description" : "Operations about user" + "description" : "Operations about user", + "name" : "user" } ], "paths" : { "/pet" : { - "put" : { - "tags" : [ "pet" ], - "summary" : "Update an existing pet", - "operationId" : "updatePet", + "post" : { + "operationId" : "addPet", "requestBody" : { - "description" : "Pet object that needs to be added to the store", "content" : { "application/json" : { "schema" : { @@ -42,189 +39,222 @@ } } }, + "description" : "Pet object that needs to be added to the store", + "required" : true + }, + "responses" : { + "405" : { + "content" : { }, + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Add a new pet to the store", + "tags" : [ "pet" ], + "x-codegen-request-body-name" : "body", + "x-contentType" : "application/json", + "x-accepts" : "application/json" + }, + "put" : { + "operationId" : "updatePet", + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + }, + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Pet" + } + } + }, + "description" : "Pet object that needs to be added to the store", "required" : true }, "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" }, "405" : { - "description" : "Validation exception", - "content" : { } + "content" : { }, + "description" : "Validation exception" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/json", - "x-accepts" : "application/json" - }, - "post" : { + "summary" : "Update an existing pet", "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-codegen-request-body-name" : "body", "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", "parameters" : [ { - "name" : "status", - "in" : "query", "description" : "Status values that need to be considered for filter", - "required" : true, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "status", + "required" : true, "schema" : { - "type" : "array", "items" : { - "type" : "string", + "default" : "available", "enum" : [ "available", "pending", "sold" ], - "default" : "available" - } - } + "type" : "string" + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid status value", - "content" : { } + "content" : { }, + "description" : "Invalid status value" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by status", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/findByTags" : { "get" : { - "tags" : [ "pet" ], - "summary" : "Finds Pets by tags", + "deprecated" : true, "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, - "style" : "form", "explode" : false, + "in" : "query", + "name" : "tags", + "required" : true, "schema" : { - "type" : "array", "items" : { "type" : "string" - } - } + }, + "type" : "array" + }, + "style" : "form" } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } }, "application/json" : { "schema" : { - "type" : "array", "items" : { "$ref" : "#/components/schemas/Pet" - } + }, + "type" : "array" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid tag value", - "content" : { } + "content" : { }, + "description" : "Invalid tag value" } }, - "deprecated" : true, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "Finds Pets by tags", + "tags" : [ "pet" ], "x-accepts" : "application/json" } }, "/pet/{petId}" : { - "get" : { + "delete" : { + "operationId" : "deletePet", + "parameters" : [ { + "in" : "header", + "name" : "api_key", + "schema" : { + "type" : "string" + } + }, { + "description" : "Pet id to delete", + "in" : "path", + "name" : "petId", + "required" : true, + "schema" : { + "format" : "int64", + "type" : "integer" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid pet value" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ], + "summary" : "Deletes a pet", "tags" : [ "pet" ], - "summary" : "Find pet by ID", + "x-accepts" : "application/json" + }, + "get" : { "description" : "Returns a single pet", "operationId" : "getPetById", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to return", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -236,34 +266,35 @@ "$ref" : "#/components/schemas/Pet" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Pet not found", - "content" : { } + "content" : { }, + "description" : "Pet not found" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Find pet by ID", + "tags" : [ "pet" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -272,12 +303,12 @@ "schema" : { "properties" : { "name" : { - "type" : "string", - "description" : "Updated name of the pet" + "description" : "Updated name of the pet", + "type" : "string" }, "status" : { - "type" : "string", - "description" : "Updated status of the pet" + "description" : "Updated status of the pet", + "type" : "string" } } } @@ -286,61 +317,30 @@ }, "responses" : { "405" : { - "description" : "Invalid input", - "content" : { } + "content" : { }, + "description" : "Invalid input" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], - "x-contentType" : "application/x-www-form-urlencoded", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updates a pet in the store with form data", "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-contentType" : "application/x-www-form-urlencoded", "x-accepts" : "application/json" } }, "/pet/{petId}/uploadImage" : { "post" : { - "tags" : [ "pet" ], - "summary" : "uploads an image", "operationId" : "uploadFile", "parameters" : [ { - "name" : "petId", - "in" : "path", "description" : "ID of pet to update", + "in" : "path", + "name" : "petId", "required" : true, "schema" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" } } ], "requestBody" : { @@ -349,13 +349,13 @@ "schema" : { "properties" : { "additionalMetadata" : { - "type" : "string", - "description" : "Additional data to pass to server" + "description" : "Additional data to pass to server", + "type" : "string" }, "file" : { - "type" : "string", "description" : "file to upload", - "format" : "binary" + "format" : "binary", + "type" : "string" } } } @@ -364,58 +364,57 @@ }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ApiResponse" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "petstore_auth" : [ "write:pets", "read:pets" ] } ], + "summary" : "uploads an image", + "tags" : [ "pet" ], "x-contentType" : "multipart/form-data", "x-accepts" : "application/json" } }, "/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" - } + "format" : "int32", + "type" : "integer" + }, + "type" : "object" } } - } + }, + "description" : "successful operation" } }, "security" : [ { "api_key" : [ ] } ], + "summary" : "Returns pet inventories by status", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/store/order" : { "post" : { - "tags" : [ "store" ], - "summary" : "Place an order for a pet", "operationId" : "placeOrder", "requestBody" : { - "description" : "order placed for purchasing the pet", "content" : { "*/*" : { "schema" : { @@ -423,11 +422,11 @@ } } }, + "description" : "order placed for purchasing the pet", "required" : true }, "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -439,71 +438,29 @@ "$ref" : "#/components/schemas/Order" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid Order", - "content" : { } + "content" : { }, + "description" : "Invalid Order" } }, + "summary" : "Place an order for a pet", + "tags" : [ "store" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "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", - "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" - }, "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", + "in" : "path", + "name" : "orderId", "required" : true, "schema" : { "type" : "string" @@ -511,25 +468,68 @@ } ], "responses" : { "400" : { - "description" : "Invalid ID supplied", - "content" : { } + "content" : { }, + "description" : "Invalid ID supplied" }, "404" : { - "description" : "Order not found", - "content" : { } + "content" : { }, + "description" : "Order not found" } }, + "summary" : "Delete purchase order by ID", + "tags" : [ "store" ], + "x-accepts" : "application/json" + }, + "get" : { + "description" : "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + "operationId" : "getOrderById", + "parameters" : [ { + "description" : "ID of pet that needs to be fetched", + "in" : "path", + "name" : "orderId", + "required" : true, + "schema" : { + "format" : "int64", + "maximum" : 5, + "minimum" : 1, + "type" : "integer" + } + } ], + "responses" : { + "200" : { + "content" : { + "application/xml" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + }, + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/Order" + } + } + }, + "description" : "successful operation" + }, + "400" : { + "content" : { }, + "description" : "Invalid ID supplied" + }, + "404" : { + "content" : { }, + "description" : "Order not found" + } + }, + "summary" : "Find purchase order by ID", + "tags" : [ "store" ], "x-accepts" : "application/json" } }, "/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" : { @@ -537,93 +537,97 @@ } } }, + "description" : "Created user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Create user", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/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" - } + }, + "type" : "array" } } }, + "description" : "List of user object", "required" : true }, "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Creates list of users with given input array", + "tags" : [ "user" ], + "x-codegen-request-body-name" : "body", "x-contentType" : "*/*", "x-accepts" : "application/json" } }, "/user/login" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs user into the system", "operationId" : "loginUser", "parameters" : [ { - "name" : "username", - "in" : "query", "description" : "The user name for login", + "in" : "query", + "name" : "username", "required" : true, "schema" : { "type" : "string" } }, { - "name" : "password", - "in" : "query", "description" : "The password for login in clear text", + "in" : "query", + "name" : "password", "required" : true, "schema" : { "type" : "string" @@ -631,67 +635,93 @@ } ], "responses" : { "200" : { + "content" : { + "application/xml" : { + "schema" : { + "type" : "string" + } + }, + "application/json" : { + "schema" : { + "type" : "string" + } + } + }, "description" : "successful operation", "headers" : { "X-Rate-Limit" : { "description" : "calls per hour allowed by the user", "schema" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, "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" : { + "format" : "date-time", "type" : "string" } } } }, "400" : { - "description" : "Invalid username/password supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username/password supplied" } }, + "summary" : "Logs user into the system", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/logout" : { "get" : { - "tags" : [ "user" ], - "summary" : "Logs out current logged in user session", "operationId" : "logoutUser", "responses" : { "default" : { - "description" : "successful operation", - "content" : { } + "content" : { }, + "description" : "successful operation" } }, + "summary" : "Logs out current logged in user session", + "tags" : [ "user" ], "x-accepts" : "application/json" } }, "/user/{username}" : { - "get" : { + "delete" : { + "description" : "This can only be done by the logged in user.", + "operationId" : "deleteUser", + "parameters" : [ { + "description" : "The name that needs to be deleted", + "in" : "path", + "name" : "username", + "required" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "400" : { + "content" : { }, + "description" : "Invalid username supplied" + }, + "404" : { + "content" : { }, + "description" : "User not found" + } + }, + "summary" : "Delete user", "tags" : [ "user" ], - "summary" : "Get user by user name", + "x-accepts" : "application/json" + }, + "get" : { "operationId" : "getUserByName", "parameters" : [ { - "name" : "username", - "in" : "path", "description" : "The name that needs to be fetched. Use user1 for testing.", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" @@ -699,7 +729,6 @@ } ], "responses" : { "200" : { - "description" : "successful operation", "content" : { "application/xml" : { "schema" : { @@ -711,35 +740,35 @@ "$ref" : "#/components/schemas/User" } } - } + }, + "description" : "successful operation" }, "400" : { - "description" : "Invalid username supplied", - "content" : { } + "content" : { }, + "description" : "Invalid username supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, + "summary" : "Get user by user name", + "tags" : [ "user" ], "x-accepts" : "application/json" }, "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", + "in" : "path", + "name" : "username", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { - "description" : "Updated user object", "content" : { "*/*" : { "schema" : { @@ -747,45 +776,23 @@ } } }, + "description" : "Updated user object", "required" : true }, "responses" : { "400" : { - "description" : "Invalid user supplied", - "content" : { } + "content" : { }, + "description" : "Invalid user supplied" }, "404" : { - "description" : "User not found", - "content" : { } + "content" : { }, + "description" : "User not found" } }, - "x-contentType" : "*/*", - "x-accepts" : "application/json" - }, - "delete" : { + "summary" : "Updated user", "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-codegen-request-body-name" : "body", + "x-contentType" : "*/*", "x-accepts" : "application/json" } } @@ -793,35 +800,6 @@ "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, @@ -831,38 +809,76 @@ "complete" : false, "status" : "placed" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "petId" : { + "format" : "int64", + "type" : "integer" + }, + "quantity" : { + "format" : "int32", + "type" : "integer" + }, + "shipDate" : { + "format" : "date-time", + "type" : "string" + }, + "status" : { + "description" : "Order Status", + "enum" : [ "placed", "approved", "delivered" ], + "type" : "string" + }, + "complete" : { + "default" : false, + "type" : "boolean" + } + }, + "title" : "Pet Order", + "type" : "object", "xml" : { "name" : "Order" } }, "Category" : { - "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "type" : "object", "xml" : { "name" : "Category" } }, "User" : { - "title" : "a User", - "type" : "object", + "description" : "A User who is purchasing from the pet store", + "example" : { + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" + }, "properties" : { "id" : { - "type" : "integer", - "format" : "int64" + "format" : "int64", + "type" : "integer" }, "username" : { "type" : "string" @@ -883,89 +899,39 @@ "type" : "string" }, "userStatus" : { - "type" : "integer", "description" : "User Status", - "format" : "int32" + "format" : "int32", + "type" : "integer" } }, - "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" - }, + "title" : "a User", + "type" : "object", "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 }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "type" : "object", "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" ], @@ -984,17 +950,62 @@ } ], "status" : "available" }, + "properties" : { + "id" : { + "format" : "int64", + "type" : "integer" + }, + "category" : { + "$ref" : "#/components/schemas/Category" + }, + "name" : { + "example" : "doggie", + "type" : "string" + }, + "photoUrls" : { + "items" : { + "type" : "string" + }, + "type" : "array", + "xml" : { + "name" : "photoUrl", + "wrapped" : true + } + }, + "tags" : { + "items" : { + "$ref" : "#/components/schemas/Tag" + }, + "type" : "array", + "xml" : { + "name" : "tag", + "wrapped" : true + } + }, + "status" : { + "description" : "pet status in the store", + "enum" : [ "available", "pending", "sold" ], + "type" : "string" + } + }, + "required" : [ "name", "photoUrls" ], + "title" : "a Pet", + "type" : "object", "xml" : { "name" : "Pet" } }, "ApiResponse" : { - "title" : "An uploaded response", - "type" : "object", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + }, "properties" : { "code" : { - "type" : "integer", - "format" : "int32" + "format" : "int32", + "type" : "integer" }, "type" : { "type" : "string" @@ -1003,17 +1014,12 @@ "type" : "string" } }, - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - } + "title" : "An uploaded response", + "type" : "object" } }, "securitySchemes" : { "petstore_auth" : { - "type" : "oauth2", "flows" : { "implicit" : { "authorizationUrl" : "http://petstore.swagger.io/api/oauth/dialog", @@ -1022,12 +1028,13 @@ "read:pets" : "read your pets" } } - } + }, + "type" : "oauth2" }, "api_key" : { - "type" : "apiKey", + "in" : "header", "name" : "api_key", - "in" : "header" + "type" : "apiKey" } } }