forked from loafle/openapi-generator-original
Add optional parameter for request body (#16972)
* Add optional parameter for request body * Adapt Test
This commit is contained in:
@@ -98,7 +98,7 @@ public interface FakeApi {
|
||||
)
|
||||
|
||||
default ResponseEntity<Boolean> fakeOuterBooleanSerialize(
|
||||
@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body
|
||||
@ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Optional<Boolean> body
|
||||
) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
@@ -130,7 +130,7 @@ public interface FakeApi {
|
||||
)
|
||||
|
||||
default ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(
|
||||
@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite
|
||||
@ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Optional<OuterComposite> outerComposite
|
||||
) {
|
||||
getRequest().ifPresent(request -> {
|
||||
for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) {
|
||||
@@ -171,7 +171,7 @@ public interface FakeApi {
|
||||
)
|
||||
|
||||
default ResponseEntity<BigDecimal> fakeOuterNumberSerialize(
|
||||
@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body
|
||||
@ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Optional<BigDecimal> body
|
||||
) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
@@ -203,7 +203,7 @@ public interface FakeApi {
|
||||
)
|
||||
|
||||
default ResponseEntity<String> fakeOuterStringSerialize(
|
||||
@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body
|
||||
@ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Optional<String> body
|
||||
) {
|
||||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user