You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"[{"name":"kids.$.name","type":"required","message":"Name is required"},{"name":"parents.$.name","type":"required","message":"Name is required"}]"
which I interpret as it expects the object to be full schema compatible, even though I think it should validate only against "Pet" schema.
I encountered this with Collections2, where it's very hard to add an element into a subdocument array when schema is complex. Basically only using $set to replace the full array seems to work.
Or do I get it wrong?
Thanks,
Jyrki
The text was updated successfully, but these errors were encountered:
I can't test it out right now, but by looking at it, it seems like a bug with the requirement check. I don't think our tests cover complex combinations of required props, so I'll add some similar tests and then make sure everything works. It might not be until early next week, though. Feel free to do a PR before then if you can fix it, but the validation logic is pretty complex and confusing to the uninitiated. :)
Hey @aldeed, I think I'm having this issue with 0.2.14. I can $set an entire array just fine, but when I try to $push a single item, validation fails with all the schema keys listed in invalidKeys()
If it will help, I'd be happy to provide you with an example, but I thought it might make sense to ping you first before taking that step
Hi, I have an issue which I think is a bug but it may also be my misunderstanding.
Here's my case. With schema as this:
Validation seems to work for non-array properties just as one could imagine:
Now, the last statement returns
which I interpret as it expects the object to be full schema compatible, even though I think it should validate only against "Pet" schema.
I encountered this with Collections2, where it's very hard to add an element into a subdocument array when schema is complex. Basically only using $set to replace the full array seems to work.
Or do I get it wrong?
Thanks,
Jyrki
The text was updated successfully, but these errors were encountered: