-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Differentiate between an object that has a literal *
field, and a pointer to an object's additionalProperties
shape.
#1200
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, some detail comments on specific case handling, and i think we should use NextProperty
for the variant.
Ok @jgraettinger I think this is ready to be looked at again. Changing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % some minor nits and adding a bit of removed test coverage back
@@ -502,7 +506,7 @@ mod test { | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add back the /foo/-
case here by manually building up the tokens? You can't implicitly build them by parsing a pointer as it used to do, but you can still build it manually.
Also add a case covering creation with NextProperty. It'd return None, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got totally side-tracked and forgot to finished this. What do you mean by adding /foo/-
back? That pointer wouldn't make any sense even if I did create it by hand: /foo
is an array, and -
is interpreted as an object field called -
, which you can't use to index into an array array.
Also add a case covering creation with NextProperty. It'd return None, right?
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant build it up from tokens, rather than parsing, so that it's the NextIndex variant.
It's possible to build such a pointer and pass it to create, right? Let's cover that in the test.
…d a pointer to an object's `additionalProperties` shape. This flake was caught by quickcheck (only sometimes) and was causing Flow CI to intermittently fail.
23a6c3c
to
9864f9a
Compare
9864f9a
to
1ab6165
Compare
still lgtm! |
This flake was caught by quickcheck (only sometimes) and was causing Flow CI to intermittently fail.
The one thing I'm not confident on is calling this variant
AdditionalProperties
, since the variant for array'sadditionalItems
is calledToken::NextIndex
, notToken::AdditionalItems
. Thoughts @jgraettinger?This change is