From 2fb1bdda20f2e978c79043858de9dc49a888f6ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 30 Dec 2020 12:21:33 +0100 Subject: [PATCH] verify-api: fix allOf duplicates check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it triggered with a wrongly-formatted message on schemas that did NOT contain any duplicates.. Signed-off-by: Fabian Grünbichler --- 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);