ryankennedy / swagger-jaxrs-doclet

Apache License 2.0
87 stars 136 forks source link

Add support for errorResponses #34

Closed yadgar closed 11 years ago

yadgar commented 11 years ago

It would be nice if this tool added a way to declare the errorResponses of a REST resource and then include them in the created JSON files (see https://github.com/wordnik/swagger-core/wiki/Errors).

Maybe translating a specific Javadoc annotation into an error response specification?

jerome-leclercq commented 11 years ago

:+1: for the javadoc annotation

Proposal

@[annotation_name] [code] [reason]

  1. annotation_name would default to errorResponse to stay close to Swagger API.
  2. This should be set or extended with a doclet parameter -errorAnnotationNames errorResponse,myCustomError

Examples

@errorResponse 500 something bad happened @myCustomError 743 unknown behaviour