[Core] xgrammar: Expand list of unsupported jsonschema keywords (#13783)
Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
@@ -33,6 +33,18 @@ def has_xgrammar_unsupported_json_features(schema: dict) -> bool:
|
|||||||
]):
|
]):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# Unsupported keywords for strings
|
||||||
|
if obj.get("type") == "string" and any(
|
||||||
|
key in obj for key in ["minLength", "maxLength", "format"]):
|
||||||
|
return True
|
||||||
|
|
||||||
|
# Unsupported keywords for objects
|
||||||
|
if obj.get("type") == "object" and any(key in obj for key in [
|
||||||
|
"minProperties", "maxProperties", "propertyNames",
|
||||||
|
"patternProperties"
|
||||||
|
]):
|
||||||
|
return True
|
||||||
|
|
||||||
# Recursively check all nested objects and arrays
|
# Recursively check all nested objects and arrays
|
||||||
for value in obj.values():
|
for value in obj.values():
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
|
|||||||
Reference in New Issue
Block a user