Skip to content

Commit

Permalink
Update docs and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
GREsau committed May 17, 2020
1 parent 75419fa commit 61c106f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion docs/1.1-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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">

Expand Down

0 comments on commit 61c106f

Please sign in to comment.