feat: Rename /schema endpoint to /schemas#1263
Conversation
0d33ca9 to
b7d5dad
Compare
WalkthroughThis PR updates API endpoint paths from singular Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/api/v2/routes.go (1)
85-87: Breaking change – consider documenting a migration path.Renaming
/schema→/schemasis a non-backward-compatible change. Any deployed client targeting the old endpoint will receive a404with no indication of what changed. Consider one of:
- Adding a
301/308redirect from the old paths to the new ones (temporary compatibility shim).- Documenting this as a breaking change in the changelog/migration guide alongside the
SEMVERbump.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@internal/api/v2/routes.go` around lines 85 - 87, Routes were renamed from /schema to /schemas causing a breaking change; add compatibility shims by registering redirect handlers for the old endpoints that forward to the new ones (or return a 301/308) so existing clients don’t get a bare 404. Specifically, add routes corresponding to the previous /schema paths that call either a redirect to the new path or invoke the existing handlers (insertSchema, readSchema, listSchemas) so behavior remains the same while you document the breaking change in the changelog/migration guide.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@internal/api/v2/routes.go`:
- Around line 85-87: Routes were renamed from /schema to /schemas causing a
breaking change; add compatibility shims by registering redirect handlers for
the old endpoints that forward to the new ones (or return a 301/308) so existing
clients don’t get a bare 404. Specifically, add routes corresponding to the
previous /schema paths that call either a redirect to the new path or invoke the
existing handlers (insertSchema, readSchema, listSchemas) so behavior remains
the same while you document the breaking change in the changelog/migration
guide.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1263 +/- ##
=======================================
Coverage 82.20% 82.20%
=======================================
Files 198 198
Lines 10224 10224
=======================================
Hits 8405 8405
Misses 1326 1326
Partials 493 493 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for consistency with other endpoints