Unverified Commit 06a760d6 authored by Cheng Kuan Yong Jason's avatar Cheng Kuan Yong Jason Committed by GitHub
Browse files

[bugfix] catch xgrammar unsupported array constraints (#12210)


Signed-off-by: default avatarJason Cheng <jasoncky96@gmail.com>
parent da751221
......@@ -20,6 +20,13 @@ def has_xgrammar_unsupported_json_features(schema: dict) -> bool:
]):
return True
# Check for array unsupported keywords
if obj.get("type") == "array" and any(key in obj for key in [
"uniqueItems", "contains", "minContains", "maxContains",
"minItems", "maxItems"
]):
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