sdaschner / jaxrs-analyzer

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

Is There a Way to Add the 'summary' tag? #177

Closed MGalatioto closed 5 years ago

MGalatioto commented 5 years ago

summary

How can I add the summary tag? I did not find anyway with jax-rs or javadoc?

I guess it is not supported?

Thanks AGAIN in advance :-) 👍

rmpestano commented 5 years ago

Hi,

yes, just add a javadoc comment to the api method (also works for api parameters):

   /**
     * Deletes a car based on its ID
     *
     * @param user name of the user to log in
     * @param id car ID
     * @status 401 User not authorized
     * @status 403 User not authenticated
     */
    @DELETE
    @Path("/{id:[0-9][0-9]*}")
    @RestSecured
    public Response deleteById(@HeaderParam("user") String user, @PathParam("id") Integer id) {
        Car entity = carService.findById(id);
        if (entity == null) {
            return Response.status(Status.NOT_FOUND).build();
        }
        carService.remove(entity);
        return Response.noContent().build();
    }
MGalatioto commented 5 years ago

I did, but it does not work.. it appears in the description, but not as summary, which is also good though, but it would be nice if it would work.. :-)

THANKS for your quick answer!

rmpestano commented 5 years ago

Hi unfortunately only description is supported, see #107.

To achieve that we would need to introduce a new javadoc tag e.g @summary

MGalatioto commented 5 years ago

All right thanks! Status does not work either for me...? :)

rmpestano commented 5 years ago

In fact, it is @response but it will only work in next version, see this PR.

MGalatioto commented 5 years ago

All right! thank you!!