From 4f14c1a74cbf5d8b14c6be9649f93d1702eb9f2a Mon Sep 17 00:00:00 2001 From: Graham Esau Date: Mon, 15 Aug 2022 12:58:24 +0100 Subject: [PATCH] Update docs and changelog --- CHANGELOG.md | 3 +++ docs/1.1-attributes.md | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d45c397..9ba2569 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog ## **in-dev** +### Added: +- Replace auto-inferred trait bounds with bounds specified in `#[schemars(bound = "...")]` attribute + ### Changed: - Derived `JsonSchema` now respects attributes on unit enum variants (https://github.com/GREsau/schemars/pull/152) - Minimum supported rust version is now 1.45.0 diff --git a/docs/1.1-attributes.md b/docs/1.1-attributes.md index 32d6bd7..2904968 100644 --- a/docs/1.1-attributes.md +++ b/docs/1.1-attributes.md @@ -35,6 +35,7 @@ TABLE OF CONTENTS - [`skip_deserializing`](#skip_deserializing) - [`flatten`](#flatten) - [`with`](#with) + - [`bound`](#bound) 1. [Supported Validator Attributes](#supported-validator-attributes) - [`email` / `phone` / `url`](#email-phone-url) - [`length`](#length) @@ -160,6 +161,15 @@ Set on a newtype struct or a braced struct with one field to make the struct's g Serde docs: [container](https://serde.rs/container-attrs.html#transparent) +

+ +`#[schemars(bound = "...")]` +

+ +Where-clause for the JsonSchema impl. This replaces any trait bounds inferred by schemars. Schemars does **not** use trait bounds from `#[serde(bound)]` attributes. + +Serde docs: [container](https://serde.rs/container-attrs.html#bound) + ## Supported Validator Attributes