Rewrite attribute handling code (#330)

This commit is contained in:
Graham Esau 2024-08-27 16:50:47 +01:00 committed by GitHub
parent fb6bd6d439
commit d07a1be031
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 1195 additions and 1099 deletions

View file

@ -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>,

View file

@ -42,7 +42,7 @@
"anyOf": [
{
"type": "string",
"format": "phone"
"format": "email"
},
{
"type": "object",

View file

@ -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>,

View file

@ -19,7 +19,7 @@
"properties": {
"StringNewType": {
"type": "string",
"format": "phone"
"format": "email"
}
},
"additionalProperties": false,