schemars/docs/examples/6-doc_comments.md
2019-12-28 15:38:41 +00:00

726 B

layout title parent nav_order summary
default Doc Comments Examples 5 Giving schemas a custom title and/or description using doc comments.

Setting a Custom Title and/or Description Using Doc Comments

If a struct, variant or field has any doc comments (or doc attributes), then these will be used as the generated schema's description. If the first line is an ATX-style markdown heading (i.e. it begins with a # character), then it will be used as the schema's title, and the remaining lines will be the description.

{% include example.md name="doc_comments" %}