swagger-api/swagger-core — pull request #797 by reta (2014-12-20 00:03:30+00:00)
Title: Enhanced BeanConfig to support @Path JAX-RS resources. Fixed BasicJaxrsReader operations recognition

Hey guys,

Resubmitting https://github.com/swagger-api/swagger-core/pull/793 against develop_scala-2.10 branch.
-----------------------------------------------------------------------------------------------------------------------------------

While working on JAX-RS applications, I have run into the issues that Swagger has a bit limited support of the native JAX-RS services/resources which do not use @ApiXxx annotations, however the most of required implementation is already there, in Swagger JAX-RS module.

The small change in BeanConfig allows to introspect not only @Api - annotated classes but @Path - annotated ones as well. When used with BasicJaxrsReader, the @ApiXxx annotations are not required anymore. The small fix inside BasicJaxrsReader makes operations recognition more picky (otherwise all Object methods like wait(), equals(), toString() .... will be included, it is current behavior).

The tests have been added to confirm that by default the BeanConfig behavior is not changed. And, by setting reader to BasicJaxrsReader, the proper JAX-RS API description is being built (without any @ApiXxx annotations) for native JAX-RS service/resource.

I think these small changes allow to integrate Swagger into existing JAX-RS applications much faster and easier, while developers are immediately benefiting from using it in conjunction with Swagger UI. Apache CXF has already support for Swagger but it is going to be better with these fixes.

Thank you.

Best Regards,
Andriy Redko