mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-05 03:16:09 +00:00
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:
@@ -1 +1 @@
|
||||
3.3.4-SNAPSHOT
|
||||
4.2.3-SNAPSHOT
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<>();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +1 @@
|
||||
3.2.0-SNAPSHOT
|
||||
4.2.3-SNAPSHOT
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user