-
Notifications
You must be signed in to change notification settings - Fork 83
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
APIResponse and APIResponses should target TYPE as well #417
Comments
Can you provide some pseudo/sample code that shows the use-case you're asking for. I believe this is about annotating an entire JAX-RS class with e.g. |
@EricWittmann Sample code would be something like that:
The generated documentation would add the 500 error to all methods, plus the specific APIResponses that the methods have (200 + 400 in this case). |
OK great thanks. I've marked this as a hangout topic for us to discuss on our next specification call. |
+1 |
1 similar comment
+1 |
@MikeEdgar and @arthurdm - this issue gets two resounding +1's from us. I think we should go ahead and tag this as "help wanted" or whatever the next step is to getting this done. Unless either of you has any reservations... |
+1 from me as well. This is a nice feature. |
+1 |
@jvs64893 will you propose a PR for that? The annotation should be changed and I think it would be great to have a TCK case for this. |
Hello, It would be great to also add the
allowing to save a lot of repetitive code. The example is extracted from this Swagger topic: swagger-api/swagger-core#690 |
Both the original proposal and the extra suggestion by @renzodf would be a great addition to this lib's capacity to reduce the boilerplate written and time taken to document uniform and/or repetitive APIs. Has any further action taken place in this direction? Is any assistance needed? |
Hi @szymonblaszczyk - if you have some bandwidth, I certainly think a PR with the suggested annotation changes and TCK test (tests?) to verify the changes to behaviour would be welcome! I am also curious about feedback from others as well regarding the use of |
…lrye-smallrye-parent-22 Bump smallrye-parent from 21 to 22
Currently APIResponse and APIResponses use:
@Target({ ElementType.METHOD })
The Swagger equivalent handles this differently (see
https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-annotations/src/main/java/io/swagger/v3/oas/annotations/responses/ApiResponses.java):
@Target({METHOD, TYPE, ANNOTATION_TYPE})
This makes it possible to add a response to all
@Operation
s in a class. It would be great if this was possible with MP OpenAPI as well!The text was updated successfully, but these errors were encountered: