matrix-org / matrix-org/matrix-spec
CI doesn't fail if examples don't match the schema sometimes
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
The bug fixed by https://github.com/matrix-org/matrix-doc/pull/1879 wasn't caught by CI because the top level schema had `additionalProperties`. We might want to consider a way to detect a scenario where someone accidentally does this and erroring on it.
One potential solution is having the checker realize that `m.room_versions` (in this case) is nested in the example but not nested by the schema. Another option is to realize that `additionalProperties` rarely turns up on the top level object and complaining about that.
We could also introduce another extension (at least I think it would be an extension...) to apply a simple regex to additional properties. In this particular case, `/.*\./` would have caught the error by enforcing properties be moderately namespaced.
Contributor guide
Research direction
Start by reviewing PR 1879 and the schema/example checker behavior around nested m.room_versions and top-level additionalProperties. Compare the proposed detection strategies and define which cases CI must reject; done means accidental schema mismatches reliably fail validation.
Written by the indexing model from the issue text.
Assessment
- Domain
- ci-cd, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100