From 971c73e624e8db546f550e0eeede7610f94edfff Mon Sep 17 00:00:00 2001 From: Shivam Gupta Date: Sat, 13 Sep 2025 22:52:58 +0530 Subject: [PATCH] feat(common): add UNPROCESSABLE_CONTENT for status 422 Adds the HttpStatus.UNPROCESSABLE_CONTENT enum in alignment with RFC 9110. The previous HttpStatus.UNPROCESSABLE_ENTITY is now marked as deprecated. --- packages/common/enums/http-status.enum.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/common/enums/http-status.enum.ts b/packages/common/enums/http-status.enum.ts index 8d6da452686..0aefa698a82 100644 --- a/packages/common/enums/http-status.enum.ts +++ b/packages/common/enums/http-status.enum.ts @@ -43,7 +43,19 @@ export enum HttpStatus { EXPECTATION_FAILED = 417, I_AM_A_TEAPOT = 418, MISDIRECTED = 421, + /** + * Official RFC 9110 name for the 422 status code. + * @see https://www.rfc-editor.org/rfc/rfc9110.html#name-422-unprocessable-content + */ + UNPROCESSABLE_CONTENT = 422, + + /** + * @deprecated The name "Unprocessable Entity" is deprecated in favor of "Unprocessable Content" (RFC 9110). + * It will be removed in a future major version. + * @see https://www.rfc-editor.org/rfc/rfc9110.html#name-422-unprocessable-content + */ UNPROCESSABLE_ENTITY = 422, + // ... LOCKED = 423, FAILED_DEPENDENCY = 424, PRECONDITION_REQUIRED = 428,