Skip to content

API needs updating for RFC 9110 as 'HTTP_422_UNPROCESSABLE_ENTITY' is deprecated. Use 'HTTP_422_UNPROCESSABLE_CONTENT' instead. #4742

@JC-wk

Description

@JC-wk

Describe the bug
The issue is that RFC 9110 introduced HTTP_422_UNPROCESSABLE_CONTENT and deprecated HTTP_422_UNPROCESSABLE_ENTITY.

Starlette is an ASGI framework/toolkit which FastAPI uses and they adopted RFC 9110 in version 0.48.0 (ref).
Starlette was updated recently in the TRE to 0.48 here #4683
FastAPI re-exports status codes directly from Starlette (ref) so this has affected FastAPI.

See https://stackoverflow.com/questions/79789459/deprecationwarning-http-422-unprocessable-entity-is-deprecated-use-http-422

Steps to reproduce

  1. I ran Pytest locally and observed many errors related to " DeprecationWarning: 'HTTP_422_UNPROCESSABLE_ENTITY' is deprecated. Use 'HTTP_422_UNPROCESSABLE_CONTENT' instead."
  2. I searched in vscode and found a large number of files using HTTP_422_UNPROCESSABLE_ENTITY
Image

Azure TRE release version (e.g. v0.14.0 or main):
main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions