We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
My schema definition is defined as the following:
SCHEMA = { "type": "object", "required": [ "type_of_formative_quiz", "email_notification", "email_notification_tutorial_taken", "email_notification_quiz_completed", "email_notification_question_missed", ], "properties": { "type_of_formative_quiz": { "type": "string", "enum": ["practice", "graded"], }, 'formative_quiz_passing_score': { "type": "number", "minimum": 0, "maximum": 100, }, 'will_have_summative_quiz': { "type": "boolean", }, 'completion_required_for_summative_quiz': { "type": "boolean", }, 'summative_quiz_passing_score': { "type": "number", "minimum": 0, "maximum": 100, }, 'email_notification': { "type": "boolean", }, 'email_notification_tutorial_taken': { "type": "boolean", }, 'email_notification_quiz_completed': { "type": "boolean", }, 'email_notification_question_missed': { "type": "boolean", }, 'missed_question_threshold_type': { "type": "string", "enum": ["percentage", "people"], }, 'missed_question_threshold': { "type": "number", "minimum": 0, "maximum": 100, }, }, "dependencies": { "will_have_summative_quiz": { "required": [ "completion_required_for_summative_quiz", "summative_quiz_passing_score" ], }, }, }
I am doing the following:
schemer = JSONSchemer.schema(SCHEMA) pp schemer.validate({'abc': 'def'}).to_a
The output is blank array. => []
=> []
It should thorw the errors as required keys are missing. It works fine as described in the example on README. What am I doing wrong?
The text was updated successfully, but these errors were encountered:
The keys in your schema (and data) are symbols, which won't work currently.
> {'abc': 'def'} => {:abc=>"def"}
You should get the error you expect if you switch to string keys.
I'm going to leave this issue open because it's an easy mistake to make and there should at least be an error when passing schemas with symbol keys.
Sorry, something went wrong.
b014aba
No branches or pull requests
My schema definition is defined as the following:
I am doing the following:
The output is blank array.
=> []
It should thorw the errors as required keys are missing. It works fine as described in the example on README. What am I doing wrong?
The text was updated successfully, but these errors were encountered: