Skip to content

v3.1.0

Compare
Choose a tag to compare
@stephenberry stephenberry released this 17 Jul 15:13
· 501 commits to main since this release

Breaking change: removed force_conformance option

By default Glaze is now strictly conformant with the latest JSON standard except in two cases with associated options (see new conformance options below).

Previously the force_conformance option was necessary to have JSON conformant number parsing. This update applies the more stringent rules from the JSON specification, such as not allowing leading zeros.

Rules applied now by default:

  • JSON requires a digit after the decimal place in numbers.
  • JSON requires a digit after an exponent e or E

This does NOT break how Glaze serializes or parses numbers, it will simply now reject invalid numbers due to more stringent JSON specification rules.

New conformance options

  • validate_skipped
    This option does full JSON validation for skipped values when parsing. This is not set by default because values are typically skipped when the user is unconcerned with them, and Glaze still validates for major issues. But, this makes skipping faster by not caring if the skipped values are exactly JSON conformant. For example, by default Glaze will ensure skipped numbers have all valid numerical characters, but it will not validate for issues like leading zeros in skipped numbers unless validate_skipped is on. Wherever Glaze parses a value to be used it is fully validated.

  • validate_trailing_whitespace
    This option validates the trailing whitespace in a parsed document. Because Glaze parses C++ structs, there is typically no need to continue parsing after the object of interest has been read. Turn on this option if you want to ensure that the rest of the document has valid whitespace, otherwise Glaze will just ignore the content after the content of interest has been parsed.

Full Changelog: v3.0.0...v3.1.0