-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
Add more options to custom DefaultPrettyPrinter (example with grafana json dashboards) #1128
Comments
With respect to entry (1) did you notice #1042 that is going in 2.16? (2.16.0-rc1 being released today)? As to others, PRs are always welcome; feature requests themselves sound reasonable to me. |
Hi @cowtowncoder, thank's for the link #1042 I will open PRs for others features. |
Update :
|
The extra whitespace in 2.16 breaks previous behavior. This should not be a minor change. When it's a minor change there should be a method on the defaultPrettyPrinter to enable the whitespace before the separator |
@erik-meuwese-topicus All of these are options for user to change behavior, not changing default behavior, so I am not sure what extra space you are referring to? Intent at least is not to make such changes, to preserve backwards-compatibility. |
@gulecroc Sounds like first and third entries have been implemented: should the second entry be moved to its own issue (create new one) and close this one? |
@cowtowncoder for me it sounds good. I close the issue. Thank you |
Jackson version: 2.15.3
Hi, I worked on Grafana dashboards json files and need to adapt the DefaultPrettyPrinter.
I would like tu suggest some improvment to custom DefaultPrettyPrinter without the need to override some methods :
I could not override this behavior, either with
withSeparators
orwithoutSpacesInObjectEntries
methods :Need to override
writeObjectFieldValueSeparator
method :Maybe add new method
withSeparators(String prefix, Separators separators, String suffix)
?This could be done with :
But it was not easy to find the good indenter, maybe add some documentation to indenters availables or add
withArrayIndenterLineFeed
method ?I need to override
writeEndObject
andwriteEndArray
method to comment the behavior whennrOfValues = 0
:Maybe add new methods
withEmptyArrayContent(String content)
?Finally, here is my custom class for those who could need it :
The text was updated successfully, but these errors were encountered: