on-internet
← Community

How to pass file path to jsonschema compile validator macro?

Stack Overflow ·

How to create a compile time json schema validator by passing path to the schema file using jsonschema compile time validator macro? main.rs use const_format::formatcp; #[jsonschema::validator(path = formatcp!("{}/../schemas/schema.json", std::env!("CARGO_MANIFEST_DIR")))] struct SchemaValidator; Cargo.toml const_format = "0.2.37" jsonschema = { version = "0.61", default-features = false, features = ["macros"] } Error error[E0277]: the trait bound `CompactFormatter: Default` is not satisfied --> /home/harry/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/jsonschema-0.61.2/src/canonical/js

Comments

Sign in or sign up to comment and upvote.

No comments yet.