matrix-org / matrix-org/matrix-spec
Provide clear, consistent, organized information about the structure of events (SPEC-276)
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
I'm starting to work on some libraries for Matrix and am having some difficulty in figuring out the exact structure of events. Currently the information I need is spread across various sections in the specification and in the JSON Schema files in `matrix-docs/event-schemas`.
From the specification itself, it's very often not clear if a particular field is required for a certain event type, and if it's not, if there is a default value for the field. It'd be very useful to have "required" (boolean) and "default" (specific value) columns added to the tables describing event fields wherever an event is detailed.
What the specification says about required fields is also not always consistent with what is in the JSON Schema files in the matrix-docs repo, if I'm understanding everything correctly. For example, section 4.7.1 (Event Fields) describes its fields as "fields all events must have," but the JSON Schema files in the Git repository don't have either of these fields marked as required (https://github.com/matrix-org/matrix-doc/blob/0.2.0/event-schemas/schema/v1/core-event-schema/event.json). In section 4.7.2, it's stated that room events "MUST" have the given fields, but again, the JSON Schema specifies only one of the three fields as required (https://github.com/matrix-org/matrix-doc/blob/0.2.0/event-schemas/schema/v1/core-event-schema/room_event.json). It's also confusing that 4.7.2 uses the standard RFC language ("MUST") but 4.7.1 does not. As the reader, it makes me wonder if this is just an inconsistency in the writing or if the fields in 4.7.1 are not actually required.
It's also difficult to use the specification as a reference for events because they are distributed across several sections in the document. The specification of event structure is intermixed with the specification of the REST API, so I have to constantly bounce around between various areas of the document to find things related to the events themselves.
(Imported from https://matrix.org/jira/browse/SPEC-276)
(Reported by Jimmy Cuadra)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with specification sections 4.7.1 and 4.7.2, then compare their event-field requirements with event-schemas/schema/v1/core-event-schema/event.json and room_event.json. Organize the event-structure reference, add required/default information where applicable, and resolve or clearly document discrepancies between the prose and schemas.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, json
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100