While using the Rust Playground, I noticed that a dependency was missing a feature I needed:
extern crate schemars; // 1.2.3 use schemars::JsonSchema; #[derive(JsonSchema)] pub struct MyStruct; error: cannot find derive macro `JsonSchema` in this scope --> src/lib.rs:5:10 | 5 | #[derive(JsonSchema)] | ^^^^^^^^^^ | note: `JsonSchema` is a trait, not a derive macro --> /playground/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/schemars-1.2.3/src/lib.rs:136:1 | 136 | pub trait JsonSchema { | ^^^^^^^^^^^^^^^^^^^^ = help: consider implementing `JsonSchema` for your type manually error: could not compile `playground` (lib) due to 1 previous error This is because the derive feature is missing. Are the Playground's default dependencies preconfigured? If so, it would be worth looking into which features are most commonly used.
4 posts - 4 participants

