qbit icon indicating copy to clipboard operation
qbit copied to clipboard

JSend/Swagger/Error handling. Add ability to define error response codes in annotations and deliver via swagger

Open RichardHightower opened this issue 9 years ago • 1 comments

Add ability to define error response codes in annotations and deliver via swagger.

The ability should work with JSend support.

@ResponseError(code = 404)

@ResponseErrors ({
@ResponseError(code = 404),
@ResponseError(code = 505)
})
@ResponseFail(code = 404, data=Foo.class)

@ResponseFails ({
@ResponseFail(code = 404, data=Foo.class),
@ResponseFail(code = 505, data=Bar.class)
})

These become JSend validation fails.

Fail: https://labs.omniti.com/labs/jsend

Exceptions always become JSend error and the message of the exception is the error.

RichardHightower avatar Oct 26 '15 23:10 RichardHightower

Yes

baohuynh27 avatar Nov 04 '17 22:11 baohuynh27