Skip to content

Commit 215248c

Browse files
Ryan P KilbyCarlton Gibson
authored andcommitted
Add 'STRICT_JSON' docs
1 parent c98223f commit 215248c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/api-guide/settings.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,14 @@ The default style is to return minified responses, in line with [Heroku's API de
362362

363363
Default: `True`
364364

365+
#### STRICT_JSON
366+
367+
When set to `True`, JSON rendering and parsing will only observe syntactically valid JSON, raising an exception for the extended float values (`nan`, `inf`, `-inf`) accepted by Python's `json` module. This is the recommended setting, as these values are not generally supported. e.g., neither Javascript's `JSON.Parse` nor PostgreSQL's JSON data type accept these values.
368+
369+
When set to `False`, JSON rendering and parsing will be permissive. However, these values are still invalid and will need to be specially handled in your code.
370+
371+
Default: `True`
372+
365373
#### COERCE_DECIMAL_TO_STRING
366374

367375
When returning decimal objects in API representations that do not support a native decimal type, it is normally best to return the value as a string. This avoids the loss of precision that occurs with binary floating point implementations.

0 commit comments

Comments
 (0)