Documentation
¶
Overview ¶
Package sortfmt provides deterministic JSON formatting for OpenAPI documents.
The formatter orders mapping keys using a fixed priority list, alphabetizes maps under paths, properties, and schemas, and sorts selected arrays by a stable display key. It intentionally changes the order of parameters and composition arrays, so callers should opt in only when sorted output is more important than preserving authored array order. Selected arrays whose sort keys have different JSON types return an error, matching Python's ordering behavior. Format also rejects lone UTF-16 surrogate escapes rather than silently replacing them with a different character.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Format ¶
Format reads a JSON document, applies the sorted formatting style, and writes two-space-indented JSON with a trailing newline.
Types ¶
This section is empty.