From 3ce5a8d188ea10d4718cac95d8b2efb7d30cfe36 Mon Sep 17 00:00:00 2001 From: Tobias Kurzydym Date: Wed, 24 Apr 2024 22:14:23 +0200 Subject: [PATCH] feat(swaggerui): requestbody --- .../sample/address/application/AddressResource.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/billing-service/src/main/java/de/openknowledge/sample/address/application/AddressResource.java b/billing-service/src/main/java/de/openknowledge/sample/address/application/AddressResource.java index 13a501c..a3a0c04 100644 --- a/billing-service/src/main/java/de/openknowledge/sample/address/application/AddressResource.java +++ b/billing-service/src/main/java/de/openknowledge/sample/address/application/AddressResource.java @@ -33,12 +33,14 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; +import org.eclipse.microprofile.openapi.annotations.media.Content; import org.eclipse.microprofile.openapi.annotations.media.Schema; import org.eclipse.microprofile.openapi.annotations.parameters.Parameter; import de.openknowledge.sample.address.domain.Address; import de.openknowledge.sample.address.domain.AddressRepository; import de.openknowledge.sample.address.domain.CustomerNumber; +import org.eclipse.microprofile.openapi.annotations.parameters.RequestBody; /** * RESTFul endpoint for delivery addresses @@ -79,6 +81,11 @@ public Response setAddress( example = "0815", schema = @Schema(type = STRING)) @PathParam("customerNumber") CustomerNumber customerNumber, + @RequestBody( + content = @Content( + mediaType = MediaType.APPLICATION_JSON, + schema = @Schema(ref = "#/components/schemas/Address") + )) Address address, @Context UriInfo uri) {