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
@RequestBody from Swagger v3 conflict with @RequestBody from the Spring Library #3628
Comments
These are two different annotations. You can combine them if needed. |
I'm well aware that they both are different. Can you assist me on how we can combine them? |
If you want to use both the annotations with the same name then you can write the swagger requestBody annotation like this - @io.swagger.v3.oas.annotations.parameters.RequestBody() |
I was asking if it is possible to combine both of them, rather than using two of them. And maybe these conflicts should be avoided in the next major of swagger-core release |
I am not sure what you mean by "combine both of them", also please notice that |
@debargharoy I have ran into similar consideration and found out that alternative to annotating the method parameter might be doing so on
Though it still does not avoid using full qualified name. |
@gcwiak, it's nice to put it that way. Unfortunately, as you already said we'll still have to use both the annotations. As already highlighted by @frantuma, the issue stems from the fact that Swagger-Core is built around JAX-RS (which does not have it's own @frantuma, by the below phrase
what I meant to ask was, if there's a way to create a single annotation in our project that'll do the task of both the annotations together. But having explored that, it doesn't look like it's a feasible solution. So we'll have to continue using both the annotations together. |
Could swagger at least use the type information from param marked with |
Consider the below piece of code
Isn't it a bad idea to have the same name
@RequestBody
for the annotation that belongs to Spring library as well? Because in the end, the Swagger's@RequestBody
doesn't server the same purpose as that of the one from the Spring (the object is initialized to empty with all it's field set tonull
when using the annotation from Swagger alone), and we end up having fully qualified names for either of them which is discouraged.The text was updated successfully, but these errors were encountered: