swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.38k stars 2.17k forks source link

ParameterIn.formData / @FormParam? #3282

Open ghost opened 5 years ago

ghost commented 5 years ago

Some example method:

@POST
@Path("/testing")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response myMethod(
  @Parameter(in = "formData", description = "Testing")
  @FormParam("data") final String data) {
  ...
}

Problem:

How do I manage to show the @FormParam as formData parameter in Swagger UI? Thank you in advance.

pioto commented 4 years ago

I can confirm this issue.

A combination of @Consumes(MediaType.APPLICATION_FORM_URLENCODED) on the method, and @FormParam("data") on the parameter, does get Swagger UI to mostly generate thr right sort of thing, but if I add @Parameter to that parameter, my description does not appear, and doesn't seem to be copied over in the way that would be expected from https://swagger.io/specification/#support-for-x-www-form-urlencoded-request-bodies

AndrewBoyarsky commented 4 years ago

I have the same bug, @Parameter + @FormParam does not show description, provided in the @Parameter

frantuma commented 3 years ago

partially addressed by #3696