-
Notifications
You must be signed in to change notification settings - Fork 4
W-13157845: upgrade to AMF 5.3.0 #442
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
Conversation
} else if (!(shape instanceof NilShape)) { | ||
return false; |
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 truly don't remember why this was here
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.
what I understand is that it was used for checking that the the union is of array shapes only (including nil), so if there was a shape that was not an array or nil, then you stop the search and return false.
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.
That being said, I don't think this code does the same, because if it is a union of an ArrayShape and a NodeShape, it will return true anyway because matches "any match", 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.
The original idea of hasAnArrayVariant
was that:
// Let's imagine we have a parseType function
// Null doesn't have an array variant
assertFalse(hasAnArrayVariant(parseType("nil")));
assertFalse(hasAnArrayVariant(parseType("nil | nil")));
assertFalse(hasAnArrayVariant(parseType("nil | nil | null")));
// Unions of arrays have an array variant
assertTrue(hasAnArrayVariant(parseType("String[] | Integer[]")));
assertTrue(hasAnArrayVariant(parseType("Integer[] | String[]")));
// Null is ignored in unions of arrays
assertTrue(hasAnArrayVariant(parseType("String[] | Integer[] | nil")));
assertTrue(hasAnArrayVariant(parseType("String[] | nil | Integer[]")));
assertTrue(hasAnArrayVariant(parseType("nil | String[] | Integer[]")));
assertTrue(hasAnArrayVariant(parseType("Integer[] | String[] | nil")));
assertTrue(hasAnArrayVariant(parseType("Integer[] | nil | String[]")));
assertTrue(hasAnArrayVariant(parseType("nil | Integer[] | String[]")));
// Any other type is not ignored in unions of arrays
assertFalse(hasAnArrayVariant(parseType("string | Integer[] | String[]")));
assertFalse(hasAnArrayVariant(parseType("Integer[] | string | String[]")));
assertFalse(hasAnArrayVariant(parseType("Integer[] | String[] | string")));
Why was it like that?
I don't remember
I'll try to remember 🤷
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.
yep, trying to figured out why
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 think it was related to which parameters may or may not be repeatable.
I would test against a parameters with type Integer | String[]
, Integer | Integer[]
and String[] | Integer
, etc and see which validations they trigger (or don't trigger) when passed on query params, json bodies and form-data.
Also... a lot of work to try out all that 😪
"expression":{ | ||
"language":"text/fhirpath", | ||
"name":"Telemedicine Visit" | ||
"resource": { |
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.
This was something that AMF starts validating correctly
No description provided.