-
Notifications
You must be signed in to change notification settings - Fork 2.2k
#2319 parse @Example from @APiResponse annotations #2323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#2319 parse @Example from @APiResponse annotations #2323
Conversation
frantuma
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Along inline comments, we would also need to add some related tests. This would indeed introduce example support to response annotation, limited to String types, therefore not fully solving #2319, but probably better than no support. Let me know if you can update PR, and/or any comment.
Also related to #1107 and linked tickets, a full solution
would be similar to the one applied in 2.0 version, probably in scope of #1107 and related.
|
|
||
| Response response = new Response() | ||
| .description(apiResponse.message()).headers(responseHeaders); | ||
| .description(apiResponse.message()).headers(responseHeaders).setExamples(examples); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would call response.setExamples() on new line, with no need of modifying setter behaviour in response POJO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will change that.
| public void setExamples(Map<String, Object> examples) { | ||
| public Response setExamples(Map<String, Object> examples) { | ||
| this.examples = examples; | ||
| return this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't want to modify setter behaviour, see also comment above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
|
There is already an unit test for this feature at |
|
included and replaced by #2801 |
Parse @example nested inside @apiresponse annotation