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
Run mvn formatter:format on the attached project test.zip file. Expected that spaceBeforeSeparator=false configuration option in formatter-json.properties is honoured.
Other configuration options work just fine.
Versions (OS, Maven, Java, and others, as appropriate):
Affected version(s) of this project: 2.24.1
OS: Windows 10 x64
Additional information
Additionally I have run the test JsonFormatterTest.testDoFormatFileWithConfig() and at least in my setup it has generated the following JSON target\testoutput\someFile.json with spaces before field separator:
which is wrong because spaceBeforeSeparator=false:
I have noticed that overridden function DefaultPrettyPrinter#withSeparators(Separators separators) is not called, which means that _objectFieldValueSeparatorWithSpaces is left with default Jackson value :. This is because some of API has become deprecated in Jackson v2.17.
One of the solutions could be to initialize _objectFieldValueSeparatorWithSpaces directly in createInstance() as in fix.patch.
The text was updated successfully, but these errors were encountered:
To Reproduce
Run
mvn formatter:format
on the attached project test.zip file. Expected thatspaceBeforeSeparator=false
configuration option informatter-json.properties
is honoured.Other configuration options work just fine.
Versions (OS, Maven, Java, and others, as appropriate):
Additional information
Additionally I have run the test
JsonFormatterTest.testDoFormatFileWithConfig()
and at least in my setup it has generated the following JSONtarget\testoutput\someFile.json
with spaces before field separator:which is wrong because
spaceBeforeSeparator=false
:I have noticed that overridden function
DefaultPrettyPrinter#withSeparators(Separators separators)
is not called, which means that_objectFieldValueSeparatorWithSpaces
is left with default Jackson value:
. This is because some of API has become deprecated in Jackson v2.17.One of the solutions could be to initialize
_objectFieldValueSeparatorWithSpaces
directly increateInstance()
as in fix.patch.The text was updated successfully, but these errors were encountered: