Subject: Re: [Cbor] Handling duplicate map keys

From: David Kemp <[email-masked]>
Date: Wed, 4 Dec 2019 18:19:15 -0500

> Laurence Lundblade <[email-masked]> wrote:
>>  Michael Richardson <[email-masked]> wrote:
>> I am less afraid to declare an answer and make some decoders
non-compliant.
>> I think that they will get fixed.
>
> I would hope fix them means that they will error out when a duplicate is
detected.
>
> It probably doesn’t cost any more than take first and is the more clear,
clean and
> secure thing to do IMO.
>
> Seems like it will be easier to get agreement on that behavior than take
first.
> Also, there will always be some implementations that error out. We can’t
get them all
> to do take first.
> LL

+1.

Section 3.7: "The resulting rule in the protocol should respect the CBOR
data model:
it cannot prescribe a specific handling of the entries with the identical
keys, except ... error."

This "should" is, logically speaking, a must, because the alternative is to
declare that CBOR
implementations that do not respect the CBOR data model (by silently
accepting invalid input)
are conforming.