schemars
schemars copied to clipboard
Generate JSON Schema documents from Rust code
## Preface My original problem was that the schema derived for the following ```rust struct ValueMap { foo: String, #[serde(flatten)] bar: HashMap, } ``` contains both `properties: {…}` and `additionalProperties:...
I want to derive `JsonSchema` for `Graph`, here is the definition of `Graph`: ``` pub struct Graph { nodes: Vec, edges: Vec, ty: PhantomData, } ``` Here, the `Node`, `Edge`,...
Should or should we not change the default parsing behavior from the current (removing single `\n` in RustDoc) to just leaving the newline in. To clarify for everyone we are...
Follow-up from #142, to make upgrading semver-incompatible versions of optional dependencies easier > It's probably worth taking a look at the other optional dependencies, judging whether they're likely to have...
The fix for #115 made it so that the `#[serde(default)]` annotation doesn't generate a build error when the type of the field to which the annotation is applied is not...
Rocket uses [`Date`](https://docs.rs/time/0.2.26/time/date/struct.Date.html) and [`Time`](https://docs.rs/time/0.2.26/time/time_mod/struct.Time.html) as shown here https://docs.rs/rocket/0.5.0-rc.1/rocket/form/trait.FromFormField.html#impl-FromFormField%3C%27v%3E-for-Date in it internal implementations and exposes them to be used. Schemars does not implement `JsonSchema` for them yet. But note that...
I was very pleased to see that schemars already includes code comments in the generated schemas. I mainly use schemars to improve the IDE experience, so this is really great....
I have been using `#[derive(JsonSchema)]`, but recently ran into issues attempting to use serde's field attributes and the `serde_with` crate in order to report an error on duplicate keys in...
It is sometimes necessary to have either phantom types or special bounds for types for the structs. `serde` supports supplying custom bounds on these types so that the derived instance...
Hi! This is a fairly basic implementation to have `#[serde(alias = "foo")]` result in additional enum variants in the generated schema. I would be happy to make this configurable via...