Unverified Commit aab39277 authored by Russell Bryant's avatar Russell Bryant Committed by GitHub
Browse files

[Core] xgrammar: Expand list of unsupported jsonschema keywords (#13783)


Signed-off-by: default avatarRussell Bryant <rbryant@redhat.com>
parent 6724e791
......@@ -33,6 +33,18 @@ def has_xgrammar_unsupported_json_features(schema: dict) -> bool:
]):
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
for value in obj.values():
if isinstance(value, dict):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment