Closed
Description
I've got confused by the fact that response models are not being used to validate responses. Isn't that its main purpose? As you can see here for example response model is Collection. But if we modify collection's content in the database (pgstac) in order not to be align with the response model stac-fastapi simple ignores it and returns what we have in the database without any warning/error:
$ postgis=# UPDATE collections SET content = JSONB_SET(content, '{type}', '"MyCollection"');
$ curl -s -X 'GET' \
'http://localhost:8082/collections/joplin' \
-H 'accept: application/json' | jq '.type'
"MyCollection"
But according to the response model type should be Collection
.
ENABLE_RESPONSE_MODELS
set to true