--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You can't describe multiple messages for a single http status code. That's not supported by the spec.
On Thu, Jun 4, 2015 at 4:01 PM, kr <kavit...@gmail.com> wrote:I was able to generate swagger API documentation for my restful services that use Jboss and resteasy. The only issue i am facing is in generating multiple messages for http status codes. For eg : For http status code 400, i would like to have more than one entry with some sub codes. Please see my code snippet below:--@ApiResponses({@ApiResponse(code = 200, message = "2001: IFX_ArrangementsEligibility service timeout"),@ApiResponse(code = 400, message = "2002: Non zero status code"),@ApiResponse(code = 400, message = "2003: Not found")})In the above snippet, only the code 200 and code 400 -message 2003 comes up but not code 400 - message 2002. Kindly help. Apparently it picks up only last one defined, which is sub code 2003 here. I am attaching web.xml and the main service class that defines my resources that has annotations.Thanks,
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
5 possible reasons to get 400. As descriptions, those offer no value to computers as consumers. A machine will get the 400 and will parse only that. The description is only meta data for the 400 which is not part of the response (as in, it is part of the Swagger description). For humans, that information could be useful, but it doesn't require multiple definitions. You can simple have a string with new lines (even use GFM) and have a full document there if you need to describe a whole set of reasons to get that error.
When does it matter? When the response changes. So let's say that description is not only used for documentation purposes, but also that's the actual possible returned value. If that's the case, I'd argue the documentation in this case is lacking. You would want to say the return type is a string, and limit the options using an enum to the descriptions as provided. In that case, again, you don't need multiple occurrences of the status code. If I'll go slightly beyond the scope of Swagger, I'd also say that the response shouldn't be a string at all but rather a parsable structure (be it JSON, XML, YAML) separating the error code from the description. That would make it easier for machines to parse and process and would also be easier to document. You'll probably agree with me that it'd be much more difficult to create a generated client from a Swagger definition that needs to parse an error string to get out the error code and process it, than to simply process a specific field with known possible values.
However, even with everything that's said above, we may have certainly missed possible use cases where there would be a good strong reason as to why to allow multiple descriptions of a single response code. This is not about making demands from your end, but rather expressing your needs which may apply to others as well. If you feel strongly about it, you're more than welcome to open an issue on swagger-spec with your reasoning and we will consider it for a future version of the spec, depending on other users' feedback on it.
Hope you found it informative,
Ron
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
-------------------------------------------http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/KAmdyf4aRGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
-------------------------------------------http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
-------------------------------------------http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------
--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/KAmdyf4aRGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggersocket+unsub...@googlegroups.com.