Add separate docs for v0.8/v1

This commit is contained in:
Graham Esau 2024-06-09 19:01:24 +01:00
parent 3150f98fc8
commit d511d447f7
61 changed files with 1620 additions and 58 deletions

View file

@ -0,0 +1,14 @@
---
title: Using Serde Attributes
parent: Examples
nav_order: 2
summary: "Deriving JsonSchema on types that use #[serde] attributes to customise serialization behaviour."
---
# Using Serde Attributes
One of the main aims of this library is compatibility with [Serde](https://github.com/serde-rs/serde). Any generated schema _should_ match how [serde_json](https://github.com/serde-rs/json) would serialize/deserialize to/from JSON. To support this, Schemars will check for any `#[serde(...)]` attributes on types that derive `JsonSchema`, and adjust the generated schema accordingly.
The list of supported `#[serde]` attributes are [documented here]({{ site.baseurl }}{% link 1.1-attributes.md %}#supported-serde-attributes).
{% include example_v0.md name="serde_attrs" %}