Add docs permalinks

This commit is contained in:
Graham Esau 2019-12-26 14:35:34 +00:00
parent 938d273d42
commit 64b0f79851
8 changed files with 9 additions and 3 deletions

View file

@ -4,6 +4,7 @@ title: Deriving JsonSchema
nav_order: 2 nav_order: 2
has_children: true has_children: true
has_toc: false has_toc: false
permalink: /deriving
--- ---
# Deriving JsonSchema # Deriving JsonSchema

View file

@ -3,6 +3,7 @@ layout: default
title: Attributes title: Attributes
parent: Deriving JsonSchema parent: Deriving JsonSchema
nav_order: 1 nav_order: 1
permalink: /deriving/attributes
--- ---
<style> <style>
@ -40,7 +41,7 @@ Serde also allows setting `#[serde(...)]` attributes which change how types are
`#[serde(rename = "name")]` / `#[schemars(rename = "name")]` `#[serde(rename = "name")]` / `#[schemars(rename = "name")]`
</h3> </h3>
Set on a struct, enum, field or variant to use the given name in the generated schema instead of the Rust name. When used on a struct or enum, the given name will be used as the title for root schemas, and as the schema identifier for schemas referenced from another schema's `$ref` property. Set on a struct, enum, field or variant to use the given name in the generated schema instead of the Rust name. When used on a struct or enum, the given name will be used as the title for root schemas, and the key within the root's `definitions` property for subschemas.
If set on a struct or enum with generic type parameters, then the given name may contain them enclosed in curly braces (e.g. `{T}`) and they will be replaced with the concrete type names when the schema is generated. If set on a struct or enum with generic type parameters, then the given name may contain them enclosed in curly braces (e.g. `{T}`) and they will be replaced with the concrete type names when the schema is generated.

View file

@ -2,6 +2,7 @@
layout: default layout: default
title: Implementing JsonSchema title: Implementing JsonSchema
nav_order: 3 nav_order: 3
permalink: /implementing
--- ---
# Implementing JsonSchema # Implementing JsonSchema

View file

@ -2,6 +2,7 @@
layout: default layout: default
title: Generating Schemas title: Generating Schemas
nav_order: 4 nav_order: 4
permalink: /generating
--- ---
# Generating Schemas # Generating Schemas

View file

@ -2,6 +2,7 @@
layout: default layout: default
title: Feature Flags title: Feature Flags
nav_order: 5 nav_order: 5
permalink: /features
--- ---
# Feature Flags and Optional Dependencies # Feature Flags and Optional Dependencies

View file

@ -1,5 +1,5 @@
--- ---
permalink: /404.html permalink: /404
layout: default layout: default
nav_exclude: true nav_exclude: true
--- ---

View file

@ -3,6 +3,7 @@ layout: default
title: Examples title: Examples
nav_order: 6 nav_order: 6
has_children: true has_children: true
permalink: /examples
--- ---
# Examples # Examples

View file

@ -231,7 +231,7 @@ pub trait JsonSchema {
/// The name of the generated JSON Schema. /// The name of the generated JSON Schema.
/// ///
/// This is used as the title for root schemas, and the key within the `definitions` property for subschemas. /// This is used as the title for root schemas, and the key within the root's `definitions` property for subschemas.
fn schema_name() -> String; fn schema_name() -> String;
/// Generates a JSON Schema for this type. /// Generates a JSON Schema for this type.