mirror of
https://git.proxmox.com/git/proxmox
synced 2025-04-30 06:10:07 +00:00
schema: drop periods after errors
lower case start + period = wrong Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
9c40144214
commit
49b2bdf9c6
@ -834,7 +834,7 @@ pub trait ObjectSchemaType {
|
|||||||
} else if !additional_properties {
|
} else if !additional_properties {
|
||||||
errors.push(
|
errors.push(
|
||||||
key.to_string(),
|
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 {
|
if !(*optional) && data[name] == Value::Null {
|
||||||
errors.push(
|
errors.push(
|
||||||
name.to_string(),
|
name.to_string(),
|
||||||
format_err!("property is missing and it is not optional."),
|
format_err!("property is missing and it is not optional"),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,8 +135,8 @@ fn verify_simple_object() -> Result<(), Error> {
|
|||||||
&simple_value,
|
&simple_value,
|
||||||
&[
|
&[
|
||||||
("prop1", "Expected string value."),
|
("prop1", "Expected string value."),
|
||||||
("prop4", "schema does not allow additional properties."),
|
("prop4", "schema does not allow additional properties"),
|
||||||
("prop3", "property is missing and it is not optional."),
|
("prop3", "property is missing and it is not optional"),
|
||||||
],
|
],
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
@ -152,9 +152,9 @@ fn verify_nested_object1() -> Result<(), Error> {
|
|||||||
&nested_value,
|
&nested_value,
|
||||||
&[
|
&[
|
||||||
("prop1", "Expected string value."),
|
("prop1", "Expected string value."),
|
||||||
("prop4", "schema does not allow additional properties."),
|
("prop4", "schema does not allow additional properties"),
|
||||||
("arr1", "property is missing and it is not optional."),
|
("arr1", "property is missing and it is not optional"),
|
||||||
("obj1", "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,
|
&nested_value,
|
||||||
&[
|
&[
|
||||||
("arr1/[1]", "Expected string value."),
|
("arr1/[1]", "Expected string value."),
|
||||||
("obj1/prop1", "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."),
|
("obj1/prop3", "property is missing and it is not optional"),
|
||||||
("prop1", "Expected string value."),
|
("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(
|
test_verify(
|
||||||
&ALL_OF_SCHEMA_NO_ADDITIONAL,
|
&ALL_OF_SCHEMA_NO_ADDITIONAL,
|
||||||
&value,
|
&value,
|
||||||
&[("another1", "property is missing and it is not optional.")],
|
&[("another1", "property is missing and it is not optional")],
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let value = json!({
|
let value = json!({
|
||||||
@ -259,7 +259,7 @@ fn verify_all_of_schema() -> Result<(), Error> {
|
|||||||
test_verify(
|
test_verify(
|
||||||
&ALL_OF_SCHEMA_NO_ADDITIONAL,
|
&ALL_OF_SCHEMA_NO_ADDITIONAL,
|
||||||
&value,
|
&value,
|
||||||
&[("additional", "schema does not allow additional properties.")],
|
&[("additional", "schema does not allow additional properties")],
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -285,7 +285,7 @@ fn verify_all_of_schema_with_additional() -> Result<(), Error> {
|
|||||||
test_verify(
|
test_verify(
|
||||||
&ALL_OF_SCHEMA_ADDITIONAL,
|
&ALL_OF_SCHEMA_ADDITIONAL,
|
||||||
&value,
|
&value,
|
||||||
&[("regular1", "property is missing and it is not optional.")],
|
&[("regular1", "property is missing and it is not optional")],
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
Reference in New Issue
Block a user