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

SimpleSchema validation succeeds but on insert fails with keyNotInSchema fro SubSchema #367

Open
WilliamT-Streamba opened this issue Dec 13, 2017 · 2 comments

Comments

@WilliamT-Streamba
Copy link

I have a schema which references a sub schema.

When I validate the schema manually with SimpleSchema.validate it succeeds. However, when I try and insert the item it fails saying the keys of the sub schema are not valid.

The exact same code works in another project. The only difference is this is based off a package based architecture so the attachSchema code is inside a package that is imported into the project.

Any suggestions of where to look for the cause?

I've checked that the sub schema is part of the schema when it is attached to the collection.

@aldeed
Copy link
Collaborator

aldeed commented Feb 2, 2018

You would need to post a link to a simple app that reproduces this. Hard to say without seeing the whole setup.

@janKir
Copy link

janKir commented May 2, 2018

I'm facing the same issue. In my case, it seems like a field (which itself is a nested SimpleSchema object) is wiped out during cleaning, and then the insert validation fails with Error: <field> is required in <collection> insert. Though, if I validate the object manually, the validation succeeds.

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

No branches or pull requests

4 participants