Happening in a move to deprecate JSONIFY_PRETTYPRINT_REGULAR.
We saw this deprecation warning in our server logs a lot, so it's good to move on from it.
The new setting is so we can still control it (i.e. in production you might want to read nicely).
Per default, the setting is Trueas it saves on IO volume. It is only False for development. Should it also be False during testing?
How to test
In a development environment, the default should be to not compact the JSON:
± curl -H "Content-Type: application/json" localhost:5000/api/ping
{
"message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.",
"status": 404
}
We can enforce compact JSON:
± export FLEXMEASURES_JSON_COMPACT=True; flexmeasures run
± curl -H "Content-Type: application/json" localhost:5000/api/ping
{"message":"The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.","status":404}
And the other way around:
± export FLEXMEASURES_JSON_COMPACT=False; flexmeasures run
± curl -H "Content-Type: application/json" localhost:5000/api/ping
{
"message": "The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.",
"status": 404
}
Description
Happening in a move to deprecate JSONIFY_PRETTYPRINT_REGULAR. We saw this deprecation warning in our server logs a lot, so it's good to move on from it.
The new setting is so we can still control it (i.e. in production you might want to read nicely).
Per default, the setting is
True
as it saves on IO volume. It is onlyFalse
for development. Should it also beFalse
during testing?How to test
In a development environment, the default should be to not compact the JSON:
We can enforce compact JSON:
And the other way around:
Remember to unset this in your bash session: