Commit graph

4 commits

Author SHA1 Message Date
d0b9513b41
fix elixir type warnings 2026-05-29 14:00:29 -05:00
a796f8a3a9
Add Weather API controller with parameter validation
Implements GET /api/v1/weather/nearby endpoint with comprehensive parameter
validation and error handling. The controller validates required parameters
(lat, lon, radius) and optional parameters (hours, limit) with appropriate
range checking. Integrates with PreparedQueries for efficient database access
and WeatherJSON for response serialization.

Key features:
- Required params: lat (-90 to 90), lon (-180 to 180), radius (0-1000 miles)
- Optional params: hours (1-168, default 6), limit (1-100, default 50)
- Proper error responses via FallbackController (400 for bad requests, 422 for validation)
- Full test coverage (16 tests) including edge cases and error scenarios

Also updates FallbackController to handle {:error, status, message} tuples
and fixes WeatherJSON to support both field name formats (lat/lon and latitude/longitude)
for compatibility with existing tests and actual query results.
2026-03-22 11:27:45 -05:00
fc449ed5f9
en español 2025-07-05 15:51:39 -05:00
ce7c50caa1
refactor to use external parser 2025-06-24 14:22:09 -05:00
Renamed from lib/aprs_web/controllers/api/v1/fallback_controller.ex (Browse further)