questsin / UBC-Rogers-CAMARA-Hackathon

UBC Rogers CAMARA Hackathon
Apache License 2.0
10 stars 8 forks source link

Wrong API documentation for location API: center should be location #3

Open range-rules opened 3 days ago

range-rules commented 3 days ago

Consider this: https://editor.swagger.io/?url=https://raw.githubusercontent.com/questsin/UBC-Rogers-CAMARA-Hackathon/refs/heads/main/API/location-verification.yaml

Specifically example value for request body for /verify endpoint:

{
  "device": {
    "phoneNumber": "+123456789"
  },
  "area": {
    "areaType": "CIRCLE",
    "center": {
      "latitude": 50.735851,
      "longitude": 7.10066
    },
    "radius": 50000
  },
  "maxAge": 120
}

Sending this will not produce correct response. Here, "center" should be "location", and "CIRCLE" should be "Circle".

See tests https://github.com/questsin/UBC-Rogers-CAMARA-Hackathon/blob/main/tests/test-api-location-verification.html#L91 for correct usage.

I would recommend that you use your api documentation inside automated tests as well to avoid such issues in the future.

questsin commented 3 days ago

The sandbox site has a version that works