rcpch / digital-growth-charts-server

RCPCH's open source Digital Growth Chart API
https://growth.rcpch.ac.uk/
GNU Affero General Public License v3.0
16 stars 11 forks source link

Fix chart-coordinates endpoint #214

Closed mbarton closed 3 months ago

mbarton commented 3 months ago

Fixes #213

Before anything other than height caused a validation error as height was a mandatory field in the Open API spec (whilst the others were optional).

curl -X POST -H 'Content-Type: application/json' -d '{"measurement_method":"weight","sex":"female","centile_format":"cole-nine-centiles","is_sds":false}' http://localhost:8000/uk-who/chart-coordinates
growth-api-1  | 2024-07-10T19:27:51.142703424Z   {'type': 'missing', 'loc': ('response', 'centile_data', 1, 'uk_who_infant', 'female', 'height'), 'msg': 'Fiel
d required', 'input': {'weight':  [elided full centile data]
mbarton commented 3 months ago

I would add a regression test but the existing tests for this endpoint are skipped. Have raised https://github.com/rcpch/digital-growth-charts-server/issues/216 to fix