-
-
Notifications
You must be signed in to change notification settings - Fork 206
Handle items: [{ $ref }] #734
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: rtkevin <kevin@rtvision.com>
Signed-off-by: rtkevin <kevin@rtvision.com>
index.js
Outdated
| } | ||
| functionCode += `value = obj[${i}]` | ||
| const tmpRes = buildValue(context, itemsLocation.getPropertyLocation(i), 'value') | ||
| const tmpRes = buildValue(context, itemLocation, 'value') |
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.
Shouldn't buildValue itself will resolve $ref?
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.
Maybe, I only looked into the code enough to fix the problem with minimal changes. But my problem wasn't with buildValue, it was that buildArrayTypeCondition was given item.type which was undefined since item was still {$ref }.
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 only changed the buildValue line to use the itemLocation I defined above so that it wouldn't need to do the itemsLocation.getPropertyLocation(i) a second time.
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.
buildValue can resolve it but the code needs item to be resolved outside of buildValue for the buildArrayTypeCondition call below. I started looking into this a bit more after the latest release as we currently are maintaining a patch of this fix.
|
@climba03003 @ivan-tymoshenko |
|
not sure who can give some feedback on this but my company has been forced to maintain a patch and with the last update I had to re-update it since had to fix two areas instead of one per my last commit on this PR. I looked into one of the questions on the review comment with a response and we have a test case that shows the problem we are trying to solve so is there anything we can do to help push this through or something similar to resolve our test case? |
|
@kalvenschraut |
|
@climba03003 thanks for looking at this again! linting issues are fixed |
Need to resolveRef here else buildArrayTypeCondition is given undefined item.type and returns undefined, which is falsy so throws the Item at i does not match schema definition error.
Checklist
npm run testandnpm run benchmarkand the Code of conduct
added test that fails in current master and does not fail in patch.