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,6 +326,7 @@ class SchemaConverter:
|
|||
# "required": ["bar"]
|
||||
# }
|
||||
if 'anyOf' in prop_schema and any(s.get('type') == 'null' for s in prop_schema['anyOf']):
|
||||
if prop_name in required:
|
||||
required.remove(prop_name)
|
||||
alts = [s for s in prop_schema['anyOf'] if s.get('type') != 'null']
|
||||
if len(alts) == 1:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue