schemars
schemars copied to clipboard
Generate JSON Schema documents from Rust code
In the current implementation at https://github.com/GREsau/schemars/blob/386e3d7f5ac601795fb4e247291bbef31512ded3/schemars/src/json_schema_impls/maps.rs only the `V` type is used, but `K` type is ignored. For example, `HashMap` gets a schema `{'type': 'object', 'additionalProperties': {'type': 'string'}}`, and `u32`...
Can you please consider adding support for [garde](https://github.com/jprochazk/garde) as an alternative to [validator](https://github.com/Keats/validator)? It’s better designed than validator. The reasons for starting a new project are mentioned in https://github.com/Keats/validator/issues/201.
Using schemars ver. 0.8.12, I noticed a compiler error ``` error[E0573]: expected type, found module `prefix_dest` --> src/models.rs:308:29 | 308 | #[serde(flatten, with = "prefix_dest")] | ^^^^^^^^^^^^^ not a type...
The example code included in the documentation gets included in the schema. It may be useful to toggle the ability to ignore this part of the documentation. ```rust /// Include...
When I enable `serde_json` feature "arbitrary_precision" in my project, I get schemas that look like ```yaml type: array minItems: $serde_json::private::Number: '3' items: $ref: '#/components/schemas/CartesianCoordinate' ``` It seems like this is...
Thank you for the great library. We are using `schemars` to develop a [tool](https://github.com/getsentry/json-schema-diff) that reports differences between two schemas. For our use case, it would be helpful if the...
This will allow arbitrary precision values to be valid. BREAKING CHANGE: the output JSON Schema for bigdecimal::BigDecimal type is now a string in addition of a number scalar. Addresses #123
Support creating more useful schemas for BitFlags types as define by the enumflags2 crate, by including the original enum in definitions. Also, add support for "x-enumNames" extension to JSON-Schema to...
In the following example with `skip_serializing_if`, results in the field still being listed as required. Example using `skip_serializing_if` ```rust use schemars::{schema_for, JsonSchema}; use serde::{Deserialize, Serialize}; #[derive(Deserialize, Serialize, JsonSchema)] pub struct...
I would like to traverse the RootSchema hierarchy (which I imagine as a tree) and print the paths to every node (from root to node). I cannot find the way...