Repository navigation
PLAT-1314/feat: validate JSON payloads before API requests - #13
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Puvendhan
left a comment
There was a problem hiding this comment.
Checked payloads are validated against the embedded schema in both single and paginated paths without echoing values in errors; no open findings; CI green.
Generated by Claude Code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f054d90f12
ℹ️ 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".
| var value any | ||
| if err := json.Unmarshal(raw, &value); err != nil { |
There was a problem hiding this comment.
Preserve JSON number precision during validation
When a payload contains a high-precision number, unmarshalling into any converts it to float64 before schema validation. This can change the value or even turn a non-integer into an integer—for example, 36.000000000000001 rounds to 36 and can pass an integer schema with maximum: 36; sufficiently large valid JSON numbers also fail decoding as though the JSON were malformed. Validate a lossless numeric representation so constraints are checked against the value that will actually be sent.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
fixed in #15: numbers are decoded losslessly, and any that float64 can't hold exactly skip local validation with a warning so the API decides.
The diagnostics test from #12 posted an arbitrary body to order create, which payload validation now rejects before the request is sent. It now uses a probe operation whose schema declares the fields it sends. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUnP8hJ3og3dxSHHcYij5n
Changes
oneOfdiscrimination, composed array items, typed/open maps and shared schema contents.Validation
On exact head
bb8c8ad5d4aa07f41ba2ccba9bc4da3d4ca29aa1, CI run 41433101885 passed both jobs:go build ./..., embedded-spec drift check, all tests and coverage gate passed. Total coverage 82.0% (80% gate).oneOfand composed-array warning edge cases; both now have regressions.Scope
Refs PLAT-1314. Other checklist items and open PR scopes remain separate. Validation uses the existing kin-openapi OAS validator; this does not add a new JSON Schema engine or change embedded specs.
Integration status — 2 November 2026
Merged current
main(8a3ba6e9fb8269f4d6056c7419895902641ee356) into this branch without force-pushing. The merge was automatic; existing validation behavior and upstream retry/context/keychain changes are preserved. GitHub now reports no merge conflicts.No approval is recorded. Suggested review/merge sequence: this PR before interactive pagination (PR #14), then refresh #14 against the resulting main and rerun CI. A Git integration check found overlapping README/pagination edits between those PRs; neither has been merged by this repair.
✨ via Codex session