Conversation
| } | ||
|
|
||
| // Handle object type normalization | ||
| if ((schema?.type === "object" || schema?.properties) && typeof value === "object" && value !== null) { |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 50813e3272
ℹ️ 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 ((schema?.type === "integer" || schema?.type === "number") && typeof value === "string") { | ||
| const parsed = Number(value); | ||
| if (!Number.isNaN(parsed)) { | ||
| return schema.type === "integer" ? Math.floor(parsed) : parsed; |
There was a problem hiding this comment.
Avoid flooring non-integer numeric strings
The new normalization path converts any numeric string for integer schemas with Math.floor, so an example like "1.9" (or "-1.2") is silently rewritten to a different value (1 / -2) instead of being left unchanged or rejected. This can produce misleading exampleParams that no longer reflect the OpenAPI source and may drive bad tool calls (especially for bounded fields) when agents copy examples. Restrict integer coercion to strings that parse as exact integers (and finite values) to avoid data corruption during generation.
Useful? React with 👍 / 👎.
Attribution post-PR evaluation
Cases
|
Attribution issue
Automation summary
aborted
Changed files
mcp/src/generated/tcb-action-index.tsscripts/generate-tcb-action-index.mjs