-
Notifications
You must be signed in to change notification settings - Fork 108
Data model - Integer as map key #341
Comments
I'll try to chime into the call next week, since this is a real blocker for the codec and I'd like to get this sorted before the first Encryption WG meeting in January! |
If you mean the weekly IPLD meeting, we've cancled the ones till the end of the year. The first one will be on Monday 2020-01-04. |
Oooh I see, duh. Well then let's figure something out this way if you're available and maybe discuss is further next year :) |
Since For practical purposes this just usually means you have some struct that has fields which have names that may or may not correspond to the integers or strings that existing in the encoding. As long as you can clearly define how the bytes convert into memory in the data model and back again then it doesn't matter too much. My main concern would be with this phrasing and how it's going to work with JavaScript:
Can the header have integers and string representations of integers? Could it have |
Thanks for the response! I already figured something like that would be the way to go and to address your concern: |
While working on the DAG-COSE specification, this issue came up, because in COSE the header is a cbor map that is keyed with integers, not strings.
So I'm at this crossroad where I have to decide wether to break with the COSE spec (meaning that DAG-COSE object won't be valid COSE objects and cannot be decoded by existing tools) or to introduce a violation of the IPLD data model.
How should I approach this? Should DAG-COSE implementations be required to convert integers to strings ( basically aliasing the integers with strings? )?
I understand that there are languages that don't support maps that are indexed by integers but maybe we can figure something out!
For context:
COSE allows the header to be keyed with strings, but all default fields ( those that every implementation has to understand & that are registered with IANA ) are keyed by integer, where positive AND negative integers are allowed.
The text was updated successfully, but these errors were encountered: