Skip to content

ORJSONResponse is deprecated #6139

@fcas

Description

@fcas

Description

This is a notification regarding the use of ORJSONResponse from FastAPI in the codebase (reference commit 6f5203a).

ORJSONResponse has been officially deprecated in FastAPI. The FastAPI documentation notes that data is now serialized directly to JSON bytes via Pydantic when a return type or response model is set. This native method is faster and eliminates the need for a custom response class.

Proposed Updates

Endpoints currently utilizing ORJSONResponse can be refactored to use standard response models and return types, leveraging FastAPI and Pydantic's default serialization.

As a result, orjson can also be safely removed as a separate dependency if it is no longer required elsewhere in the project.

References:

FastAPI docs for Custom Response - ORJSON or Response Model

FastAPI docs for Response Model

cc: @ntkathole

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions