Add example for schemars attributes

This commit is contained in:
Graham Esau 2019-12-26 22:20:53 +00:00
parent 601fc3aaad
commit b11536e527
7 changed files with 175 additions and 2 deletions

View file

@ -1,13 +0,0 @@
---
layout: default
title: Custom Schema Settings
parent: Examples
nav_order: 3
summary: Generating a schema using custom settings which changes how Option<T> is handled.
---
# Custom Schema Settings
The `gen` 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" %}