mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-10 11:56:12 +00:00
* fix template for RequestBody, added 'required' attribute (#3134) * update Spring samples (#3134)
This commit is contained in:
committed by
William Cheng
parent
7bd378c026
commit
a9cc96b50f
@@ -1 +1 @@
|
||||
{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}} {{paramName}}{{/isBodyParam}}
|
||||
{{#isBodyParam}}@ApiParam(value = "{{{description}}}" {{#required}},required=true{{/required}} {{^isContainer}}{{#allowableValues}}, allowableValues="{{{allowableValues}}}"{{/allowableValues}}{{#defaultValue}}, defaultValue={{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{{defaultValue}}}{{^isString}}"{{/isString}}{{#isString}}{{#isEnum}}"{{/isEnum}}{{/isString}}{{/defaultValue}}{{/isContainer}}) {{#useBeanValidation}}@Valid{{/useBeanValidation}} @RequestBody{{^required}}(required = false){{/required}} {{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isListContainer}}Mono{{/isListContainer}}{{#isListContainer}}Flux{{/isListContainer}}<{{{baseType}}}>{{/reactive}} {{paramName}}{{/isBodyParam}}
|
||||
@@ -416,4 +416,28 @@ public class SpringCodegenTest {
|
||||
codegen.additionalProperties().put(CodegenConstants.LIBRARY, "spring-cloud");
|
||||
codegen.processOpts();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDoGenerateRequestBodyRequiredAttribute_3134_Regression() throws Exception {
|
||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||
output.deleteOnExit();
|
||||
String outputPath = output.getAbsolutePath().replace('\\', '/');
|
||||
|
||||
OpenAPI openAPI = new OpenAPIParser()
|
||||
.readLocation("src/test/resources/3_0/3134-regression.yaml", null, new ParseOptions()).getOpenAPI();
|
||||
|
||||
SpringCodegen codegen = new SpringCodegen();
|
||||
codegen.setOutputDir(output.getAbsolutePath());
|
||||
codegen.additionalProperties().put(CXFServerFeatures.LOAD_TEST_DATA_FROM_FILE, "true");
|
||||
|
||||
ClientOptInput input = new ClientOptInput();
|
||||
input.setOpenAPI(openAPI);
|
||||
input.setConfig(codegen);
|
||||
|
||||
MockDefaultGenerator generator = new MockDefaultGenerator();
|
||||
generator.opts(input).generate();
|
||||
|
||||
checkFileContains(generator, outputPath + "/src/main/java/org/openapitools/api/ExampleApi.java",
|
||||
"@RequestBody(required = false");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
openapi: 3.0.2
|
||||
info:
|
||||
title: info
|
||||
description: info
|
||||
version: 0.1.0
|
||||
|
||||
paths:
|
||||
/example/api:
|
||||
post:
|
||||
summary: summary
|
||||
description: description
|
||||
requestBody:
|
||||
required: false
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
name:
|
||||
type: string
|
||||
responses:
|
||||
200:
|
||||
description: response
|
||||
@@ -78,7 +78,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<Boolean>> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
default CompletableFuture<ResponseEntity<Boolean>> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
|
||||
|
||||
}
|
||||
@@ -97,7 +97,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<OuterComposite>> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
default CompletableFuture<ResponseEntity<OuterComposite>> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
return CompletableFuture.supplyAsync(()-> {
|
||||
getRequest().ifPresent(request -> {
|
||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
@@ -127,7 +127,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<BigDecimal>> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
default CompletableFuture<ResponseEntity<BigDecimal>> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
|
||||
|
||||
}
|
||||
@@ -146,7 +146,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default CompletableFuture<ResponseEntity<String>> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
default CompletableFuture<ResponseEntity<String>> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return CompletableFuture.completedFuture(new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED));
|
||||
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
getRequest().ifPresent(request -> {
|
||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
|
||||
@@ -124,7 +124,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body);
|
||||
ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body);
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,7 +82,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body);
|
||||
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body);
|
||||
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body);
|
||||
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body);
|
||||
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body);
|
||||
ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,7 +62,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output boolean (status code 200)
|
||||
* @see FakeApi#fakeOuterBooleanSerialize
|
||||
*/
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output composite (status code 200)
|
||||
* @see FakeApi#fakeOuterCompositeSerialize
|
||||
*/
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
|
||||
String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }";
|
||||
@@ -95,7 +95,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output number (status code 200)
|
||||
* @see FakeApi#fakeOuterNumberSerialize
|
||||
*/
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output string (status code 200)
|
||||
* @see FakeApi#fakeOuterStringSerialize
|
||||
*/
|
||||
public ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
public ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body);
|
||||
ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body);
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,7 +82,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body);
|
||||
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body);
|
||||
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body);
|
||||
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body);
|
||||
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body);
|
||||
ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,7 +62,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output boolean (status code 200)
|
||||
* @see FakeApi#fakeOuterBooleanSerialize
|
||||
*/
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output composite (status code 200)
|
||||
* @see FakeApi#fakeOuterCompositeSerialize
|
||||
*/
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
|
||||
String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }";
|
||||
@@ -95,7 +95,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output number (status code 200)
|
||||
* @see FakeApi#fakeOuterNumberSerialize
|
||||
*/
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output string (status code 200)
|
||||
* @see FakeApi#fakeOuterStringSerialize
|
||||
*/
|
||||
public ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
public ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return getDelegate().fakeOuterBooleanSerialize(body);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
return getDelegate().fakeOuterCompositeSerialize(body);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return getDelegate().fakeOuterNumberSerialize(body);
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return getDelegate().fakeOuterStringSerialize(body);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body);
|
||||
ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body);
|
||||
|
||||
|
||||
/**
|
||||
@@ -82,7 +82,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body);
|
||||
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body);
|
||||
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body);
|
||||
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body);
|
||||
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body);
|
||||
ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -59,7 +59,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output boolean (status code 200)
|
||||
* @see FakeApi#fakeOuterBooleanSerialize
|
||||
*/
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
public ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return delegate.fakeOuterBooleanSerialize(body);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output composite (status code 200)
|
||||
* @see FakeApi#fakeOuterCompositeSerialize
|
||||
*/
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
public ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
return delegate.fakeOuterCompositeSerialize(body);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output number (status code 200)
|
||||
* @see FakeApi#fakeOuterNumberSerialize
|
||||
*/
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
public ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return delegate.fakeOuterNumberSerialize(body);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ public class FakeApiController implements FakeApi {
|
||||
* @return Output string (status code 200)
|
||||
* @see FakeApi#fakeOuterStringSerialize
|
||||
*/
|
||||
public ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
public ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return delegate.fakeOuterStringSerialize(body);
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
getRequest().ifPresent(request -> {
|
||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
|
||||
@@ -132,7 +132,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -153,7 +153,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default Mono<ResponseEntity<Boolean>> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Mono<Boolean> body, ServerWebExchange exchange) {
|
||||
default Mono<ResponseEntity<Boolean>> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Mono<Boolean> body, ServerWebExchange exchange) {
|
||||
return getDelegate().fakeOuterBooleanSerialize(body, exchange);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default Mono<ResponseEntity<OuterComposite>> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody Mono<OuterComposite> body, ServerWebExchange exchange) {
|
||||
default Mono<ResponseEntity<OuterComposite>> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) Mono<OuterComposite> body, ServerWebExchange exchange) {
|
||||
return getDelegate().fakeOuterCompositeSerialize(body, exchange);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default Mono<ResponseEntity<BigDecimal>> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody Mono<BigDecimal> body, ServerWebExchange exchange) {
|
||||
default Mono<ResponseEntity<BigDecimal>> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) Mono<BigDecimal> body, ServerWebExchange exchange) {
|
||||
return getDelegate().fakeOuterNumberSerialize(body, exchange);
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default Mono<ResponseEntity<String>> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody Mono<String> body, ServerWebExchange exchange) {
|
||||
default Mono<ResponseEntity<String>> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) Mono<String> body, ServerWebExchange exchange) {
|
||||
return getDelegate().fakeOuterStringSerialize(body, exchange);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
getRequest().ifPresent(request -> {
|
||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
|
||||
@@ -124,7 +124,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
getRequest().ifPresent(request -> {
|
||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
|
||||
@@ -131,7 +131,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -151,7 +151,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/boolean",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody Boolean body) {
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Boolean body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/composite",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody OuterComposite body) {
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) OuterComposite body) {
|
||||
getRequest().ifPresent(request -> {
|
||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) {
|
||||
@@ -124,7 +124,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/number",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody BigDecimal body) {
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) BigDecimal body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public interface FakeApi {
|
||||
@RequestMapping(value = "/fake/outer/string",
|
||||
produces = { "*/*" },
|
||||
method = RequestMethod.POST)
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody String body) {
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) String body) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user