"vscode:/vscode.git/clone" did not exist on "68d37809b9b52f4d012fa0dfbb187f0fe978bdbc"
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: ...@@ -20,6 +20,13 @@ def has_xgrammar_unsupported_json_features(schema: dict) -> bool:
]): ]):
return True 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 # 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):
......
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