Fix query parameter (#5131)

* fix map as query parameter, use RequestPart instead of RequestParam in
FormParams, add filename for parameters of type file

* fix brace

* fix tests

* run bin/windows bat files

* test if this solves linending problem part 1

* test if this solves linending problem part 2

* test if this solves linending problem part 3

* test if this solves linending problem part 4

* test if this solves linending problem part 5

* test if this solves linending problem part 6

* manually set back version in pom

* update spring samples

Co-authored-by: William Cheng <wing328hk@gmail.com>
This commit is contained in:
fritzlitester
2020-02-04 15:08:36 +01:00
committed by GitHub
parent 5b9b8bda76
commit a0eb149df5
64 changed files with 1153 additions and 1139 deletions

View File

@@ -1 +1 @@
3.3.4-SNAPSHOT
4.2.3-SNAPSHOT

View File

@@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A category for a pet
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Category {
private Long id;

View File

@@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Describes the result of uploading an image resource
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ModelApiResponse {
private Integer code;

View File

@@ -9,7 +9,7 @@ import java.time.OffsetDateTime;
/**
* An order for a pets from the pet store
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Order {
private Long id;

View File

@@ -12,11 +12,11 @@ import org.openapitools.server.api.model.Tag;
/**
* A pet for sale in the pet store
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Pet {
private Long id;
private Category category = null;
private Category category;
private String name;
private List<String> photoUrls = new ArrayList<>();
private List<Tag> tags = new ArrayList<>();

View File

@@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A tag for a pet
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Tag {
private Long id;

View File

@@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A User who is purchasing from the pet store
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class User {
private Long id;

View File

@@ -13,7 +13,7 @@ import java.util.Map;
public interface PetApi {
//addPet
void addPet(Pet pet, Handler<AsyncResult<Void>> handler);
void addPet(Pet body, Handler<AsyncResult<Void>> handler);
//deletePet
void deletePet(Long petId, String apiKey, Handler<AsyncResult<Void>> handler);
@@ -28,7 +28,7 @@ public interface PetApi {
void getPetById(Long petId, Handler<AsyncResult<Pet>> handler);
//updatePet
void updatePet(Pet pet, Handler<AsyncResult<Void>> handler);
void updatePet(Pet body, Handler<AsyncResult<Void>> handler);
//updatePetWithForm
void updatePetWithForm(Long petId, String name, String status, Handler<AsyncResult<Void>> handler);

View File

@@ -48,13 +48,13 @@ public class PetApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "addPet";
JsonObject petParam = message.body().getJsonObject("Pet");
if (petParam == null) {
manageError(message, new MainApiException(400, "Pet is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class);
service.addPet(pet, result -> {
Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class);
service.addPet(body, result -> {
if (result.succeeded())
message.reply(null);
else {
@@ -177,13 +177,13 @@ public class PetApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "updatePet";
JsonObject petParam = message.body().getJsonObject("Pet");
if (petParam == null) {
manageError(message, new MainApiException(400, "Pet is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class);
service.updatePet(pet, result -> {
Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class);
service.updatePet(body, result -> {
if (result.succeeded())
message.reply(null);
else {

View File

@@ -20,6 +20,6 @@ public interface StoreApi {
void getOrderById(Long orderId, Handler<AsyncResult<Order>> handler);
//placeOrder
void placeOrder(Order order, Handler<AsyncResult<Order>> handler);
void placeOrder(Order body, Handler<AsyncResult<Order>> handler);
}

View File

@@ -111,13 +111,13 @@ public class StoreApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "placeOrder";
JsonObject orderParam = message.body().getJsonObject("Order");
if (orderParam == null) {
manageError(message, new MainApiException(400, "Order is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
Order order = Json.mapper.readValue(orderParam.encode(), Order.class);
service.placeOrder(order, result -> {
Order body = Json.mapper.readValue(bodyParam.encode(), Order.class);
service.placeOrder(body, result -> {
if (result.succeeded())
message.reply(new JsonObject(Json.encode(result.result())).encodePrettily());
else {

View File

@@ -11,13 +11,13 @@ import java.util.Map;
public interface UserApi {
//createUser
void createUser(User user, Handler<AsyncResult<Void>> handler);
void createUser(User body, Handler<AsyncResult<Void>> handler);
//createUsersWithArrayInput
void createUsersWithArrayInput(List<User> user, Handler<AsyncResult<Void>> handler);
void createUsersWithArrayInput(List<User> body, Handler<AsyncResult<Void>> handler);
//createUsersWithListInput
void createUsersWithListInput(List<User> user, Handler<AsyncResult<Void>> handler);
void createUsersWithListInput(List<User> body, Handler<AsyncResult<Void>> handler);
//deleteUser
void deleteUser(String username, Handler<AsyncResult<Void>> handler);
@@ -32,6 +32,6 @@ public interface UserApi {
void logoutUser(Handler<AsyncResult<Void>> handler);
//updateUser
void updateUser(String username, User user, Handler<AsyncResult<Void>> handler);
void updateUser(String username, User body, Handler<AsyncResult<Void>> handler);
}

View File

@@ -46,13 +46,13 @@ public class UserApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "createUser";
JsonObject userParam = message.body().getJsonObject("User");
if (userParam == null) {
manageError(message, new MainApiException(400, "User is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
User user = Json.mapper.readValue(userParam.encode(), User.class);
service.createUser(user, result -> {
User body = Json.mapper.readValue(bodyParam.encode(), User.class);
service.createUser(body, result -> {
if (result.succeeded())
message.reply(null);
else {
@@ -71,14 +71,14 @@ public class UserApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "createUsersWithArrayInput";
JsonArray userParam = message.body().getJsonArray("User");
if(userParam == null) {
manageError(message, new MainApiException(400, "User is required"), serviceId);
JsonArray bodyParam = message.body().getJsonArray("body");
if(bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
List<User> user = Json.mapper.readValue(userParam.encode(),
Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class));
service.createUsersWithArrayInput(user, result -> {
List<User> body = Json.mapper.readValue(bodyParam.encode(),
Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class));
service.createUsersWithArrayInput(body, result -> {
if (result.succeeded())
message.reply(null);
else {
@@ -97,14 +97,14 @@ public class UserApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "createUsersWithListInput";
JsonArray userParam = message.body().getJsonArray("User");
if(userParam == null) {
manageError(message, new MainApiException(400, "User is required"), serviceId);
JsonArray bodyParam = message.body().getJsonArray("body");
if(bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
List<User> user = Json.mapper.readValue(userParam.encode(),
Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class));
service.createUsersWithListInput(user, result -> {
List<User> body = Json.mapper.readValue(bodyParam.encode(),
Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class));
service.createUsersWithListInput(body, result -> {
if (result.succeeded())
message.reply(null);
else {
@@ -229,13 +229,13 @@ public class UserApiVerticle extends AbstractVerticle {
return;
}
String username = usernameParam;
JsonObject userParam = message.body().getJsonObject("User");
if (userParam == null) {
manageError(message, new MainApiException(400, "User is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
User user = Json.mapper.readValue(userParam.encode(), User.class);
service.updateUser(username, user, result -> {
User body = Json.mapper.readValue(bodyParam.encode(), User.class);
service.updateUser(username, body, result -> {
if (result.succeeded())
message.reply(null);
else {

View File

@@ -1 +1 @@
3.2.0-SNAPSHOT
4.2.3-SNAPSHOT

View File

@@ -7,11 +7,11 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A category for a pet
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Category {
private Long id = null;
private String name = null;
private Long id;
private String name;
public Category () {

View File

@@ -7,12 +7,12 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Describes the result of uploading an image resource
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ModelApiResponse {
private Integer code = null;
private String type = null;
private String message = null;
private Integer code;
private String type;
private String message;
public ModelApiResponse () {

View File

@@ -9,13 +9,13 @@ import java.time.OffsetDateTime;
/**
* An order for a pets from the pet store
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Order {
private Long id = null;
private Long petId = null;
private Integer quantity = null;
private OffsetDateTime shipDate = null;
private Long id;
private Long petId;
private Integer quantity;
private OffsetDateTime shipDate;
public enum StatusEnum {
@@ -36,7 +36,7 @@ public class Order {
}
}
private StatusEnum status = null;
private StatusEnum status;
private Boolean complete = false;
public Order () {

View File

@@ -12,12 +12,12 @@ import org.openapitools.server.api.model.Tag;
/**
* A pet for sale in the pet store
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Pet {
private Long id = null;
private Category category = null;
private String name = null;
private Long id;
private Category category;
private String name;
private List<String> photoUrls = new ArrayList<>();
private List<Tag> tags = new ArrayList<>();
@@ -40,7 +40,7 @@ public class Pet {
}
}
private StatusEnum status = null;
private StatusEnum status;
public Pet () {

View File

@@ -7,11 +7,11 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A tag for a pet
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Tag {
private Long id = null;
private String name = null;
private Long id;
private String name;
public Tag () {

View File

@@ -7,17 +7,17 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
* A User who is purchasing from the pet store
**/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class User {
private Long id = null;
private String username = null;
private String firstName = null;
private String lastName = null;
private String email = null;
private String password = null;
private String phone = null;
private Integer userStatus = null;
private Long id;
private String username;
private String firstName;
private String lastName;
private String email;
private String password;
private String phone;
private Integer userStatus;
public User () {

View File

@@ -13,7 +13,7 @@ import java.util.Map;
public interface PetApi {
//addPet
public Completable addPet(Pet pet);
public Completable addPet(Pet body);
//deletePet
public Completable deletePet(Long petId,String apiKey);
@@ -28,7 +28,7 @@ public interface PetApi {
public Single<Pet> getPetById(Long petId);
//updatePet
public Completable updatePet(Pet pet);
public Completable updatePet(Pet body);
//updatePetWithForm
public Completable updatePetWithForm(Long petId,String name,String status);

View File

@@ -48,13 +48,13 @@ public class PetApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "addPet";
JsonObject petParam = message.body().getJsonObject("Pet");
if (petParam == null) {
manageError(message, new MainApiException(400, "Pet is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class);
service.addPet(pet).subscribe(
Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class);
service.addPet(body).subscribe(
() -> {
message.reply(null);
},
@@ -172,13 +172,13 @@ public class PetApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "updatePet";
JsonObject petParam = message.body().getJsonObject("Pet");
if (petParam == null) {
manageError(message, new MainApiException(400, "Pet is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
Pet pet = Json.mapper.readValue(petParam.encode(), Pet.class);
service.updatePet(pet).subscribe(
Pet body = Json.mapper.readValue(bodyParam.encode(), Pet.class);
service.updatePet(body).subscribe(
() -> {
message.reply(null);
},

View File

@@ -20,6 +20,6 @@ public interface StoreApi {
public Single<Order> getOrderById(Long orderId);
//placeOrder
public Single<Order> placeOrder(Order order);
public Single<Order> placeOrder(Order body);
}

View File

@@ -108,13 +108,13 @@ public class StoreApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "placeOrder";
JsonObject orderParam = message.body().getJsonObject("Order");
if (orderParam == null) {
manageError(message, new MainApiException(400, "Order is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
Order order = Json.mapper.readValue(orderParam.encode(), Order.class);
service.placeOrder(order).subscribe(
Order body = Json.mapper.readValue(bodyParam.encode(), Order.class);
service.placeOrder(body).subscribe(
result -> {
message.reply(new JsonObject(Json.encode(result)).encodePrettily());
},

View File

@@ -11,13 +11,13 @@ import java.util.Map;
public interface UserApi {
//createUser
public Completable createUser(User user);
public Completable createUser(User body);
//createUsersWithArrayInput
public Completable createUsersWithArrayInput(List<User> user);
public Completable createUsersWithArrayInput(List<User> body);
//createUsersWithListInput
public Completable createUsersWithListInput(List<User> user);
public Completable createUsersWithListInput(List<User> body);
//deleteUser
public Completable deleteUser(String username);
@@ -32,6 +32,6 @@ public interface UserApi {
public Completable logoutUser();
//updateUser
public Completable updateUser(String username,User user);
public Completable updateUser(String username,User body);
}

View File

@@ -46,13 +46,13 @@ public class UserApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "createUser";
JsonObject userParam = message.body().getJsonObject("User");
if (userParam == null) {
manageError(message, new MainApiException(400, "User is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
User user = Json.mapper.readValue(userParam.encode(), User.class);
service.createUser(user).subscribe(
User body = Json.mapper.readValue(bodyParam.encode(), User.class);
service.createUser(body).subscribe(
() -> {
message.reply(null);
},
@@ -70,14 +70,14 @@ public class UserApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "createUsersWithArrayInput";
JsonArray userParam = message.body().getJsonArray("User");
if(userParam == null) {
manageError(message, new MainApiException(400, "User is required"), serviceId);
JsonArray bodyParam = message.body().getJsonArray("body");
if(bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
List<User> user = Json.mapper.readValue(userParam.encode(),
Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class));
service.createUsersWithArrayInput(user).subscribe(
List<User> body = Json.mapper.readValue(bodyParam.encode(),
Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class));
service.createUsersWithArrayInput(body).subscribe(
() -> {
message.reply(null);
},
@@ -95,14 +95,14 @@ public class UserApiVerticle extends AbstractVerticle {
try {
// Workaround for #allParams section clearing the vendorExtensions map
String serviceId = "createUsersWithListInput";
JsonArray userParam = message.body().getJsonArray("User");
if(userParam == null) {
manageError(message, new MainApiException(400, "User is required"), serviceId);
JsonArray bodyParam = message.body().getJsonArray("body");
if(bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
List<User> user = Json.mapper.readValue(userParam.encode(),
Json.mapper.getTypeFactory().constructCollectionType(List.class, List.class));
service.createUsersWithListInput(user).subscribe(
List<User> body = Json.mapper.readValue(bodyParam.encode(),
Json.mapper.getTypeFactory().constructCollectionType(List.class, User.class));
service.createUsersWithListInput(body).subscribe(
() -> {
message.reply(null);
},
@@ -222,13 +222,13 @@ public class UserApiVerticle extends AbstractVerticle {
return;
}
String username = usernameParam;
JsonObject userParam = message.body().getJsonObject("User");
if (userParam == null) {
manageError(message, new MainApiException(400, "User is required"), serviceId);
JsonObject bodyParam = message.body().getJsonObject("body");
if (bodyParam == null) {
manageError(message, new MainApiException(400, "body is required"), serviceId);
return;
}
User user = Json.mapper.readValue(userParam.encode(), User.class);
service.updateUser(username, user).subscribe(
User body = Json.mapper.readValue(bodyParam.encode(), User.class);
service.updateUser(username, body).subscribe(
() -> {
message.reply(null);
},