Skip to content

Rename API to /api/water and standardize request/response shapes - #14

Merged
dillonstreator merged 1 commit into
mainfrom
feat/api-water-shape
Jul 24, 2026
Merged

Rename API to /api/water and standardize request/response shapes#14
dillonstreator merged 1 commit into
mainfrom
feat/api-water-shape

Conversation

@dillonstreator

Copy link
Copy Markdown
Member

Summary

  • Rename the lookup endpoints from /api/is-on-water to /api/water so the path is not redundant with the product/domain name.
  • Wrap batch POST as { coordinates } / { results } (bare arrays still accepted as input).
  • Return RFC 9457 Problem Details (application/problem+json) for errors instead of { msg }.

Test plan

  • pnpm test passes
  • GET /api/water?lat=20.112682&lon=-37.048647 returns { water, lat, lon }
  • POST /api/water with { "coordinates": [...] } returns { "results": [...] }
  • Invalid coords return 400 with application/problem+json
  • Landing page try-it and docs still hit /api/water
  • Swagger at /documentation shows /api/water only

Drop the product-name path and align request/response/error shapes with common HTTP API conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>
@dillonstreator
dillonstreator merged commit 5ad0af5 into main Jul 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant