smcunning / sweater_weather

Rails API which exposes a variety of weather and location data from multiple 3rd party APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Retrieve Weather for City

smcunning opened this issue · comments

GET /api/v1/forecast?location=denver,co
Content-Type: application/json
Accept: application/json
  • Response:
{
  "data": {
    "id": null,
    "type": "forecast",
    "attributes": {
      "current_weather": {
        "datetime": "2020-09-30 13:27:03 -0600",
        "temperature": 79.4,
        etc
      },
      "daily_weather": [
        {
          "date": "2020-10-01",
          "sunrise": "2020-10-01 06:10:43 -0600",
          etc
        },
        {...} etc
      ],
      "hourly_weather": [
        {
          "time": "14:00:00",
          "wind_speed": "4 mph",
          "wind_direction": "from NW",
          etc
        },
        {...} etc
      ]
    }
  }
}
  • Testing should look for more than just the presence of attribute fields in the response. Testing should also determine which fields should NOT be present. (don’t send unnecessary data)