You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Schema guard crashes on a list of types, so the default pipeline allows every output #1997
Schema raises TypeError: unhashable type: 'list' when a schema uses a list of types, such as "type": ["string", "null"]. That is how OpenAI strict structured outputs write an optional field, and what zod-to-json-schema emits for .nullable().
Because Pipeline defaults to fail_open=True, the error is logged and the guard returns allow, so the schema check is skipped for every output, including invalid ones. With fail_open=False the call raises instead.
Steps to reproduce
On main 463a1c1 (openlit 1.45.0 from PyPI gives the same result):
A value that matches any type in the list passes (null and "A" here), and one that matches none of them is denied with schema_mismatch, the same as for a single type. This is what JSON Schema specifies, and jsonschema agrees on all of these cases.
Environment
OpenLIT Python SDK 1.45.0, Python 3.12.
Additional context
_validate_json_schema passes schema["type"] straight to a dict lookup (type_map.get(schema_type)), which fails for a list. I searched existing issues and PRs (including #1691 and #1865) and didn't find this. I have a fix with tests ready and can open a PR.
Activity