Skip to content

schema: misc IPLD schema fixups and adjustments - #517

Closed
rvagg wants to merge 4 commits into
filecoin-project:masterfrom
rvagg:rvagg/schema-misc
Closed

schema: misc IPLD schema fixups and adjustments#517
rvagg wants to merge 4 commits into
filecoin-project:masterfrom
rvagg:rvagg/schema-misc

Conversation

@rvagg

@rvagg rvagg commented Sep 13, 2019

Copy link
Copy Markdown
Member

This is a WIP. There's still a few things that prevent a full parse, notes below about that which we'll need to figure out. This pulls in #514 #515 #516 to get us closer to passing schema spec but this could be detached from them (with some minor rebase pain) if needed.

So, review the last commit in the list only, see those other PRs for those commits.

I've also taken the liberty of fixing some tab/space confusion in both the schema sections and the Go code blocks I found along the way. This isn't essential, IPLD Schemas are agnostic to this, but I think mostly tabs are being used here and I imagine they're more comfortable for Go folks.

The outstanding items to get a successful parse in all of these are:

  1. Unions with integer representations, including DealState and Options, Status in network-protocols.md, are not supported
  2. Type aliases, including AcceptedParams, FailedParams, StagedParams in network-protocols.md and ErrorResponse in retrieval-market.md are not supported

Also I have some changes to get pushed to the schema parsers to get some other things working like the advanced layouts from #515 but that'll happen shortly I hope.

strong typing restrictions are specified as adjuncts to schemas, for now as
as descriptive documentation text but we will also soon have a method to also
supply such information for codegen purposes, probably language-specific.

Ref: https://github.com/ipld/specs/blob/master/design/history/exploration-reports/2019.07-int-ranges-as-adjuncts.md
Ref: https://github.com/ipld/specs/blob/data-model-motivation/data-model-layer/data-model.md#motivation
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

@warpfork warpfork left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My review is just regarding the schema components rather than the filecoin semantics, but on that front: this all looks correct to me.

Comment thread payments.md
@@ -71,8 +71,8 @@ type ReconcileResponse struct {

## TODO: what are the possible status cases?
type Status enum {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure what the purpose of this is, by default enums are just strings but we are discussing getting an int enum in but it'll need ints next to each item

Comment thread retrieval-market.md
piece Link
}

type RetQueryResponse union {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure what the intent here was, keyed unions need a key, but perhaps there was something else going on? my keys might be too verbose or there might be an alternative approach appropriate here

@rvagg rvagg closed this Oct 14, 2019
@rvagg
rvagg deleted the rvagg/schema-misc 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