Open olevski opened 1 month ago
I think we can temporarily fix this with:
@schemathesis.hook
def filter_query(context: HookContext, query: dict[str, str] | None) -> bool:
if query is not None and "" in query:
return False
return True
To reproduce:
make run
curl -H 'authorization: {"is_admin": true, "id": "admin", "name": "Admin Doe", "first_name": "Admin", "last_name": "Doe", "email": "admin.doe@gmail.com", "full_name": "Admin Doe"}' 'http://localhost:8000/api/data/user/secrets?kind=&=null'
This is not very likely to occur very often but we should still fix it. Probably wrapping the sanic validator in our own decorator or just fully making our own decorator for validating query params will work.
The response from the curl request should be 422 but we just get an ambiguous 500.
This is also an opportunity for us to contribute this fix upstream to sanic.
The trace from sanic is: