[Bugfix] Fix xgrammar feature gate bypass when JSON Schema type is a list (#48416)

Signed-off-by: john <6712432+CaiJohn@users.noreply.github.com>
Co-authored-by: john <6712432+CaiJohn@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
CaiJohn
2026-09-21 09:59:20 +03:00
committed by GitHub
co-authored by john Codex
parent 9598487bc1
commit 3c84ad13ed
3 changed files with 82 additions and 7 deletions
@@ -145,6 +145,21 @@ def test_unsupported_grammar_is_a_client_error(backend, structured_outputs):
},
"guidance",
),
(
{
"type": "object",
"properties": {"n": {"type": ["number", "null"], "multipleOf": 3}},
},
"guidance",
),
(
{
"type": ["string", "null"],
"pattern": "^a+$",
"maxLength": 2,
},
"guidance",
),
# patternProperties + properties is also unsupported by guidance.
(
{