{"repo":"GREsau/schemars","free":true,"listed":false,"github":"https://github.com/GREsau/schemars","clone":"git clone https://github.com/GREsau/schemars.git","description":"Generate JSON Schema documents from Rust code","language":"Rust","stars":1400,"topics":["json-schema","rust","serde"],"license":"MIT","category":"dev-tools","readme_excerpt":"Schemars Generate JSON Schema documents from Rust code Basic Usage For more detailed information, see the full API documentation on docs.rs, and the detailed usage documentation website. If you don't really care about the specifics, the easiest way to generate a JSON schema for your types is to #[derive(JsonSchema)] and use the schema for! macro. All fields of the type must also implement JsonSchema - Schemars implements this for many standard library types. Click to see the output JSON schema... Serde Compatibility One of the main aims of this library is compatibility with Serde. Any generated schema should match how serde json would serialize/deserialize to/from JSON. To support this, Schemars will check for any #[serde(...)] attributes on types that derive JsonSchema , and adjust the generated schema accordingly. Click to see the output JSON schema... #[serde(...)] attributes can be overriden using #[schemars(...)] attributes, which behave identically (e.g. #[schemars(rename all = \"camelCase\")] ). You may find this useful if you want to change the generated schema without affecting Serde's behaviour, or if you're just not using Serde. Schema from Example Value If you want a schema for a type that can't/doesn't implement JsonSchema , but does implement serde::Serialize , then you can generate a JSON schema from a value of that type. However, this schema will generally be less precise than if the type implemented JsonSchema - particularly when it involves enums, since schema","default_branch":null,"files":null,"tree":[],"storefront":"/r/GREsau","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/GREsau/schemars/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}