I have a project which uses spring framework 6 (not spring boot). I just used @RestController
, so I can return any type of Object. Now I want to document these rest apis. And for this, I tried to use OpenAPI.
I added implementation 'org.springdoc:springdoc-openapi-ui:1.7.0
and other related dependencies also which is latest one. Application builds and runs successfully. But the problem is when I try to access ui of swagger using http://localhost:8080/rest/swagger-ui.html
I get a response like
No primary or single unique constructor found for interface javax.servlet.http.HttpServletRequest
Because Spring framework 6 uses Jakarta
namespace and org.springdoc:springdoc-openapi-ui:1.7.0
uses javax
namespace. And I cannot have both dependencies in my project. The thing is I cannot downgrade my application because of client's requirement.
Please tell if there is any solution.
Thanks in advance!!