registry/internal/api/router
Repository files (latest commit first)
Filename Latest commit message Latest commit date
adam jones 62f4453f37
feat: Add proper 404 error handling with helpful suggestions (#421)
Fixes #418

This PR addresses the issue where invalid API endpoints (like
`/servers`) were returning blank 200 responses instead of proper 404
errors.

## Changes

- Added catch-all 404 handler for unmatched routes
- Return RFC 7807 compliant JSON error responses
- Provide smart suggestions for common mistakes:
  - `/servers` → suggest `/v0/servers`
  - `/health` → suggest `/v0/health`
  - `/ping` → suggest `/v0/ping`
  - `/v1`, `/v2` → inform only v0 is supported
- Fixes blank 200 responses for invalid endpoints
- Improves API discoverability and debugging experience

## Testing

- ✅ Unit tests pass
- ✅ Integration tests pass
- ✅ Manual testing confirms proper 404 responses with helpful messages

Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: adam jones <domdomegg@users.noreply.github.com>
Co-authored-by: Radoslav Dimitrov <radoslav@stacklok.com>
2025-09-10 13:14:49 -07:00
..
router.go feat: Add proper 404 error handling with helpful suggestions (#421) 2025-09-10 13:14:49 -07:00
v0.go feat: add admin edit endpoint for server moderation (#315) 2025-08-27 21:28:04 +01:00