Skip to content
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

Handle items: [{ $ref }] #734

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Handle items: [{ $ref }] #734

wants to merge 2 commits into from

Conversation

rtkevin
Copy link

@rtkevin rtkevin commented Aug 15, 2024

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

added test that fails in current master and does not fail in patch.

Signed-off-by: rtkevin <kevin@rtvision.com>
Signed-off-by: rtkevin <kevin@rtvision.com>
functionCode += `value = obj[${i}]`
const tmpRes = buildValue(context, itemsLocation.getPropertyLocation(i), 'value')
const tmpRes = buildValue(context, itemLocation, 'value')
Copy link
Member

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?

Copy link
Author

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 }.

Copy link
Author

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.

@kalvenschraut
Copy link

@climba03003 @ivan-tymoshenko
Any thoughts or path forward for this issue? We are currently maintaining a patch with this fix. Open to really any direction as we provided our test case where we were experiencing the problem. LMK if you need anything more from us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants