fixed the schema

Dieser Commit ist enthalten in:
Sebastian Tobie 2025-06-15 08:54:07 +02:00
Ursprung 4cb07326a7
Commit 034d69fd39
4 geänderte Dateien mit 14 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -97,7 +97,8 @@
"properties": { "properties": {
"directory": { "directory": {
"description": "Url for the directory", "description": "Url for the directory",
"type": "uri" "type": "string",
"format": "uri"
}, },
"email_addresses": { "email_addresses": {
"description": "Email addresses for the CA to contact the user", "description": "Email addresses for the CA to contact the user",
@ -106,7 +107,8 @@
"null" "null"
], ],
"items": { "items": {
"type": "email" "type": "string",
"format": "email"
} }
}, },
"eab_token": { "eab_token": {

Datei anzeigen

@ -27,7 +27,8 @@
"description": "EmailAdresses that this Certificate is valid for", "description": "EmailAdresses that this Certificate is valid for",
"type": "array", "type": "array",
"items": { "items": {
"type": "email" "type": "string",
"format": "email"
}, },
"default": [] "default": []
}, },
@ -140,7 +141,8 @@
"properties": { "properties": {
"directory": { "directory": {
"description": "Url for the directory", "description": "Url for the directory",
"type": "uri" "type": "string",
"format": "uri"
}, },
"email_addresses": { "email_addresses": {
"description": "Email addresses for the CA to contact the user", "description": "Email addresses for the CA to contact the user",
@ -149,7 +151,8 @@
"null" "null"
], ],
"items": { "items": {
"type": "email" "type": "string",
"format": "email"
} }
}, },
"eab_token": { "eab_token": {

Datei anzeigen

@ -205,7 +205,7 @@ fn serialize_with_formatter<T: Serialize, F: Formatter>(value: &T, formatter: F)
Ok(_) => {}, Ok(_) => {},
Err(error) => return Error::err(format!("Failed to Serialize the schema: {error}")), Err(error) => return Error::err(format!("Failed to Serialize the schema: {error}")),
} }
store.push(b'\n');
Ok(unsafe { String::from_utf8_unchecked(store) }) Ok(unsafe { String::from_utf8_unchecked(store) })
} }

Datei anzeigen

@ -208,14 +208,14 @@ pub mod schema {
if is_array(val) { if is_array(val) {
if let Some(items) = schema.get("items") { if let Some(items) = schema.get("items") {
let mut items = items.to_owned(); 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); schema.insert("items".to_owned(), items);
} else { } else {
schema.insert( schema.insert(
"items".to_owned(), "items".to_owned(),
Value::Object({ Value::Object({
let mut items = Map::with_capacity(1); let mut items = Map::with_capacity(1);
items.insert("type".to_owned(), typval); items.insert("format".to_owned(), typval);
items items
}), }),
); );
@ -223,7 +223,7 @@ pub mod schema {
return; return;
} }
} }
schema.insert("type".to_string(), typval); schema.insert("format".to_string(), typval);
} }
pub fn email_transform(schema: &mut Schema) { pub fn email_transform(schema: &mut Schema) {