fix: sort parameter validation on /api/v1/audit.settings endpoint#38366
fix: sort parameter validation on /api/v1/audit.settings endpoint#38366kodiakhq[bot] merged 2 commits intodevelopfrom
/api/v1/audit.settings endpoint#38366Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: 3b7a9a7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 40 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThe PR fixes the sort parameter validation on the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #38366 +/- ##
===========================================
+ Coverage 70.78% 70.80% +0.01%
===========================================
Files 3159 3159
Lines 109397 109397
Branches 19669 19652 -17
===========================================
+ Hits 77437 77455 +18
+ Misses 29933 29910 -23
- Partials 2027 2032 +5
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Proposed changes (including videos or screenshots)
The sort parameter on the
/api/v1/audit.settingsendpoint was returning a 400 error when using the standard string format (sort={"ts":1}).The root cause is that AJV validation schema defined sort as an object type, but
parseJsonQuery()only handles string format. This mismatch caused string format to fail validation.To fix, changed the schema to use
type: 'string'for the sort parameter, aligning with all other endpoints in the codebase and the official API documentation.Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.