sdaschner / jaxrs-analyzer

Creates REST documentation for JAX-RS projects
Apache License 2.0
319 stars 101 forks source link

It does not render the Swagger Tags #175

Closed MGalatioto closed 5 years ago

MGalatioto commented 5 years ago

Hi,

I used your maven plugin to create the swagger.json file.

Unfortunately, the swagger annotations aren't rendered in the swagger.json file

Here the example (my Resources):

` @Path("adresse") @Api(value = "Adress") public class AdresseResource {

private final AdresseService adresseService = new AdresseService();

@GET
@Path("{id}")
@Produces(MediaType.APPLICATION_JSON)
@ApiOperation(value = "Finds address by ID", 
    notes = "Returns JSON Object of the founded Address. This can only be done if the data has been persisted.",
    response = Adresse.class)
@ApiResponses(value = {
    @ApiResponse(code = 502, message = "The connection to 'localhost' failed"),
    @ApiResponse(code = 404, message = "Address not found") 
    })
public Adresse findAdresse(
        @ApiParam(value = "ID to search for the address", required = true)
        @PathParam("id") Long id) {
    try {
        return adresseService.findAdresse(id);
    } catch (AdresseNotFoundException ex) {
        throw new WebApplicationException(ex.getMessage(),
                Response.status(Status.NOT_FOUND).entity("Kein Adresse mit der ID '" + id + "' gefunden").build());
    }
}`

and here your plugin my pom:

`

com.sebastian-daschner
    <artifactId>jaxrs-analyzer-maven-plugin</artifactId>
    <version>0.16</version>
    <executions>
        <execution>
            <goals>
                <goal>analyze-jaxrs</goal>
            </goals>
            <configuration>
                <backend>swagger</backend>
                <deployedDomain>localhost:8080</deployedDomain>
            </configuration>
        </execution>
    </executions>
</plugin>`

And here the generated json file:

` { "swagger": "2.0", "info": { "version": "0.0.1-SNAPSHOT", "title": "insideBFH" }, "host": "localhost:8080", "basePath": "/", "schemes": [ "http" ], "paths": { '/adresse/{id}': get: consumes: [] produces:

Am I missing something?

I have a github repo, if you want i can open it up for you?