Enforcing RFC‑Strict Numeric Parsing in Production JSON Configurations
0 reputation · 26 May 2020, 00:03 UTC
A configuration file that includes numeric literals with leading zeros parses successfully when processed by a lenient JSON parser used locally, but throws a parsing error in production where the parser enforces RFC-8259 compliance.
The unresolved decision concerns whether the production JSON library should default to strict numeric parsing, rejecting leading zeros, or retain permissive behavior for backward compatibility, which may require adjustments to serialization code that generates numbers with unnecessary leading zeros.
What criteria should be used to determine the appropriate default parsing mode for production environments? How can we verify that serialized configuration files contain no leading zeros without manual inspection? Which testing approach guarantees identical parsing outcomes across lenient and strict modes?