[Java][Spring] Change methodBody.mustache for webflux bean validation (#13795)

This commit is contained in:
신진호
2022-10-28 21:49:28 +09:00
committed by GitHub
parent 3d578164e8
commit 8eb3064b2e
15 changed files with 184 additions and 37 deletions
@@ -43,5 +43,5 @@ Mono<Void> result = Mono.empty();
{{^examples}}
exchange.getResponse().setStatusCode({{#returnSuccessCode}}HttpStatus.OK{{/returnSuccessCode}}{{^returnSuccessCode}}HttpStatus.NOT_IMPLEMENTED{{/returnSuccessCode}});
{{/examples}}
return result.then(Mono.empty());
return result{{#allParams}}{{#isBodyParam}}{{^isArray}}{{#paramName}}.then({{.}}){{/paramName}}{{/isArray}}{{#isArray}}{{#paramName}}.thenMany({{.}}){{/paramName}}{{/isArray}}{{/isBodyParam}}{{/allParams}}.then(Mono.empty());
{{/reactive}}
@@ -0,0 +1,53 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for ArrayOfArrayOfNumberOnly
*/
public class ArrayOfArrayOfNumberOnlyTest {
private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly();
/**
* Model tests for ArrayOfArrayOfNumberOnly
*/
@Test
public void testArrayOfArrayOfNumberOnly() {
// TODO: test ArrayOfArrayOfNumberOnly
}
/**
* Test the property 'arrayArrayNumber'
*/
@Test
public void arrayArrayNumberTest() {
// TODO: test arrayArrayNumber
}
}
@@ -0,0 +1,94 @@
/*
* OpenAPI Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package org.openapitools.client.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openapitools.client.model.Category;
import org.openapitools.client.model.Tag;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Model tests for Pet
*/
public class PetTest {
private final Pet model = new Pet();
/**
* Model tests for Pet
*/
@Test
public void testPet() {
// TODO: test Pet
}
/**
* Test the property 'id'
*/
@Test
public void idTest() {
// TODO: test id
}
/**
* Test the property 'category'
*/
@Test
public void categoryTest() {
// TODO: test category
}
/**
* Test the property 'name'
*/
@Test
public void nameTest() {
// TODO: test name
}
/**
* Test the property 'photoUrls'
*/
@Test
public void photoUrlsTest() {
// TODO: test photoUrls
}
/**
* Test the property 'tags'
*/
@Test
public void tagsTest() {
// TODO: test tags
}
/**
* Test the property 'status'
*/
@Test
public void statusTest() {
// TODO: test status
}
}
@@ -46,7 +46,7 @@ public interface AnotherFakeApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -49,7 +49,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(xmlItem).then(Mono.empty());
}
@@ -65,7 +65,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -88,7 +88,7 @@ public interface FakeApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -104,7 +104,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -120,7 +120,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -136,7 +136,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -153,7 +153,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -176,7 +176,7 @@ public interface FakeApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -291,7 +291,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(param).then(Mono.empty());
}
@@ -46,7 +46,7 @@ public interface FakeClassnameTestApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -41,7 +41,7 @@ public interface PetApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -167,7 +167,7 @@ public interface PetApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -113,7 +113,7 @@ public interface StoreApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -41,7 +41,7 @@ public interface UserApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -56,7 +56,7 @@ public interface UserApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.thenMany(body).then(Mono.empty());
}
@@ -71,7 +71,7 @@ public interface UserApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.thenMany(body).then(Mono.empty());
}
@@ -167,7 +167,7 @@ public interface UserApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -47,7 +47,7 @@ public interface AnotherFakeApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -50,7 +50,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(xmlItem).then(Mono.empty());
}
@@ -66,7 +66,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -89,7 +89,7 @@ public interface FakeApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -105,7 +105,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -121,7 +121,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -137,7 +137,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -154,7 +154,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -177,7 +177,7 @@ public interface FakeApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -292,7 +292,7 @@ public interface FakeApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(param).then(Mono.empty());
}
@@ -47,7 +47,7 @@ public interface FakeClassnameTestApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -42,7 +42,7 @@ public interface PetApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -168,7 +168,7 @@ public interface PetApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -114,7 +114,7 @@ public interface StoreApiDelegate {
break;
}
}
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -42,7 +42,7 @@ public interface UserApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}
@@ -57,7 +57,7 @@ public interface UserApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.thenMany(body).then(Mono.empty());
}
@@ -72,7 +72,7 @@ public interface UserApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.thenMany(body).then(Mono.empty());
}
@@ -168,7 +168,7 @@ public interface UserApiDelegate {
ServerWebExchange exchange) {
Mono<Void> result = Mono.empty();
exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);
return result.then(Mono.empty());
return result.then(body).then(Mono.empty());
}