diff --git a/docs/src/main/asciidoc/rest-client-reactive.adoc b/docs/src/main/asciidoc/rest-client-reactive.adoc index 1b3c12a88aa5de..8b72b63c9fbca5 100644 --- a/docs/src/main/asciidoc/rest-client-reactive.adoc +++ b/docs/src/main/asciidoc/rest-client-reactive.adoc @@ -744,7 +744,7 @@ REST Client Reactive support multipart messages. REST Client Reactive allows sending data as multipart forms. This way you can for example send files efficiently. -To send data as a multipart form, you can just use the regular `@RestForm` annotations: +To send data as a multipart form, you can just use the regular `@RestForm` (or `@FormParam`) annotations: [source, java] ---- @@ -755,7 +755,7 @@ To send data as a multipart form, you can just use the regular `@RestForm` annot Parameters specified as `File`, `Path`, `byte[]` or `Buffer` are sent as files and default to the `application/octet-stream` MIME type. Other `@RestForm` parameter types default to the `text/plain` -MIME type. You can override these defaults with the `@RestPart` annotation. +MIME type. You can override these defaults with the `@PartType` annotation. Naturally, you can also group these parameters into a containing class: @@ -802,7 +802,7 @@ You can also send JSON multiparts by specifying the `@PartType` annotation: @POST @Path("/json") - String sendMultipart(@RestForm @RestPart(MediaType.APPLICATION_JSON) Person person); + String sendMultipart(@RestForm @PartType(MediaType.APPLICATION_JSON) Person person); ---- === Receiving Multipart Messages diff --git a/docs/src/main/asciidoc/resteasy-reactive.adoc b/docs/src/main/asciidoc/resteasy-reactive.adoc index 8e54149940c596..21dadee27a4123 100644 --- a/docs/src/main/asciidoc/resteasy-reactive.adoc +++ b/docs/src/main/asciidoc/resteasy-reactive.adoc @@ -499,7 +499,7 @@ public class MultipartResource { } ---- -The `name` parameter will contain the data contained in the part of HTTP request called `description` (because +The `description` parameter will contain the data contained in the part of HTTP request called `description` (because link:{resteasy-reactive-common-api}/org/jboss/resteasy/reactive/RestForm.html[`@RestForm`] does not define a value, the field name is used), while the `file` parameter will contain data about the uploaded file in the `image` part of HTTP request, and the `person` parameter will read the `Person` entity using the `JSON` <>. diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/multipart/MultipartResource.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/multipart/MultipartResource.java index 350413e50cd1da..5548a439f98fa0 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/multipart/MultipartResource.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/multipart/MultipartResource.java @@ -83,7 +83,7 @@ public String simple( @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @Path("/blocking") - public Response blocking(@DefaultValue("1") @RestQuery Integer times, @BeanParam FormData formData) throws IOException { + public Response blocking(@DefaultValue("1") @RestQuery Integer times, FormData formData) throws IOException { if (!BlockingOperationControl.isBlockingAllowed()) { throw new RuntimeException("should have dispatched"); } @@ -101,7 +101,7 @@ public Response blocking(@DefaultValue("1") @RestQuery Integer times, @BeanParam @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.MULTIPART_FORM_DATA) @Path("/same-name") - public String sameName(@BeanParam FormDataSameFileName formData) { + public String sameName(FormDataSameFileName formData) { if (!BlockingOperationControl.isBlockingAllowed()) { throw new RuntimeException("should have dispatched"); } @@ -129,7 +129,7 @@ public String sameName(@RestForm @PartType(MediaType.TEXT_PLAIN) Status status, @Consumes(MediaType.MULTIPART_FORM_DATA) @Path("/optional") @NonBlocking - public String optional(@BeanParam FormData formData) { + public String optional(FormData formData) { if (BlockingOperationControl.isBlockingAllowed()) { throw new RuntimeException("should not have dispatched"); }