[feature] [xgrammar] support patternProperties/propertyNames/unevaluatedProperties kw for object types (#42904)
Signed-off-by: cjackal <44624812+cjackal@users.noreply.github.com> Co-authored-by: Artem Perevedentsev <aperevedents@nvidia.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Artem Perevedentsev
Claude Sonnet 5
parent
7b7e117c29
commit
cd10ed6f9f
@@ -137,7 +137,7 @@ def test_unsupported_grammar_is_a_client_error(backend, structured_outputs):
|
||||
@pytest.mark.parametrize(
|
||||
"schema, expected_backend",
|
||||
[
|
||||
# multipleOf is unsupported by xgrammar, patternProperties also by guidance.
|
||||
# multipleOf is unsupported by xgrammar.
|
||||
(
|
||||
{
|
||||
"type": "object",
|
||||
@@ -145,8 +145,13 @@ def test_unsupported_grammar_is_a_client_error(backend, structured_outputs):
|
||||
},
|
||||
"guidance",
|
||||
),
|
||||
# patternProperties + properties is also unsupported by guidance.
|
||||
(
|
||||
{"type": "object", "patternProperties": {"^a": {"type": "string"}}},
|
||||
{
|
||||
"type": "object",
|
||||
"properties": {"a": {"type": "string"}},
|
||||
"patternProperties": {"^a$": {"type": "string"}},
|
||||
},
|
||||
"outlines",
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user