matrix-org / matrix-org/matrix-spec

Is the `error` field in standard error responses required?

Open
#2,235 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

clarification
Dominant language
HTML
Stars
330
Forks
150
Avg merge
2h 21m
Merged PRs (30d)
3

Description

In the CS and IS APIs, the [standard error response](https://spec.matrix.org/v1.16/client-server-api/#standard-error-response) definition has this sentence:

> Some `errcode`s define additional keys which should be present in the error response object, but the keys `error` and `errcode` MUST always be present.

But then in the [OpenAPI definition of errors](https://github.com/matrix-org/matrix-spec/blob/974b0b721e7c54bbff320e4dfd05e1f041abe68d/data/api/client-server/definitions/errors/error.yaml), the field is not marked as required.

Furthermore, it looks like the AS API never has this field in example error responses, but is the error response format supposed to be identical between specs anyway?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Standard Error Response text in the Client-Server API, then compare it with data/api/client-server/definitions/errors/error.yaml. Review the AS API error examples to determine whether the same format is intended. Done means the requirement, OpenAPI definition, and relevant examples consistently describe whether error is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.