Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 18dfac6ebf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (types.Count == 0) | ||
| { | ||
| if (value.ValueKind == JsonValueKind.Null) | ||
| return true; | ||
| normalized = JsonNode.Parse(value.GetRawText()); |
There was a problem hiding this comment.
Enforce combinator constraints before generic primitive fallback
When a schema node has no type/properties/items, this branch treats it as unconstrained and accepts any JSON value. Because TryNormalizeValue only handles $ref and anyOf, schemas that use other combinators (for example oneOf) can pass validation but then be normalized as valid regardless of the combinator rules. A property like { "oneOf": [{"type":"string"},{"type":"integer"}] } will incorrectly accept objects/arrays, so structured-output responses can violate the declared schema without error.
Useful? React with 👍 / 👎.
| if (normalized == null && allowNullFallback) | ||
| return true; |
There was a problem hiding this comment.
Apply enum/const checks even when normalized value is null
This early return skips enum and const enforcement whenever the normalized value is null. As a result, schemas like { "type": ["string", "null"], "enum": ["ok"] } incorrectly accept null, and missing nullable fields auto-filled as null can bypass enum/const constraints too. That allows invalid model outputs to be returned as schema-valid.
Useful? React with 👍 / 👎.
No description provided.