Update docs and changelog
This commit is contained in:
parent
e259955809
commit
f9b14f7b00
2 changed files with 13 additions and 1 deletions
|
@ -32,6 +32,7 @@ Serde also allows setting `#[serde(...)]` attributes which change how types are
|
|||
1. [Other Attributes](#other-attributes)
|
||||
- [`schema_with`](#schema_with)
|
||||
- [`title` / `description`](#title-description)
|
||||
- [`example`](#example)
|
||||
- [`deprecated`](#deprecated)
|
||||
- [Doc Comments (`doc`)](#doc)
|
||||
|
||||
|
@ -157,11 +158,18 @@ Set on a variant or field to generate this field's schema using the given functi
|
|||
|
||||
<h3 id="title-description">
|
||||
|
||||
`#[schemars(title = "Some title", description = "Some description)]`
|
||||
`#[schemars(title = "Some title", description = "Some description")]`
|
||||
</h3>
|
||||
|
||||
Set on a container, variant or field to set the generated schema's `title` and/or `description`. If present, these will be used instead of values from any [`doc` comments/attributes](#doc).
|
||||
|
||||
<h3 id="example">
|
||||
|
||||
`#[schemars(example = "some::function")]`
|
||||
</h3>
|
||||
|
||||
Set on a container, variant or field to include the result of the given function in the generated schema's `examples`. The function should take no parameters and can return any type that implements serde's `Serialize` trait - it does not need to return the same type as the attached struct/field. This attribute can be repeated to specify multiple examples.
|
||||
|
||||
<h3 id="deprecated">
|
||||
|
||||
`#[deprecated]`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue