-
Notifications
You must be signed in to change notification settings - Fork 10
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 name annotation lookup logic and handle union as member type of array value #25
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.
@prakanth97 I don't see any test source changes along with the fix, so I assume this is something we've missed to cover in the module's test suite.
So wouldn't it be better to add a test case to cover the fixed scenario?
record.put(bKeyName, ValueCreator.createArrayValue(value.toArray(), | ||
TypeCreator.createArrayType(Constants.JSON_ARRAY_TYPE))); | ||
} | ||
} |
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 guess we need to handle element being a Intersection scenario as well.
@Namespace {prefix: "ex1", uri: "example1.com"} | ||
type Ex1_Reply record { | ||
@Namespace {prefix: "ex1", uri: "example1.com"} | ||
string Address; |
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.
Shall we add a another test where this attribute being another record?
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, we need to add more test covering Union and intersection.
for (int i = 0; i < arrayValue.getLength(); i++) { | ||
Object element = arrayValue.get(i); | ||
Type actualElementType = getTypeFromUnionType(elementType, element); | ||
if (actualElementType.getTag() == TypeTags.RECORD_TYPE_TAG) { |
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.
if the expected type is TypeTags.MAP_TYPE_TAG, this behaviour should be same ryt?
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.
Lets address the suggestions in another PR.
This PR is not valid since it handles specific union type case for |
Purpose
Fixes: #6689
Examples
Checklist