From 6dfba2468ab60e78c717e4a8b5079286aead9222 Mon Sep 17 00:00:00 2001 From: niftynei Date: Tue, 19 Jul 2022 17:04:39 +0930 Subject: [PATCH] json-schema: allow 'required' to not be present in if switches --- tools/fromschema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/fromschema.py b/tools/fromschema.py index a8708c5fe..a1291e897 100755 --- a/tools/fromschema.py +++ b/tools/fromschema.py @@ -148,13 +148,13 @@ def output_members(sub, indent=''): for p in sub['properties']: if p.startswith('warning'): continue - if p in sub['required']: + if 'required' in sub and p in sub['required']: output_member(p, sub['properties'][p], False, indent) for p in sub['properties']: if p.startswith('warning'): continue - if p not in sub['required']: + if 'required' not in sub or p not in sub['required']: output_member(p, sub['properties'][p], True, indent) if warnings != []: