How to create swagger specification from JAX RS annotated interface?

I was wondering if there is a way to generate the swagger specification from an existing JAX RS annotated interface, for example. something like that:

@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public interface ISampleService {

    @GET
    @Path("sample/foobar/{foobarId}")
    Foobar getFoobar(@PathParam("foobarId") String foobarId);

    @PUT
    @Path("sample/foobar/{foobarId}")
    Foobar updateFoobar(@PathParam("foobarId") String foobarId, Foobar foobar);
}

I found this "jaxrs analyzer" project , but it doesn't seem to recognize my interface.

Basically, I have my service defined in such an interface, and I want to redesign the swagger specification to publish it so that anyone else can generate (other) clients using the swagger functions.

Preferably, the solution will only work in the maven assembly (plugin).

+4
source share
1 answer

Swagger .

Swagger , @Api . , @Api.

+3

Source: https://habr.com/ru/post/1629321/


All Articles