diff --git a/schema-general.json b/schema-general.json index 2458c7d..deb5cb0 100644 --- a/schema-general.json +++ b/schema-general.json @@ -97,7 +97,8 @@ "properties": { "directory": { "description": "Url for the directory", - "type": "uri" + "type": "string", + "format": "uri" }, "email_addresses": { "description": "Email addresses for the CA to contact the user", @@ -106,7 +107,8 @@ "null" ], "items": { - "type": "email" + "type": "string", + "format": "email" } }, "eab_token": { diff --git a/schema-site.json b/schema-site.json index 6c5719b..85c4220 100644 --- a/schema-site.json +++ b/schema-site.json @@ -27,7 +27,8 @@ "description": "EmailAdresses that this Certificate is valid for", "type": "array", "items": { - "type": "email" + "type": "string", + "format": "email" }, "default": [] }, @@ -140,7 +141,8 @@ "properties": { "directory": { "description": "Url for the directory", - "type": "uri" + "type": "string", + "format": "uri" }, "email_addresses": { "description": "Email addresses for the CA to contact the user", @@ -149,7 +151,8 @@ "null" ], "items": { - "type": "email" + "type": "string", + "format": "email" } }, "eab_token": { diff --git a/src/main.rs b/src/main.rs index d876c4a..cc62b0e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -205,7 +205,7 @@ fn serialize_with_formatter(value: &T, formatter: F) Ok(_) => {}, Err(error) => return Error::err(format!("Failed to Serialize the schema: {error}")), } - + store.push(b'\n'); Ok(unsafe { String::from_utf8_unchecked(store) }) } diff --git a/src/utils.rs b/src/utils.rs index 4d85c0e..94ec9fe 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -208,14 +208,14 @@ pub mod schema { if is_array(val) { if let Some(items) = schema.get("items") { let mut items = items.to_owned(); - items.as_object_mut().unwrap().insert("type".to_string(), typval); + items.as_object_mut().unwrap().insert("format".to_string(), typval); schema.insert("items".to_owned(), items); } else { schema.insert( "items".to_owned(), Value::Object({ let mut items = Map::with_capacity(1); - items.insert("type".to_owned(), typval); + items.insert("format".to_owned(), typval); items }), ); @@ -223,7 +223,7 @@ pub mod schema { return; } } - schema.insert("type".to_string(), typval); + schema.insert("format".to_string(), typval); } pub fn email_transform(schema: &mut Schema) {