Commit Graph

64 Commits (main)

Author SHA1 Message Date
Kévin Commaille 98d85cf421
Add support for rendering string formats (#1814)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 week ago
Richard van der Hoff 48f4c4954f
Include information about additionalProperties in object tables (#1798)
Currently, if we have an object which has additionalProperties in addition to properties, that information gets lost. This PR seeks to address that.
2 weeks ago
Kévin Commaille 1fc25d8d48
Do not use `title` for objects containing only `additionalProperties` or `patternProperties` (#1801)
Previously, titles would appear that do not link to a subchema definition.
It would also mean that named subschemas would appear without being clearly referenced.

Now, the type clearly shows the nesting of objects
and subschema definitions should be clearly referenced.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 weeks ago
Kévin Commaille 85ad0c767c
Render response headers (#1809)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 weeks ago
Kévin Commaille 7201042894
Fix anchors for schemas under `oneOf` (#1799)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 weeks ago
Kévin Commaille 2edfb21d5d
Add support for pattern formats for `patternProperties` (#1796)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 weeks ago
Kévin Commaille 1095179374
Upgrade version of Hugo used to build the spec in CI (#1794)
* Upgrade version of Hugo used to build the spec in CI

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Escape HTML manually in property-type partial

The behavior of `delimit` changed,
so Hugo doesn't recognize "safe" HTML passed to it anymore, so it escapes nested HTML links.

To fix that we escape the schema data manually
and consider the output of the partial as "safe".

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 weeks ago
Kévin Commaille e82829d4a2
Make resolve-allof partial recursive (#1787)
Makes it easier to use, like resolve-refs. It just needs to be called once.

Fixes an issue with m.call.* events not displaying the common fields

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
4 weeks ago
Kévin Commaille f4e7b2aa97
Fix property type resolution in render-object-table (#1789)
The split was not clear between property-type and type-or-title,
so it was not obvious which partial should be called for recursion.
That resulted in an error where type-or-title was only called for objects and array items, even if it also resolves
arrays of types.

This makes the split clearer. property-type must be called for any schema,
and object-type-or-title is only called for object schemas.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
4 weeks ago
Kévin Commaille 2678370f2c
Simplify uses of `resolve-refs` partial (#1773)
* Use the resolve-refs partial as soon as possible

Call it right after accessing the site.Data,
since it is recursing it will solve all references in the tree.
That way we don't need to wonder where to call it,
we trust the validators that the refs will be used in the right place.

* Enable strict $ref rule in OpenAPI validator

* Document use of $ref to compose examples

* Fix schema path in event-fields shortcode

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
1 month ago
Travis Ralston eb22fac5dc
Break out non-JSON request/response content types as tables (#1756)
* Break out non-JSON request/response content types as tables

Currently we display this as a table like "image/png|image/jpeg" and description on a single line, but we're using a table. This breaks the join out to individual rows.

* changelog
2 months ago
Kévin Commaille 4d7e33ec26
Add support for `$ref` URIs containing fragments in OpenAPI definitions and JSON schemas (#1751)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Kévin Commaille 542a219623
Allow `/versions` to optionally accept authentication (#1728)
* Allow /versions to optionally accept authentication

According to MSC2046.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Add changelog

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

* Set "Requires Authentication: Optional"

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>

---------

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
2 months ago
Richard van der Hoff 976ebdca2f
Update HTML templates to link to object definitions (#1724) 3 months ago
Kévin Commaille b136b357e0
Update docsy to v0.8.0 (#1699)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
3 months ago
Kévin Commaille e40d9ca186
Fix rendering of `m.receipt` event in Client-Server API (#1637)
... and other improvements

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
8 months ago
Kévin Commaille 5672bdbab7
Fix enum types in JSON schemas (#1634)
`type: enum` does not exist, as an enum can be of any type.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
8 months ago
Kévin Commaille 99e2ff4927
Replace all mentions of Swagger by OpenAPI (#1633)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
8 months ago
Kévin Commaille 50fe89d74b
Fix definition of response of `POST /_matrix/federation/v1/user/keys/claim` (#1559)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
10 months ago
Kévin Commaille a6eb381ebb
Fix the sidebar in recent versions of Hugo (#1551)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
11 months ago
Kévin Commaille 564444d43e
Render binary request and response bodies (#1579)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
11 months ago
Kévin Commaille 49957be1e3
Allow `null` in `room_types` for `POST /publicRooms` endpoints (#1564)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
11 months ago
Kévin Commaille 45b6aaf07a
Upgrade Swagger data to OpenAPI 3.1 (#1310)
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
11 months ago
David Robertson 48459dee9b
Only include titles in summaries (#1549)
I previously made this change for HTTP endpoints in #1446. It seems there are
other places where we have over-sized `<summary>` elements. I would like
to elimintate those too, as grumbled about in
https://github.com/matrix-org/matrix-spec/issues/1358#issuecomment-1325220859
and
https://github.com/matrix-org/matrix-spec/issues/1352#issuecomment-1439033334
12 months ago
Richard van der Hoff c662976fab
Fix generation of anchors for additional properties (#1488)
but objects defined under `additionalProperties` missed out on them. This fixes
that.
1 year ago
Richard van der Hoff cdbf44eef0
Fix rendering of properties with a list of types (#1487) 1 year ago
David Robertson f9ea0f9d9b
Only include endpoint path in `<summary>` (#1446) 1 year ago
Richard van der Hoff a9e9202e89
Load Inter CSS directly (#1444)
Move the load of the Inter font CSS from _variables_project.scss to head-end.html.

Empirically, this seems to fix #965
1 year ago
Richard van der Hoff 7bd48ca9c7
Stop autogenerating examples where we already have one (#1384)
If an object definition already has an example, we shouldn't try to extend that
definition by adding examples derived from the individual properties. Doing so
is confusing, and there is no way to inhibit it when it is not desired. It's
also not what the RapiDoc viewere does, so we end up with examples being
inconsistent.
1 year ago
Richard van der Hoff 1e393fbf92
Improve error messages emitted by `resolve-additional-types` (#1303)
I forgot to set the `items` on an array definition, and got an extremely
opaque error. Hopefully this will improve the lives of anyone who makes a
similar mistake in future.
2 years ago
Richard van der Hoff 08fde5f257
Generate unstable changelogs using towncrier (#1340)
Replace the current stack of hugo templates with a towncrier invocation. The main advantage of this is that it means that the "Changes since last release" section is consistent with the changelogs for the actual releases.

This also changes the release process so that the changelog is generated before tagging, which means that the thing tagged v1.5 is actually the v1.5 spec.

Fixes #908.
2 years ago
Richard van der Hoff b07fe504ed
Stop rendering CS modules and room version fragments as standalone pages (#1317)
This is actually doing two things:

 * creating `{fragments,modules}/index.md` turns the fragments and modules into
   page resources, rather than pages in their own right. We have to update the
   shortcodes to match.

 * adding `headless: true` means that we don't render the pages.

The net effect is that we don't render pages like
https://spec.matrix.org/v1.4/rooms/fragments/v1-auth-rules/ and
https://spec.matrix.org/v1.4/client-server-api/modules/account_data/.
2 years ago
Hubert Chathi d0d7bdb807 apply changes from code review 2 years ago
Hubert Chathi d6345f0df2 apply changes from code review 2 years ago
Hubert Chathi 99cd692ed0 improve display of event subtypes 2 years ago
Travis Ralston 1cdfbd3cd8
v1.4 patch release cleanup (#1268)
* Add missing steps to patch release guidelines

* Update from v1.4 patch
2 years ago
Travis Ralston 7a591366c1 v1.4 changelog 2 years ago
Patrick Cloke 1c0101ce4c Put commas between enum values. 2 years ago
David Robertson a6990ff27c
Fix spacing of mapping types (#1230)
* Fix spacing of mapping types

* Changelog
2 years ago
Richard van der Hoff ef384f1afd
Give rendered-data sections a background and some padding (#1195)
Gives definition sections for APIs, events, etc a background and a small indent, which I find very helpful to guide the eye.
2 years ago
Richard van der Hoff 5f3b34448d
Add HTML ids for object definitions in the formatted specification (#1174)
* Remove redundant call to resolve-allof

All of the callers to resolve-additional-types already call resolve-allof (or
if not, they should), so this is redundant.

* Update `resolve-additional-types` to take a dict

I want to add more params to this, so first make it take a dict.

* `render-object-table`: take a "title" rather than a "caption"

... which means we can use the result from resolve-additional-types directly.

* render-object-table: support adding an anchor to generated tables.

* resolve-additional-types: generate an id for each returned type

* render-event: pass an anchor_base into resolve-additional-types

This means that it will generate an anchor for each type, whihc will then be
passed into render-object-table and used as an `id` for the table.

* render-operation: pass an anchor_base into resolve-additional-types

* newsfiles
2 years ago
Travis Ralston 0dd3fa481b Fix changelog 2 years ago
Travis Ralston 98db9a6d04 v1.3 changelog generation 2 years ago
Richard van der Hoff dfb1bf2a5d
Fix `x-changedInMatrixVersion` for API parameters (#1011) 2 years ago
Richard van der Hoff f989d323c0
Update v1.2 changelog with missed PR (#3705) 2 years ago
Travis Ralston e488a7fb6d v1.2 changelog 2 years ago
Richard van der Hoff c3b53d5ae6
comments on resolve-allof (#3657) 2 years ago
Richard van der Hoff 783624d2cd
Fix rendering of responses with empty bodies (#3674) 2 years ago
Richard van der Hoff 3be746c9d3
Fix rendering of response examples (#3584)
* Fix rendering of response examples

Fixes the autogeneration of JSON examples for array objects. This fixes a
number of "Specification error: Example invalid or not present" errors in the
rendered spec.

* Unbreak examples for non-objects/arrays

The previous change had broken auto-generated examples for everything that
wasn't an object or array; fix it up again.

* Remove conditions on $example

Everything should now have a generated example, so the condition is
redundant. Furthermore it was suppressing examples for APIs where the example
was an empty dict.
2 years ago
Richard van der Hoff 7f200c53e8
Move `prev_content` to unsigned (#3524) 2 years ago