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.
The example at https://github.com/rustless/valico#json-schema has a few issues:
std::old_io::fswhich has been deprecated (std: Deprecate std::old_io::fs rust-lang/rust#22873)serialize::jsoninstead ofserde_json::json.When I try to run something very similar to it I get the following errors:
I've tried to figure out why this happens by looking at
scope.compile_and_returnbut as far as I can gather it's usingserde_json::Valueand notrustless::Value(which I can't find the definition for).I'm unable to get this working in anyway, so assistance/clarification very welcome.