Add optional parameter for request body (#16972)

* Add optional parameter for request body

* Adapt Test
This commit is contained in:
Dennis Melzer
2023-11-04 09:54:50 +01:00
committed by GitHub
parent 61629ae8ed
commit f83cb60f27
3 changed files with 6 additions and 6 deletions

View File

@@ -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);