Rewrite attribute handling code (#330)
This commit is contained in:
parent
fb6bd6d439
commit
d07a1be031
33 changed files with 1195 additions and 1099 deletions
|
@ -17,7 +17,7 @@ pub struct MyStruct {
|
|||
#[derive(Deserialize, Serialize, JsonSchema)]
|
||||
#[schemars(untagged)]
|
||||
pub enum MyEnum {
|
||||
StringNewType(#[schemars(phone)] String),
|
||||
StringNewType(#[schemars(email)] String),
|
||||
StructVariant {
|
||||
#[schemars(length(min = 1, max = 100))]
|
||||
floats: Vec<f32>,
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"format": "phone"
|
||||
"format": "email"
|
||||
},
|
||||
{
|
||||
"type": "object",
|
||||
|
|
|
@ -11,7 +11,7 @@ pub struct MyStruct {
|
|||
|
||||
#[derive(JsonSchema)]
|
||||
pub enum MyEnum {
|
||||
StringNewType(#[validate(phone)] String),
|
||||
StringNewType(#[validate(email)] String),
|
||||
StructVariant {
|
||||
#[validate(length(min = 1, max = 100))]
|
||||
floats: Vec<f32>,
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
"properties": {
|
||||
"StringNewType": {
|
||||
"type": "string",
|
||||
"format": "phone"
|
||||
"format": "email"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue