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

JSON Schema example no longer works #25

Open
ErikBjare opened this issue Feb 25, 2017 · 1 comment
Open

JSON Schema example no longer works #25

ErikBjare opened this issue Feb 25, 2017 · 1 comment

Comments

@ErikBjare
Copy link

ErikBjare commented Feb 25, 2017

The example at https://github.com/rustless/valico#json-schema has a few issues:

When I try to run something very similar to it I get the following errors:

error[E0308]: mismatched types
  --> main.rs:82:49
   |
82 |     let event_schema = scope.compile_and_return(event_schema_json.clone(), true).ok().unwrap();
   |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^ expected enum `rustless::Value`, found enum `serde_json::Value`
   |
   = note: expected type `rustless::Value`
              found type `serde_json::Value`

error[E0308]: mismatched types
  --> main.rs:83:52
   |
83 |     println!("Is valid: {}", event_schema.validate(&event_schema_json).is_valid());
   |                                                    ^^^^^^^^^^^^^^^^^^ expected enum `rustless::Value`, found enum `serde_json::Value`
   |
   = note: expected type `&rustless::Value`
              found type `&serde_json::Value`

I've tried to figure out why this happens by looking at scope.compile_and_return but as far as I can gather it's using serde_json::Value and not rustless::Value (which I can't find the definition for).

I'm unable to get this working in anyway, so assistance/clarification very welcome.

@maroux
Copy link

maroux commented Jul 3, 2019

Looks like the example has been updated and this should be closed?

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