Skip to content

Additional built-in response type: 422 Unprocessable Content #6615

Open
@KieranP

Description

@KieranP

Clear and concise description of the problem

There are handful of built-in http status code data types: https://typespec.io/docs/libraries/http/reference/data-types/

Currently supports the main ones, 200 (OkResponse), 201 (CreatedResponse), 204 (NoContentResponse), 400 (BadRequestResponse), 401 (UnauthorizedResponse), 403 (ForbiddenResponse), 404 (NotFoundResponse), among a couple others.

I would like to recommend adding a 422 Unprocessable Content: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/422

This is helpful when the request was authorized and valid syntax, but something in the request was missing. I can manually add this in my spec of course, but it would be nice to have this built in, since it seems like a common one that belongs among the others.

Checklist

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions