Add #[schemars(inner(...)] attribute to specify schema for array items (#234)
This commit is contained in:
parent
30e513ac14
commit
a5e51b22b3
11 changed files with 231 additions and 60 deletions
|
@ -276,6 +276,20 @@ Set the Rust built-in [`deprecated`](https://doc.rust-lang.org/edition-guide/rus
|
|||
|
||||
Set the path to the schemars crate instance the generated code should depend on. This is mostly useful for other crates that depend on schemars in their macros.
|
||||
|
||||
<h3 id="inner">
|
||||
|
||||
`#[schemars(inner(...))]`
|
||||
</h3>
|
||||
|
||||
Sets properties specified by [validator attributes](#supported-validator-attributes) on items of an array schema. For example:
|
||||
|
||||
```rs
|
||||
struct Struct {
|
||||
#[schemars(inner(url, regex(pattern = "^https://")))]
|
||||
urls: Vec<String>,
|
||||
}
|
||||
```
|
||||
|
||||
<h3 id="doc">
|
||||
|
||||
Doc Comments (`#[doc = "..."]`)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue