diff --git a/CHANGELOG.md b/CHANGELOG.md index 631d3cbb3..739b836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/1.1-attributes.md b/docs/1.1-attributes.md index 6c509d9..99ea370 100644 --- a/docs/1.1-attributes.md +++ b/docs/1.1-attributes.md @@ -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`. +