[pbs-devel] applied: [PATCH proxmox-backup] verify-api: fix allOf duplicates check

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Dec 30 12:36:23 CET 2020


it triggered with a wrongly-formatted message on schemas that did NOT
contain any duplicates..

Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
Note: we are still lacking the same checks for CLI handlers and their schema..

 tests/verify-api.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/verify-api.rs b/tests/verify-api.rs
index 7b7371f6..83a26a21 100644
--- a/tests/verify-api.rs
+++ b/tests/verify-api.rs
@@ -46,8 +46,8 @@ fn verify_all_of_schema(schema: &AllOfSchema) -> Result<(), Error> {
     let mut keys = HashSet::<&'static str>::new();
     let mut dupes = String::new();
     for property in schema.properties() {
-        if keys.insert(property.0) {
-            if dupes.is_empty() {
+        if !keys.insert(property.0) {
+            if !dupes.is_empty() {
                 dupes.push_str(", ");
             }
             dupes.push_str(property.0);
-- 
2.20.1






More information about the pbs-devel mailing list