Skip to content
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

problem-spring-webflux does not work well with springdoc-openapi-webflux-ui #774

Open
jodelus opened this issue Apr 15, 2022 · 0 comments
Open
Labels

Comments

@jodelus
Copy link

jodelus commented Apr 15, 2022

Indeed, when I add the swagger dependency to my project the errors are not serialized normally by jackson

I am in a webflux project where I use problem-spring-webflux from version 0.27.0 to handle my errors, it is configured normally according to the github documentation (jackson configuration with ProblemModule and ConstraintViolationProblemModule...) and it works perfectly, my errors are handled perfectly. On the other hand I would like to expose my APIs which leads me to use springdoc-openapi-webflux-ui from version 1.6.7, and after that my errors with zalando are not serialized normally. no exceptions are raised in the code but the answers do not come correctly.

For a 401 error that was displayed normally, is displayed after installation of the swagger library as follows:

{
"cause": null,
"stackTrace": [
{
"classLoaderName": "app",
"moduleName": null,
"moduleVersion": null,
"methodName": "build",
"fileName": "ProblemBuilder.java",
"lineNumber": 83,
"className": "org.zalando.problem.ProblemBuilder",
"nativeMethod": false
},
{
"classLoaderName": null,
"moduleName": null,
"moduleVersion": null,
"methodName": "process",
"fileName": "ExceptionTranslator.java",
"lineNumber": 89,
"className": "com.jod.elio.gescom.web.rest.errors.ExceptionTranslator",
"nativeMethod": false
},
{
"classLoaderName": "app",
"moduleName": null,
"moduleVersion": null,
"methodName": "lambda$create$2",
"fileName": "AdviceTrait.java",
"lineNumber": 129,
"className": "org.zalando.problem.spring.webflux.advice.AdviceTrait",
"nativeMethod": false
},
{
"classLoaderName": "app",
"moduleName": null,
"moduleVersion": null,
"methodName": "onNext",
"fileName": "MonoFlatMap.java",
"lineNumber": 125,
"className": "reactor.core.publisher.MonoFlatMap$FlatMapMain",
"nativeMethod": false
},
...
}

and without the swagger library it appears as follows

{
"type": "problem-with-message",
"title": "Unauthorized",
"status": 401,
"detail": "User string was not found in the database",
"path": "/api/authenticate",
"message": "error.http.401"
}

@jodelus jodelus added the Bug label Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant