RFC Errata
Found 1 record.
Status: Reported (1)
RFC 8949, "Concise Binary Object Representation (CBOR)", December 2020
Source of RFC: cbor (art)
Errata ID: 8255
Status: Reported
Type: Technical
Publication Format(s) : TEXT, HTML
Reported By: Alan DeKok
Date Reported: 2025-01-19
Section 3.1 says:
Major type 5: ...
It should say:
Major type 5: ... A map key MUST NOT contain a data item which is of Major type 4 or 5. A map that contains one or more keys of Major Type 4 or 5 may be well formed, but it is not valid. A map key MAY contain a data item which has Major type 6, but only if the data item contained in that tag is not of Major type 4 or 5. For map keys of Major type 6, all key comparisons MUST include both the tag number and the tag value. This requirement allows the differentiation of untagged data from tagged data.
Notes:
The rest of the text implies that a map key is a simple data item such as integer, string, byte string, etc. However, there is no explicit statement to this effect.
It's not clear how a map would behave if the key was itself a map.
It could be useful to allow arrays as map keys, e.g. for tag 4 (decimal fraction). It seems relatively clear how to create a map key from integers. However for other complex structures such as tag 40 (multi-dimensional array), it's not clear how you would use that as a map key.