jakartaee / rest

Jakarta RESTful Web Services
Other
351 stars 114 forks source link

Error in multipart example #1186

Closed jim-krueger closed 4 months ago

jim-krueger commented 8 months ago

The jaxrs.examples.multipart.MultipartClient.sendPdfs() contains the following code:

Entity<List<EntityPart>> entity = Entity.entity(parts, MediaType.MULTIPART_FORM_DATA); Response response = target.request().post(entity);

This causes a failure since there isn't a way to get the generic type for an ArrayList (parts).

Line 37 needs to be changed to:

Entity<GenericEntity<List<EntityPart>>> entity = Entity.entity(new GenericEntity<>(parts){}, MediaType.MULTIPART_FORM_DATA);

spericas commented 8 months ago

@jansupol