json-schema: allow 'required' to not be present in if switches

This commit is contained in:
niftynei 2022-07-19 17:04:39 +09:30 committed by Rusty Russell
parent e2ef44c043
commit 6dfba2468a

View File

@ -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 != []: