Disable doctests for derive code snippets
This commit is contained in:
parent
2914a1b66a
commit
8438865588
2 changed files with 2 additions and 3 deletions
|
@ -296,7 +296,7 @@ Set the path to the schemars crate instance the generated code should depend on.
|
||||||
|
|
||||||
Sets properties specified by [validator attributes](#supported-validator-attributes) on items of an array schema. For example:
|
Sets properties specified by [validator attributes](#supported-validator-attributes) on items of an array schema. For example:
|
||||||
|
|
||||||
```rs
|
```rust
|
||||||
struct Struct {
|
struct Struct {
|
||||||
#[schemars(inner(url, regex(pattern = "^https://")))]
|
#[schemars(inner(url, regex(pattern = "^https://")))]
|
||||||
urls: Vec<String>,
|
urls: Vec<String>,
|
||||||
|
|
|
@ -17,8 +17,7 @@ use proc_macro2::TokenStream;
|
||||||
use syn::spanned::Spanned;
|
use syn::spanned::Spanned;
|
||||||
|
|
||||||
#[doc = "Derive macro for `JsonSchema` trait."]
|
#[doc = "Derive macro for `JsonSchema` trait."]
|
||||||
#[doc = include_str!("../deriving.md")]
|
#[cfg_attr(not(doctest), doc = include_str!("../deriving.md"), doc = include_str!("../attributes.md"))]
|
||||||
#[doc = include_str!("../attributes.md")]
|
|
||||||
#[proc_macro_derive(JsonSchema, attributes(schemars, serde, validate))]
|
#[proc_macro_derive(JsonSchema, attributes(schemars, serde, validate))]
|
||||||
pub fn derive_json_schema_wrapper(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
pub fn derive_json_schema_wrapper(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||||
let input = parse_macro_input!(input as syn::DeriveInput);
|
let input = parse_macro_input!(input as syn::DeriveInput);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue