(follow-up to #507)
Now that we have added ability to easily force escaping of /
let's make that default for Jackson 3.0 stream writers.
Comment From: odrotbohm
Is it still an option to revert that change of default? Any kind of URL-like structure looking entirely different in the JSON output generated is likely to break millions of application clients that are not prepared to deal with the additional backslashes. I guess this could be mitigated on the integrator side, but I'm not sure if it's a good state of affairs, if half the world has to switch to the 2.x defaults through, for example, some reconfiguration which Spring Boot applies.
Even more problematic: as this is a JsonWriteFeature
, it cannot be reconfigured on a MapperBuilder
obtained from an existing ObjectMapper
instance.
Comment From: cowtowncoder
First things first: it is totally possible to change this, but for that I think we'd need a Poll Discussion: we've had some as you can see here:
https://github.com/FasterXML/jackson-future-ideas/discussions/72
so if you could start one similar to existing ones, that'd be the way to go.
That said, the reason for changing (as per #507) is that many other tools (notably GSON) by default escape "/" for security reasons (inclusion in HTML, specifically). And any JSON tool that does not handle escapes properly is broken, so while I think this can lead to problems (like existing tests not counting on escaping and using textual comparison for JSON output), I don't think it should lead to processing issues (and/or if it does that is exposing bugs in tooling).
Having said that, if community feels changing defaults is not desired, I am fine with that too. But just need to get some sort of validation, in form of Poll. :)
Comment From: cowtowncoder
(on Builder problem -- yes, "generic" MapperBuilder
is not great. But note that if ObjectMapper
being re-built is JsonMapper
, builder will be of JsonMapper.Builder
type, can be cast. Not clean but doable).
Comment From: cowtowncoder
NOTE!!!: There's now Poll requesting UNDOing this change.
@odrotbohm ^^^
Comment From: cowtowncoder
... definitely looks like "let's undo & keep defaults as they are" is getting votes.