I'm wondering is it possible to build Swagger documentation based only on swagger-core annotations w/o help of any adapters like jax-rs or springfox?
Why asking the question: e.g. when using springfox it relies on Spring annotations like @RequestMapping
, @ResponseStatus
etc. Imagine I want to specify a POST method which returns 201 by default:
@ApiOperation(value = "some api")
@ApiResponses(value = {
@ApiResponse(code = 201, message = "Created")
})
@RequestMapping(method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
Without the last line springfox will generate the 200 status by default which I don't want to be a part of the spec. And ofc I don't want to add an imperative @ResponseStatus
annotation to the controller.
I.e. I want to be in full control of the generated API spec which should rely on swagger core annotations only.