Skip to content

schemas: string keys for keyed unions#516

Closed
rvagg wants to merge 1 commit into
filecoin-project:masterfrom
rvagg:rvagg/schemas-map-stringkeys
Closed

schemas: string keys for keyed unions#516
rvagg wants to merge 1 commit into
filecoin-project:masterfrom
rvagg:rvagg/schemas-map-stringkeys

Conversation

@rvagg
Copy link
Copy Markdown
Member

@rvagg rvagg commented Sep 13, 2019

(one of a few PRs to attempt to get the IPLD Schemas conforming to current spec)

IPLD doesn't support non-string keys for maps which is how kinded unions are stored. Switch instead to string keys.

I'm not expecting this to be uncontroversial because an extra byte gets involved in the encoding here and I know that's an important consideration, but we're bumping up against the IPLD goal of providing a common data interface able to support multiple encoding formats and multiple programming languages. Integer map keys are comfortable from Go -> CBOR but become awkward as we move away from that pairing.

Ref: https://github.com/ipld/specs/blob/data-model-motivation/data-model-layer/data-model.md#motivation
Ref: ipld/specs#184 (comment)
Ref: ipld/specs#58

IPLD doesn't support non-string keys for maps which is how kinded unions
are stored. Switch instead to string keys.

Ref: https://github.com/ipld/specs/blob/data-model-motivation/data-model-layer/data-model.md#motivation
Ref: ipld/specs#184 (comment)
Ref: ipld/specs#58
@rvagg rvagg closed this Oct 14, 2019
@rvagg rvagg deleted the rvagg/schemas-map-stringkeys branch October 14, 2019 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants