Update json-schema-to-grammar.py
This commit is contained in:
parent
ee492c9e4d
commit
5764d9ffbc
1 changed files with 2 additions and 1 deletions
|
@ -326,7 +326,8 @@ class SchemaConverter:
|
||||||
# "required": ["bar"]
|
# "required": ["bar"]
|
||||||
# }
|
# }
|
||||||
if 'anyOf' in prop_schema and any(s.get('type') == 'null' for s in prop_schema['anyOf']):
|
if 'anyOf' in prop_schema and any(s.get('type') == 'null' for s in prop_schema['anyOf']):
|
||||||
required.remove(prop_name)
|
if prop_name in required:
|
||||||
|
required.remove(prop_name)
|
||||||
alts = [s for s in prop_schema['anyOf'] if s.get('type') != 'null']
|
alts = [s for s in prop_schema['anyOf'] if s.get('type') != 'null']
|
||||||
if len(alts) == 1:
|
if len(alts) == 1:
|
||||||
prop_schema = alts[0]
|
prop_schema = alts[0]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue