Closed xjamundx closed 3 months ago
Yes, indeed. getTemplate
is used on your input data. With minItems
set to 3 it creates data according to your schema. This should not happen on validate
.
Which version are you using?
I found the issue in lib/features/allOf.ts
. Unsure why this is done. Will fix this.
Thank you so much for the report!
The issue has been fixed with json-schema-library@9.3.2
.
Can you verify that this solves your issue?
Thank you so much will give this a shot tomorrow 🙏🏻
Definitely fixes it, thanks 🙏🏻
This is a weird one....but....if I freeze an array in the values under certain conditions (you have an array AND allOf must exist), it will throw an error.
And wildly if you don't freeze the array, it just fills it up with an empty string for the number of items are set with
minItems
. What a good time!I think the error is happening here, but haven't had time to look into it yet: https://github.com/sagold/json-schema-library/blob/b49f741f4163d9e628a8234a12a6708c020b1861/lib/getTemplate.ts#L362