[Bugfix][Structured Output] Reject unsupported regex inside groups (#60359)

Signed-off-by: Shreyansh Jain <shreyanshjain646@gmail.com>
Signed-off-by: Artem Perevedentsev <aperevedents@nvidia.com>
Co-authored-by: Artem Perevedentsev <aperevedents@nvidia.com>
This commit is contained in:
Shreyansh Jain
2026-10-09 14:16:13 +03:00
committed by GitHub
co-authored by Artem Perevedentsev
parent b027ac8312
commit 28d76f3bad
2 changed files with 78 additions and 3 deletions
@@ -327,9 +327,11 @@ def _check_unsupported(parsed) -> None:
for branch in tval[1]:
_check_unsupported(branch)
# tval is (min, max, subpattern)
elif ttype == _parser.MAX_REPEAT:
_check_unsupported(tval[2])
else:
nested = tval if isinstance(tval, tuple) else (tval,)
for sub in nested:
if isinstance(sub, _parser.SubPattern):
_check_unsupported(sub)
def validate_regex_is_buildable(pattern: str) -> None: