schema: misc IPLD schema fixups and adjustments - #517
Closed
rvagg wants to merge 4 commits into
Closed
Conversation
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
approved these changes
Sep 13, 2019
warpfork
left a comment
Contributor
There was a problem hiding this comment.
My review is just regarding the schema components rather than the filecoin semantics, but on that front: this all looks correct to me.
rvagg
commented
Sep 13, 2019
| @@ -71,8 +71,8 @@ type ReconcileResponse struct { | |||
|
|
|||
| ## TODO: what are the possible status cases? | |||
| type Status enum { | |||
Member
Author
There was a problem hiding this comment.
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
rvagg
commented
Sep 13, 2019
| piece Link | ||
| } | ||
|
|
||
| type RetQueryResponse union { |
Member
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
DealStateandOptions,Statusin network-protocols.md, are not supportedAcceptedParams,FailedParams,StagedParamsin network-protocols.md andErrorResponsein retrieval-market.md are not supportedAlso 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.