Change default JSON serialization to compact wherever applicable#3633
Merged
Change default JSON serialization to compact wherever applicable#3633
Conversation
Contributor
|
Can't check the code from here (in this hell crowd of ppl in Garda land :)) For developing purposes it's always handy to have it readable in the logs. --So asking if I would make sense to have it configurable.-- did not read to the end like always :)) so forget about it. Defaulting to not pretty printed. On our side we do development builds using readable data and release builds compact. |
Member
Author
No worries, enjoy Gardaland! 😄 |
lminiero
added a commit
that referenced
this pull request
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As the title says, this PR changes the default serialization we do of JSON objects to strings to compact, where before it was a pretty JSON with an indentation of 3. The discussion in OpenSIPS/opensips#3840 made me realize it made little sense for the default being a pretty indentation, considering that it's almost always meant to just be for exchanging API messages, rather than something that needs to be consumed by a human (but even in that case, prettifying it after received is always an option). Compact messages also means less data on the wire, so this should be considered an optimization.
This shouldn't impact any existing application, so I plan to merge soon. If for any reason you need indented JSON, remember it's always possible to change the default in the associated configuration file.