This document specifies a tag for representing JSON numbers as strings in Concise Binary Object Representation (CBOR)[1]. This allows the preservation of numeric values treated as strings rather than the I-JSON (RFC 7493[2]) limits on numbers.
- Tag: 284
- Data item: text string or byte string
- Semantics: JSON Numeric Value, Represented as its JSON Text
- Point of contact: David Wheeler [email protected]
- Description of semantics: https://gist.github.com/theory/ef667af1c725240e6e30d525786d58e6
Tag 284 can be applied to a text string (major type 3) or byte string (major type 2) to indicate that the string represents a JSON number in string form as defined by RFC 8259[3]’s grammar for numbers, shown here in a simplified form:
number = [ "-" ] int [ frac ] [ exp ]
int = "0" / ( digit1-9 *DIGIT )
frac = "." 1*DIGIT
exp = "E" [ "-" / "+" ] 1*DIGIT
digit1-9 = %x31-39 ; 1-9
DIGIT = %x30-39 ; 0-9
[1] T. Bray, Ed. "The I-JSON Message Format". RFC 7493, March 2015.
[2] C. Bormann, and P. Hoffman. "Concise Binary Object Representation (CBOR)". RFC 8949, December 2020.
[3] T. Bray, Ed. "The JavaScript Object Notation (JSON) Data Interchange Format". RFC 8259, December 2017.
David Wheeler [email protected]