Update docs
This commit is contained in:
parent
cb26e783dc
commit
93435d519a
5 changed files with 23 additions and 5 deletions
|
@ -200,7 +200,7 @@ println!("{}", serde_json::to_string_pretty(&schema).unwrap());
|
|||
|
||||
`#[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 Values
|
||||
### 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 schemars will not make any assumptions about the structure of an enum based on a single variant.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue