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

[minor feature] Show undefined props that break schema better #403

Closed
natew opened this issue Dec 13, 2017 · 1 comment
Closed

[minor feature] Show undefined props that break schema better #403

natew opened this issue Dec 13, 2017 · 1 comment

Comments

@natew
Copy link
Contributor

natew commented Dec 13, 2017

Case

let things = await Rx.Collection({ schema: { title: { type: 'string' } } })
things.insert({
   title: 'passesvalue',
   body: undefined
})

Issue

This will throw an error thats a bit confusing. In my case body doesn't exist on schema, notice it's undefined but in the error message you don't see that:

image

Because it doesn't show in the error the undefined it looks like the object should pass the schema.

Proposed solution would just be sure to log out the undefined value that causes it to fail.

@pubkey pubkey closed this as completed in 41f5d15 Dec 13, 2017
@pubkey
Copy link
Owner

pubkey commented Dec 13, 2017

Hi @natew
There is no undefined-value in json. I now transform fields with undefined to null to ensure the field is not denied in the error-message.

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

No branches or pull requests

2 participants