You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the crate, I've started using this to reimplement the tests in schemars to validate its outputs, and doing so has already revealed a few schemars bugs!
I also stumbled upon this odd case though - full repro:
use jsonschema::{Draft,JSONSchema};use serde_json::json;fnmain(){let schema = JSONSchema::options().with_draft(Draft::Draft202012).compile(&json!({"$schema":"https://json-schema.org/draft/2020-12/schema","allOf":[{}],"oneOf":[{"properties":{"blah":true}}],"unevaluatedProperties":false})).unwrap();let value = json!({"blah":1});println!("Is valid: {}, validate is OK: {}",
schema.is_valid(&value),
schema.validate(&value).is_ok());}
I believe that schema is functionally equivalent to
So I'd expect the output to be Is valid: true, validate is OK: true, but it's actually Is valid: false, validate is OK: true. i.e. validate correctly passes validation, but is_valid fails it for some reason
The text was updated successfully, but these errors were encountered:
Thanks for the crate, I've started using this to reimplement the tests in schemars to validate its outputs, and doing so has already revealed a few schemars bugs!
Thanks for the crate, I've started using this to reimplement the tests in schemars to validate its outputs, and doing so has already revealed a few schemars bugs!
I also stumbled upon this odd case though - full repro:
I believe that schema is functionally equivalent to
So I'd expect the output to be
Is valid: true, validate is OK: true
, but it's actuallyIs valid: false, validate is OK: true
. i.e.validate
correctly passes validation, butis_valid
fails it for some reasonThe text was updated successfully, but these errors were encountered: