Hello,
I am using swagger 2.0, with Jersey 1.17.1 and tomcat 1.7.64.
I followed the java-jersey-sample-app, and added Bootstrap java class.
and added authorization annotation as:
@Api(value="client", authorizations = {
@Authorization(value = "nbo_auth",
scopes = {
@AuthorizationScope(scope = "delete:client", description = "delete client")
})
}
)
and my swagger base api from web.xml is /SO/attnsapi.
from Bootstrap class:
ServletContext context = config.getServletContext();
Swagger swagger = new Swagger().info(info);
swagger.externalDocs(new ExternalDocs("Find out more about Swagger", "
http://swagger.io"));
swagger.securityDefinition("api_key", new ApiKeyAuthDefinition("api_key", In.HEADER));
swagger.securityDefinition("nbo_auth",
new OAuth2Definition()
.scope("delete:client", "delete client")
/*.scope("write:pets", "modify pets in your account")*/);
swagger.tag(new Tag()
.name("client")
.description("Client Management Operations")
context.setAttribute("swagger", swagger);
I also have jersey-servlet and jersey-server jars in the project build path.
but after calling delete api, I am getting this error:
<Severity>ERROR</Severity>
<Field/>
<Source>com.sun.jersey.api.NotFoundException</Source>
<Code>404</Code>
</ErrorType>
what I am missing here?
Thanks,