Describe the bug
FastAPI's default_response_class parameter is ignored by class-based views. This is important when, for example, trying to override the default JSON encoder.
To Reproduce
Steps to reproduce the behavior:
Create a class-based view
Add a custom encoder, see the example below
Trigger the view
Observe that the log is not printed
If you repeat these steps for an normal function-based view, the log will be printed.
Expected behavior
The custom encoder is ignored in class-based views.
Describe the bug FastAPI's
default_response_class
parameter is ignored by class-based views. This is important when, for example, trying to override the default JSON encoder.To Reproduce Steps to reproduce the behavior:
If you repeat these steps for an normal function-based view, the log will be printed.
Expected behavior The custom encoder is ignored in class-based views.
Environment: