Skip to content

RFC 9110: HttpStatus.UNPROCESSABLE_ENTITY should be HttpStatus.UNPROCESSABLE_CONTENT #15624

@juergenzimmermann

Description

@juergenzimmermann

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Statuscode 422 is represented by enum value HttpStatus.UNPROCESSABLE_ENTITY (see https://github.com/nestjs/nest/blob/master/packages/common/enums/http-status.enum.ts#L46). However, https://www.rfc-editor.org/rfc/rfc9110.html#name-422-unprocessable-content defines 422 as Unprocessable Content, and not Unprocessable Entity. See also https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml.
In the Java World Spring Framework already fixed 422 as Unprocessable Content: spring-projects/spring-framework#32870.

Minimum reproduction code

https://github.com/juergenzimmermann/buch

Steps to reproduce

Obvious.

Expected behavior

There should be an enum value HttpStatus.UNPROCESSABLE_CONTENT for statuscode 422.

NestJS version

@nestjs/common 11.1.6

Packages versions

  "dependencies": {
    "@nestjs/apollo": "13.1.0",
    "@nestjs/axios": "4.0.1",
    "@nestjs/common": "11.1.6",
    "@nestjs/config": "4.0.2",
    "@nestjs/core": "11.1.6",
    "@nestjs/graphql": "13.1.0",
    "@nestjs/microservices": "11.1.6",
    "@nestjs/platform-express": "11.1.6",
    "@nestjs/swagger": "11.2.0",
    "@nestjs/terminus": "11.0.0"
  },
  "devDependencies": {
    "@nestjs/cli": "11.0.10",
    "@nestjs/schematics": "11.0.7",
    "@nestjs/testing": "11.1.6"
  }
}

Node.js version

24.7.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue has not been looked into

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions