element-hq / element-hq/synapse

Moving towards stronger schemas for response types

Open
#13,529 0 comments 0 reactions 0 assignees View on GitHub
A-Spec-Compliance T-Enhancement T-Task Z-Cleanup
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#13529](https://github.com/matrix-org/synapse/issues/13529).

---

We've recently had a number of issues with Synapse returning unspecced fields in API response that clients have ended up relying on.

There are two related questions here:
1. How do we ensure that our API responses match the spec?
2. Can we automatically detect in CI when we change an API response, so that we can flag that extra care must be taken?

Long term there is a desire to move to generating responses via swagger from the Spec.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing Synapse's API response-generation and schema-validation entry points, then compare them with the relevant Matrix API specification. Investigate how CI could detect response changes and how OpenAPI/Swagger generation would fit. Done means a decided, implementable approach for spec conformance and automated change detection.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.