schemars/docs/examples/3-schemars_attrs.md
2019-12-26 22:20:53 +00:00

13 lines
532 B
Markdown

---
layout: default
title: Using Schemars Attributes
parent: Examples
nav_order: 3
summary: 'Deriving JsonSchema on types that use #[schemars] attributes to customise serialization behaviour.'
---
# Using Serde Attributes
`#[serde(...)]` attributes can be overriden (or replaced) with `#[schemars(...)]` attributes, which behave identically. You may find this useful if you want to change the generated schema without affecting Serde's behaviour, or if you're just not using Serde.
{% include example.md name="schemars_attrs" %}