Fix: json_schema_to_gbnf should take string dump of json schema as input
This commit is contained in:
parent
e7962d2c73
commit
faeae181b1
1 changed files with 1 additions and 1 deletions
|
@ -1484,7 +1484,7 @@ class SchemaConverter:
|
|||
|
||||
def json_schema_to_gbnf(schema: str, prop_order: Optional[List[str]] = None):
|
||||
prop_order = prop_order or []
|
||||
schema = json.load(schema)
|
||||
schema = json.loads(schema)
|
||||
prop_order = {name: idx for idx, name in enumerate(prop_order)}
|
||||
converter = SchemaConverter(prop_order)
|
||||
converter.visit(schema, "")
|
||||
|
|
Loading…
Reference in a new issue