-
Notifications
You must be signed in to change notification settings - Fork 639
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
schema.switch support in version 0.7.0-rc.3 #299
Comments
Ha, that explains a lot of confusion i had. IMO pickJsonSchemaProperties should be false by default, but i won't complain. |
I agree. The feature is just a historical remnant. I'll probably set the default to false or remove the feature alltogether at some point. |
Well, actually, before changing anything, i think something's wrong with ajv or with json-schema spec about additionalProperties and switch keywords. |
Did you reopen this by accident? Or is there something you wish to be changed in objection? |
so i thought this issue should stay open until that point ? Or not ! |
We should open a separate issue for that. This isn't very descriptive. |
Here's the schema i'm using:
It validates all right with ajv and that kind of data:
$afterValidate receives that json all right.
However, when inserting it using insertGraph method, it strips the
data
property.I have to modify the schema and declare "properties.data" to keep objection from pruning that column.
I suppose the problem comes from the "switch" clause, while objection only checks what's in the schema "properties".
Isn't there any way to abstract that second-guessing from objection and let all knowledge about schema be given by ajv ?
The text was updated successfully, but these errors were encountered: