diff --git a/docs-rs-custom.css b/docs-rs-custom.css new file mode 100644 index 0000000..a7807d8 --- /dev/null +++ b/docs-rs-custom.css @@ -0,0 +1,4 @@ +/* Hide the `[!NOTE] This branch...` alert at the top of the README, as it's only applicable to users on GitHub */ +h2#schemars + blockquote { + display: none; +} diff --git a/schemars/Cargo.toml b/schemars/Cargo.toml index 055c010..e8ead19 100644 --- a/schemars/Cargo.toml +++ b/schemars/Cargo.toml @@ -104,3 +104,4 @@ required-features = ["rust_decimal1", "bigdecimal04"] [package.metadata.docs.rs] all-features = true +rustdoc-args = ["--extend-css", "docs-rs-custom.css "] diff --git a/schemars/src/gen.rs b/schemars/src/gen.rs index f6553eb..5c1d77c 100644 --- a/schemars/src/gen.rs +++ b/schemars/src/gen.rs @@ -351,7 +351,7 @@ impl SchemaGenerator { /// Generates a JSON Schema for the given example value. /// - /// If the value implements [`JsonSchema`](crate::JsonSchema), then prefer using the [`root_schema_for()`](Self::root_schema_for()) + /// If the value implements [`JsonSchema`], then prefer using the [`root_schema_for()`](Self::root_schema_for()) /// function which will generally produce a more precise schema, particularly when the value contains any enums. /// /// If the `Serialize` implementation of the value decides to fail, this will return an [`Err`]. @@ -382,7 +382,7 @@ impl SchemaGenerator { /// Consumes `self` and generates a JSON Schema for the given example value. /// - /// If the value implements [`JsonSchema`](crate::JsonSchema), then prefer using the [`into_root_schema_for()!`](Self::into_root_schema_for()) + /// If the value implements [`JsonSchema`], then prefer using the [`into_root_schema_for()!`](Self::into_root_schema_for()) /// function which will generally produce a more precise schema, particularly when the value contains any enums. /// /// If the `Serialize` implementation of the value decides to fail, this will return an [`Err`]. diff --git a/schemars/src/lib.rs b/schemars/src/lib.rs index afe49d1..c0c316a 100644 --- a/schemars/src/lib.rs +++ b/schemars/src/lib.rs @@ -11,9 +11,7 @@ mod macros; /// outside of `schemars`, and should not be considered part of the public API. #[doc(hidden)] pub mod _private; -/// Types for generating JSON schemas. pub mod gen; -/// Types for defining modifications to JSON schemas. pub mod transform; #[cfg(feature = "schemars_derive")] @@ -141,7 +139,7 @@ pub trait JsonSchema { /// Generates a JSON Schema for this type. /// /// If the returned schema depends on any [non-inlined](JsonSchema::always_inline_schema) schemas, then this method will - /// add them to the [`SchemaGenerator`](SchemaGenerator)'s schema definitions. + /// add them to the [`SchemaGenerator`]'s schema definitions. /// /// This should not return a `$ref` schema. fn json_schema(gen: &mut SchemaGenerator) -> Schema; diff --git a/schemars/src/macros.rs b/schemars/src/macros.rs index e327284..0de7117 100644 --- a/schemars/src/macros.rs +++ b/schemars/src/macros.rs @@ -1,4 +1,5 @@ -/// Generates a [`RootSchema`](crate::schema::RootSchema) for the given type using default settings. +/// Generates a [`Schema`](crate::Schema) for the given type using default settings. +/// The default settings currently conform to [JSON Schema 2020-12](https://json-schema.org/specification-links#2020-12), but this is liable to change in a future version of Schemars if support for other JSON Schema versions is added. /// /// The type must implement [`JsonSchema`](crate::JsonSchema). ///