Update docs and changelog
This commit is contained in:
parent
75419fa3d5
commit
61c106fd5b
2 changed files with 12 additions and 2 deletions
|
@ -2,7 +2,8 @@
|
|||
## In-dev - version TBC
|
||||
### Added:
|
||||
- Setting `#[deprecated]` attribute will now cause generated schemas to have the `deprecated` property set to `true`
|
||||
- Respect #[serde(transparent)] attribute (https://github.com/GREsau/schemars/issues/17)
|
||||
- Respect `#[serde(transparent)]` attribute (https://github.com/GREsau/schemars/issues/17)
|
||||
- `#[schemars(title = "...", description = "...")]` can now be used to set schema title/description. If present, these values will be used instead of doc comments (https://github.com/GREsau/schemars/issues/13)
|
||||
|
||||
### Changed:
|
||||
- schemars_derive is now an optional dependency, but included by default
|
||||
|
|
|
@ -31,6 +31,8 @@ Serde also allows setting `#[serde(...)]` attributes which change how types are
|
|||
- [`with`](#with)
|
||||
1. [Other Attributes](#other-attributes)
|
||||
- [`schema_with`](#schema_with)
|
||||
- [`title` / `description`](#title-description)
|
||||
- [`deprecated`](#deprecated)
|
||||
- [Doc Comments (`doc`)](#doc)
|
||||
|
||||
## Supported Serde Attributes
|
||||
|
@ -153,12 +155,19 @@ Serde docs: [container](https://serde.rs/container-attrs.html#transparent)
|
|||
|
||||
Set on a variant or field to generate this field's schema using the given function. This function must be callable as `fn(&mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema`.
|
||||
|
||||
<h3 id="title-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="deprecated">
|
||||
|
||||
`#[deprecated]`
|
||||
</h3>
|
||||
|
||||
Set the Rust build-in [`deprecated`](https://doc.rust-lang.org/edition-guide/rust-2018/the-compiler/an-attribute-for-deprecation.html) attribute on a struct, enum, field or variant to set the generated schema's `deprecated` keyword to `true`.
|
||||
Set the Rust built-in [`deprecated`](https://doc.rust-lang.org/edition-guide/rust-2018/the-compiler/an-attribute-for-deprecation.html) attribute on a struct, enum, field or variant to set the generated schema's `deprecated` keyword to `true`.
|
||||
|
||||
<h3 id="doc">
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue