Skip to content

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>
index.js Outdated
}
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.

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.

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

@kalvenschraut
Copy link

@mcollina @climba03003 @Eomm

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?

@climba03003
Copy link
Member

climba03003 commented Feb 3, 2026

@kalvenschraut
I believe the fix can be landed after fixing the linting error.

@kalvenschraut
Copy link

@climba03003 thanks for looking at this again!

linting issues are fixed

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.

4 participants