schemars/docs/examples/4-custom_settings.md
Graham Esau b4f214f6dc
Remove usages of gen identifier (#323)
`gen` is a reserved keyword in rust 2024, making it very awkward to use as a module/variable name.
2024-08-21 16:15:13 +01:00

12 lines
465 B
Markdown

---
title: Custom Schema Settings
parent: Examples
nav_order: 4
summary: Generating a schema using custom settings which changes how Option<T> is handled.
---
# Custom Schema Settings
The `generate` module allows you to customise how schemas are generated. For example, the default behaviour for `Option<T>` is to include `null` in the schema's `type`s, but we can instead add a `nullable` property to its schema:
{% include example.md name="custom_settings" %}