swagger-api / swagger-samples

Samples for the various Swagger projects under swagger-api
http://swagger.io
Apache License 2.0
538 stars 884 forks source link

Add a resteasy.scan = true example #55

Closed JathinSanghvi closed 8 years ago

JathinSanghvi commented 8 years ago

I am unable to configure a simple rest easy project with resteasy.scan = true. with no servelet mapping


<context-param>
        <param-name>resteasy.scan</param-name>
        <param-value>true</param-value>
    </context-param>

and one resource

@Path("/physician")
public class PhysicianMappingService {
@GET
    @Path("/npi/{param}")
    @Produces(MediaType.APPLICATION_JSON)
    public Response getPhysician(@PathParam("param") String npi, @Context ServletContext servletContext) {
// some impl code
}

the max i was able to achieve was getting a high level output with no api info.

{"swagger":"2.0","info":{"version":"1.0.4","title":"Physician Mapping Service"},"basePath":"/http://localhost:8080/PhysicianMappingService"}

Please help me to get a sample app with this configuration

webron commented 8 years ago

You'd need to explicitly tell swagger-core which packages to scan. See https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-RESTEasy-2.X-Project-Setup-1.5.