From 92c2b517f21ecc43b806609efd9ab986edfcc868 Mon Sep 17 00:00:00 2001 From: Alexey Strukov Date: Thu, 12 Oct 2023 17:38:20 +0300 Subject: [PATCH] Added json-patch validation 'remove' info In json validation added json-path info for keys that didn't described in json-schema as 'remove'. --- src/json-validator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/json-validator.cpp b/src/json-validator.cpp index 6ede7c8..e3460e9 100644 --- a/src/json-validator.cpp +++ b/src/json-validator.cpp @@ -1030,6 +1030,9 @@ class object : public schema a_prop_or_pattern_matched = true; schema_p->second->validate(ptr / p.key(), p.value(), patch, e); } + else { + patch.remove(ptr / p.key()); + } #ifndef NO_STD_REGEX // check all matching patternProperties