diff --git a/README.md b/README.md index 22e29b9..3e73078 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Work in progress! ## Basic Usage -If you don't really care about the specifics, the easiest way to generate a JSON schema for you types is to `#[derive(JsonSchema)]` and use the `schema_for!` macro: +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. ```rust use schemars::{schema_for, JsonSchema}; @@ -93,7 +93,7 @@ fn main() { ### Serde Compatibility -One of the main aims of this library is compatibility with [serde](https://github.com/serde-rs/serde). Any generated schema *should* match how [serde_json](https://github.com/serde-rs/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. +One of the main aims of this library is compatibility with [Serde](https://github.com/serde-rs/serde). Any generated schema *should* match how [serde_json](https://github.com/serde-rs/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. ```rust use schemars::{schema_for, JsonSchema}; @@ -170,18 +170,11 @@ fn main() { ``` -`#[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, or if you're just not using Serde. +`#[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. ## Feature Flags - `chrono` - implements `JsonSchema` for all [Chrono](https://github.com/chronotope/chrono) types which are serializable by Serde. - `derive_json_schema` - implements `JsonSchema` for Schemars types themselves ## Customizing Schema Generation -TODO document! - -## TODO -- Documentation -- Benchmark/optimise memory usage and allocations - - Note to self: https://crates.io/crates/graphannis-malloc_size_of looks useful -- Implement `JsonSchema` for more standard library types -- Allow deriving `JsonSchema` for adjacent tagged enums +TODO document this!