Skip to content

ecorm/cbor-tag-multimap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

cbor-tag-multimap

This document describes a CBOR tag for multimaps encoded as arrays of pairs.

Tag value: TBD280

Data item: Array (major type 4)

Semantics summary: Array of key-value pairs where keys may be duplicated.

Semantics

This tag represents an array of key-value pairs where keys may be duplicated. Each key-value pair is encoded as a two-element subarray of major type 4, size 2 (header byte 0x82). The keys and values may be of any valid CBOR type and need not be homogenous.

Rationale

According to RFC7048, section 2-1:

A map that has duplicate keys may be well-formed, but it is not valid, and thus it causes indeterminate decoding

This limitation makes it either impossible or unpractical to encode multimap data structures as CBOR maps (major type 5).

A workaround is to encode multimap data structures as arrays of pairs. This tag allows a CBOR decoder to determine a priori that the following array is indeed an array of pairs and can thus be safely interpreted as a multimap.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published