matrix-org / matrix-spec

The Matrix protocol specification
Apache License 2.0
170 stars 90 forks source link

Do not add empty arrays to examples #1849

Closed zecakeh closed 2 weeks ago

zecakeh commented 3 weeks ago

Effectively, this only changes the rendering of the example of https://spec.matrix.org/v1.10/application-service-api/#registration

Result

Pull Request Checklist

Preview: https://pr1849--matrix-spec-previews.netlify.app

zecakeh commented 3 weeks ago

It was the intended result for me. Especially getting rid of [ null ] which is always wrong. If we want to have a list it is always possible to provide it as an example in the schema, but without this change it is not possible to remove empty lists that have no examples.

The fact that this example is still wrong is another issue. A complete example should probably be provided since we cannot generate a valid one with the current schema.

IMO, this brings to light the issue that we don't check those generated examples in CI. To do that we would need to re-implement the example generation for CI. Or to stop relying on generated examples and always provide full examples, because they are easier to check. The thing though is that we rely heavily on them.