-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
ApiListingResource doesn't respect pretty print support #2320
Comments
I can confirm this using Swagger 1.5.16. As |
I now use my own listing resource instead of ApiListingResource as a workaround:
|
Wtf is this anyway?
Why first split the yaml and then reconstruct it again? |
The bug of this issue has been introduced with 3ad7595. I propose a complete revert of this commit, as I don't see the point of it. The commit message is "use custom object mapper to serialize json in order to avoid null values", but I don't see any null handling that would differ from the current implementation of |
null values" This reverts commit 3ad7595. This fixes issue swagger-api#2320. The original commit is pointless and dangerous, as it surprisingly overrides the behavior of SwaggerSerializers.java, but does essentially the same (but without supporting pretty printing).
This fixes issue swagger-api#2320 for YAML documents. The original code surprisingly overrides the behavior of SwaggerSerializers.java to needlessly split and join a YAML document. This was originally done to remove some kind of comment line from the YAML, but this has been removed long ago, making split/join-code pointless.
I configured Swagger using
BeanConfig
on myApplication
start up to use pretty print, but when I retrieve the API fromswagger.json
endpoint it's all on a single line.I've tracked the issue down to the ApiListingResource. When this resource processes the API, it doesn't return a Swagger object on the Response (that would be then converted by SwaggerSerializers), but returns a text string instead.
If
ApiListingResource
responds with the Swagger object instead, the serialization works fine and respect the pretty print request. Could thegetListing()
code be changed fromto
or would it affect some functionality I'm not aware of?
The text was updated successfully, but these errors were encountered: