digitalbazaar / cborld

A Javascript CBOR-LD processor for web browsers and Node.js apps.
https://json-ld.github.io/cbor-ld-spec/
BSD 3-Clause "New" or "Revised" License
21 stars 17 forks source link

Applying scoped term codecs fails for redeclarations #2

Closed msporny closed 3 years ago

msporny commented 4 years ago

The algorithm for determining which codec to use when encoding/decoding a value is currently too simple and doesn't entirely take scoped terms into account. That is, when there is a redeclaration of an outer term, for example when @protected isn't used, last defined wins when it shouldn't.

The value encode/decode codec selection algorithm needs to be updated to take where the encoder/decoder is in the parsing tree into account as that can affect which codec is used for complex JSON-LD contexts.

dlongley commented 3 years ago

Fixed by #34.