You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(REVERTED) Change default for JsonWriteFeature.ESCAPE_FORWARD_SLASHES to be true for 3.0Β #1200
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.
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. :)
(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).
changed the title [-]Change default for `JsonWriteFeature.ESCAPE_FORWARD_SLASHES` to be `true` for 3.0[/-][+](REVERTED) Change default for `JsonWriteFeature.ESCAPE_FORWARD_SLASHES` to be `true` for 3.0[/+]on Jul 24, 2025
Activity
Fixes #1200: change default for "Escape slash" to true for 3.0
Fixes #1200: change default for "Escape slash" to true for 3.0 (#1201)
odrotbohm commentedon May 15, 2025
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 aMapperBuilderobtained from an existingObjectMapperinstance.cowtowncoder commentedon May 15, 2025
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:
FasterXML/jackson-future-ideas#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. :)
cowtowncoder commentedon May 15, 2025
(on Builder problem -- yes, "generic"
MapperBuilderis not great. But note that ifObjectMapperbeing re-built isJsonMapper, builder will be ofJsonMapper.Buildertype, can be cast. Not clean but doable).cowtowncoder commentedon Jul 22, 2025
NOTE!!!: There's now Poll requesting UNDOing this change.
@odrotbohm ^^^
cowtowncoder commentedon Jul 23, 2025
... definitely looks like "let's undo & keep defaults as they are" is getting votes.
cowtowncoder commentedon Jul 24, 2025
Decision: WILL revert (voting was 20 - 0 in favor of reverting; highest vote count of polls (still pretty limited polling of course but...))
Revert #1201 / #1200
Update 2.x Javadocs wrt revert of #1200
Revert #1201 / #1200 (#1456)
[-]Change default for `JsonWriteFeature.ESCAPE_FORWARD_SLASHES` to be `true` for 3.0[/-][+](REVERTED) Change default for `JsonWriteFeature.ESCAPE_FORWARD_SLASHES` to be `true` for 3.0[/+]cowtowncoder commentedon Jul 24, 2025
Done.
odrotbohm commentedon Jul 24, 2025
Thanks for considering, Tatu! πββοΈ
cowtowncoder commentedon Jul 24, 2025
@cowtowncoder np. Should have opened a Poll when you brought this up. But better later than too late -- we are still pre-3.0.0!
Revert #1200/#1201 (complete #1456)
Revert #1200/#1201 (complete #1456) (#1460)