ONSdigital / dp-find-insights-poc-api

Find Insights Proof of Concept
MIT License
1 stars 0 forks source link

add bbox, circle and polygon sanity checks to query/ and query2/ #212

Closed wavemechanics closed 2 years ago

wavemechanics commented 2 years ago

What

Add checks to ensure that the coordinates passed to the query and query2 endpoints make basic sense.

For bbox= and polygon=, the bounding box must overlap the bounding box of the UK.

For location= and radius=, the location must be within the bounding box of the UK, and radius must be 1..1000000 (an arbitrary limit).

Also added a mechanism in inttests to verify the API returns non-200 codes when expected.