Expand description
json.dumps the way CPython writes it, so files and stdout compare byte
for byte with the Python pipeline.
Covers what the pipeline uses: indent=2 and compact form, ensure_ascii
on and off, Python float repr, insertion-ordered objects (serde_json is
built with preserve_order).
Structs§
- Style
- How to render.
Constants§
- RAW_
MARKER - Marker prefix for a value that must be emitted verbatim, unquoted.
Functions§
- dumps
- Serialize
vin the given style. Never fails: everyValueis representable. - float_
repr repr(float): shortest round-trip digits, fixed notation when the decimal exponent is in-4..16, otherwised.ddde±XXwith a two-digit minimum exponent. Integral values keep a.0.- newline 🔒
- Between items: a newline plus indentation when indenting, a single space
after the comma in compact mode (Python’s default
", "separator). - py_
float - Wrap a float the way Python’s json module would write it: an ordinary number when finite, a bare token when not.
- write_
string - Python’s string escaping:
"\and the C escapes, other control characters as\u00XX; withensure_ascii, everything above U+007F as\uXXXX(surrogate pairs beyond the BMP)./is never escaped. - write_
value 🔒