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
Hey guys, I'm using the gem in my test environment, to validate my api responses, like this:
JSON::Validator.validate!("#{ Dir.pwd }/spec/support/api/schemas/product.json", JSON.parse(last_response.body), { strict: true, validate_schema: true })
I wanna clear the cache of schemas after each test, so i tried this way
JSON::Validator.validate!(schema_path, response.body, { strict: true, validate_schema: true, clear_cache: true })
but didn't work
Looking into source code, i was able to make this work by adding this line
@validation_options[:clear_cache] = true if @options[:clear_cache] == true
below this line: https://github.com/ruby-json-schema/json-schema/blob/master/lib/json-schema/validator.rb#L48
Please let me know if i'm trying to do this wrong.
Thanks.
The text was updated successfully, but these errors were encountered:
@tegon +1 Am also with the same mistake. Think this you commented would solve the problem.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Hey guys,
I'm using the gem in my test environment, to validate my api responses, like this:
I wanna clear the cache of schemas after each test, so i tried this way
but didn't work
Looking into source code, i was able to make this work by adding this line
below this line: https://github.com/ruby-json-schema/json-schema/blob/master/lib/json-schema/validator.rb#L48
Please let me know if i'm trying to do this wrong.
Thanks.
The text was updated successfully, but these errors were encountered: