[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:
@@ -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.
|
||||
(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user