]> git.proxmox.com Git - proxmox.git/commitdiff
schema: drop periods after errors
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 21 Feb 2024 11:04:39 +0000 (12:04 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 21 Feb 2024 11:05:44 +0000 (12:05 +0100)
lower case start + period = wrong

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-schema/src/schema.rs
proxmox-schema/tests/schema_verification.rs

index 257cedc8954a457854296b0b133ca8bbbe77fcee..b71720bb440d8b4ad10fe8741a306c210c69e68d 100644 (file)
@@ -834,7 +834,7 @@ pub trait ObjectSchemaType {
             } else if !additional_properties {
                 errors.push(
                     key.to_string(),
-                    format_err!("schema does not allow additional properties."),
+                    format_err!("schema does not allow additional properties"),
                 );
             }
         }
@@ -843,7 +843,7 @@ pub trait ObjectSchemaType {
             if !(*optional) && data[name] == Value::Null {
                 errors.push(
                     name.to_string(),
-                    format_err!("property is missing and it is not optional."),
+                    format_err!("property is missing and it is not optional"),
                 );
             }
         }
index 4eef74877a36a113db39f6d3261b695e2acd96bb..2571a552e1ca29744d211c7c9e065470cc6508fe 100644 (file)
@@ -135,8 +135,8 @@ fn verify_simple_object() -> Result<(), Error> {
         &simple_value,
         &[
             ("prop1", "Expected string value."),
-            ("prop4", "schema does not allow additional properties."),
-            ("prop3", "property is missing and it is not optional."),
+            ("prop4", "schema does not allow additional properties"),
+            ("prop3", "property is missing and it is not optional"),
         ],
     )?;
 
@@ -152,9 +152,9 @@ fn verify_nested_object1() -> Result<(), Error> {
         &nested_value,
         &[
             ("prop1", "Expected string value."),
-            ("prop4", "schema does not allow additional properties."),
-            ("arr1", "property is missing and it is not optional."),
-            ("obj1", "property is missing and it is not optional."),
+            ("prop4", "schema does not allow additional properties"),
+            ("arr1", "property is missing and it is not optional"),
+            ("obj1", "property is missing and it is not optional"),
         ],
     )?;
 
@@ -170,10 +170,10 @@ fn verify_nested_object2() -> Result<(), Error> {
         &nested_value,
         &[
             ("arr1/[1]", "Expected string value."),
-            ("obj1/prop1", "property is missing and it is not optional."),
-            ("obj1/prop3", "property is missing and it is not optional."),
+            ("obj1/prop1", "property is missing and it is not optional"),
+            ("obj1/prop3", "property is missing and it is not optional"),
             ("prop1", "Expected string value."),
-            ("prop4", "schema does not allow additional properties."),
+            ("prop4", "schema does not allow additional properties"),
         ],
     )?;
 
@@ -247,7 +247,7 @@ fn verify_all_of_schema() -> Result<(), Error> {
     test_verify(
         &ALL_OF_SCHEMA_NO_ADDITIONAL,
         &value,
-        &[("another1", "property is missing and it is not optional.")],
+        &[("another1", "property is missing and it is not optional")],
     )?;
 
     let value = json!({
@@ -259,7 +259,7 @@ fn verify_all_of_schema() -> Result<(), Error> {
     test_verify(
         &ALL_OF_SCHEMA_NO_ADDITIONAL,
         &value,
-        &[("additional", "schema does not allow additional properties.")],
+        &[("additional", "schema does not allow additional properties")],
     )?;
 
     Ok(())
@@ -285,7 +285,7 @@ fn verify_all_of_schema_with_additional() -> Result<(), Error> {
     test_verify(
         &ALL_OF_SCHEMA_ADDITIONAL,
         &value,
-        &[("regular1", "property is missing and it is not optional.")],
+        &[("regular1", "property is missing and it is not optional")],
     )?;
 
     Ok(())