stoicflame / enunciate

Build-time enhancement tool for Java-based Web services projects
http://enunciate.webcohesion.com/
Other
480 stars 201 forks source link

@FormParam parameters missing in OpenAPI definition (2.15.1) #1175

Closed dariokures closed 1 year ago

dariokures commented 1 year ago

Hi,

Looks like @FormParam parameters are not added to OpenApi definition in 2.15+ Example (Java 17, JAX-RS Jersey 3.1.2):

import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.FormParam;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/playground")
public class PlaygroundResource {

    @POST
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    @Produces(MediaType.TEXT_PLAIN)
    public String test(@FormParam("param1") String param1) {

        return param1;
    }
}

Enunciate 2.15.1 (OpenAPI) image

Enunciate 2.14.0 (Swagger) image

stoicflame commented 1 year ago

Thanks for the report! I'll look into it.

stoicflame commented 1 year ago

Enunciate 2.16.1 has been released.

dariokures commented 1 year ago

With 2.16.1 there is some Swagger UI rendering issue (2.16.0 is ok): image

stoicflame commented 1 year ago

That's super confusing because it's exactly the same code.

Can you attach the two openapi.json files generated between the two versions? Or attach the diff between the two?

dariokures commented 1 year ago

openapi.json is the same, but there is difference in swagger-ui-standalone-preset.js:

image

stoicflame commented 1 year ago

Woops!