Commit graph

377 commits

Author SHA1 Message Date
Andrew Morgan
0d634b1935
Use yaml.safe_load instead of yaml.load in check-event-schema-examples.py (#3716) 2022-02-09 10:51:56 +00:00
Alexandre Franke
de9cf76a57
Dump additional apis (#3684)
*  Allow JSON generation for all API

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 👷 Export AS API JSON

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

*  Handle missing security definitions

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 👷 Export Push Gateway API JSON

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 🎨 Improve identation

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 🐛 Fix successive reference handling

Fixes #3689

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 👷 Export Server-Server API JSON

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 📝 Remove obsolete comment

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 🐛 Make properties objects, as they MUST be

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* Revert "👷 Export Server-Server API JSON"

This reverts commit 061f91c2cbcb6dff35c74177226da106826b4214.

Co-authored-by: Alexandre Franke <alexandre.franke@matrix.org>
2022-02-02 08:51:07 -07:00
Alexandre Franke
b6b98410c1
🐛 openapi: prepend basePath to all paths (#3642) 2022-01-19 15:39:41 +01:00
Travis Ralston
20bd445602
Add a changelog for the appendices (#3609)
As a document which is versioned, we should have a changelog for it. It might be empty most of the time but oh well.
2022-01-04 20:23:02 -07:00
Lukas Lihotzki
4415e36a74 dump-swagger.py: include untagged operations (#3326) 2022-01-04 11:58:34 -07:00
Alexandre Franke
b55cc15772
Fix links in OpenAPI description nodes (#3598)
Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>
2021-12-28 18:14:44 +01:00
Aaron Raimist
01cd41de68
Add GitHub Action to check spelling (#3591)
Signed-off-by: Aaron Raimist <aaron@raim.ist>
2021-12-28 09:17:49 -07:00
Richard van der Hoff
4b866adac1
Bump validator dependency to 13.7.0 (#3566)
`validator` 13.6 has a security advisory:
https://github.com/advisories/GHSA-qgmg-gppg-76g5

I don't think it really affects us but it's making annoying noise in the repo.
2021-12-15 11:07:25 +00:00
Alexandre Franke
806ae22da7
🚀 Make OpenAPI definition available (#3542)
* 🚀 Make OpenAPI definition available

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 💚 Fix artifact name

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 💚 Introduce dependency between jobs

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* 🚀 Make historical definitions available

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

Co-authored-by: Alexandre Franke <alexandre.franke@matrix.org>
2021-12-08 19:28:08 -07:00
Richard van der Hoff
92b29cf8e6
Add a changelog directory for room versions (#3504) 2021-11-19 11:00:37 +00:00
Travis Ralston
e8674688e6
Release process: changelog generation and docs (#3446)
* Remove extra pyprojects and update changelog docs

* Add script for rendering the changelog

* Add docs for how to release the spec

* Move legacy changelogs out of the way
2021-10-18 10:09:35 -06:00
Richard van der Hoff
61ac438871
Remove the old templating system (#3445)
* Inline resolve_references in dump-swagger

Since this is the only bit of the old templating system we still use, let's
inline it.

OrederedLoader and OrderedDict are now redundant, because all dicts in Python
preserve insertion order.

* Remove the old templating system

We've now replaced the old templates with hugo, so we can get rid of this mess.
2021-10-15 11:40:03 +01:00
Richard van der Hoff
265ebef584
Fix dump-swagger.py for PyYAML 6.0. (#3443)
PyYAML 6.0 was released yesterday, and it finally drops support for `yaml.load`
without a `loader` argument, which has been deprecated since 2017.

We don't use any fancy yaml objects, so `safe_load` should be fine.
2021-10-14 13:25:03 -06:00
Travis Ralston
5be0df02c5
Start annotating which version of the spec added a thing (#3425)
* Introduce a new "added-in" template and use it on endpoints

* Use "added-in" on schema properties too

* Annotate sections of the spec with their added versions

* Demo of "added-in" on a room version (to be fleshed out)

* Use clearer versioning semantics

* Update and fix validator for Swagger custom properties

* Fix docs
2021-10-14 13:23:04 -06:00
Travis Ralston
95d850c418
Update client-server API endpoints to move from r0 to v3 (plus whitespace fixes) (#3421)
* Blind find & replace all on client major version -> v3

* Fix up bad replacements

* Fix anchors for r0->v3

* Changelog
2021-10-12 11:07:01 -06:00
Andrew Fargo
43a71c0092
Remove all references to speculator (#3430)
Signed-off-by: DCFargo <drew.fargo@gmail.com>
2021-10-05 23:11:51 -06:00
Alexandre Franke
26c0c88882
🐛 Fix OpenAPI definition generation (#3418)
Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

Co-authored-by: Alexandre Franke <alexandre.franke@matrix.org>
2021-10-01 10:54:16 -06:00
Alexandre Franke
423d22ed23
Add API Server config for RapiDoc (#3415)
*  Add API Server config for RapiDoc

Signed-off-by: Alexandre Franke <alexandre.franke@matrix.org>

* Update scripts/dump-swagger.py

Co-authored-by: Alexandre Franke <alexandre.franke@matrix.org>
Co-authored-by: Travis Ralston <travisr@matrix.org>
2021-09-27 19:14:05 -06:00
Alexandre Franke
845e4c87db
🐛 Fix handling of postponed proposals (#3397)
Fixes #3396

Signed-off-by: Alexandre Franke <alexandre.franke@gmail.com>
2021-09-16 09:58:28 +02:00
Alexandre Franke
cbe3081685
🐛 Handle empty bodies when fetching MSCs (#3374)
Signed-off-by: Alexandre Franke <alexandre.franke@gmail.com>
2021-09-02 11:55:30 +01:00
Travis Ralston
b455fc73f1 Reference drafts properly 2021-08-27 19:17:10 +01:00
Travis Ralston
8d73a17f5b Cut out legacy build scripts 2021-08-27 19:17:10 +01:00
Andrew Morgan
a17023962c Update CircleCI and Buildkite configs to build the new spec (#3017)
This PR attempts to update the CI of matrix-doc to build [the new spec redesign](https://github.com/matrix-org/matrix-doc/issues/2906). It does so by additionally building the new spec in parallel to the old. The plan is to continue to host the old spec at https://matrix.org/docs/spec, while the new spec will be at https://spec.matrix.org. Eventually we will retire the old version of the spec, and have the old URL redirect to the new one.

In detail, this PR:
* Adds a new step to CircleCI to build the new spec with `hugo`. This step uses alpine, grabs some dependencies, and then builds the HTML.
  * We needed to hand some specific options to hugo for CircleCI in order to continue allowing CircleCI to host temporary builds of the spec after each CI run. This required changing some assumptions related to relative paths.
  * CircleCI's artifacts hosting is also quite limited. Specifically it will not automatically resolve `/some/path` to `/some/path/index.html`, which our hugo theme relied on. Fixes were implemented for this, but we may want to consider switching away from CircleCI artifacts as a host, and using something like [netlify](https://www.netlify.com/) instead.
* Modifies the existing Buildkite pipeline step to build both the new spec in a separate step. It additionally modifies the old spec to be built with alpine. (Separate out into another PR)
  * We'd like to separate out the deployment of matrix.org from the new spec. Therefore a new step, with a separate artifact build (`spec.tar.gz`). We will eventually remove the old step and the matrix.org build trigger.
* Modifies `pyproject.toml` to update the config of [giles](https://github.com/OpenAstronomy/baldrick/blob/master/baldrick/plugins/circleci_artifacts.py), which is what creates the "docs", "swagger" links in the CI steps for matrix-docs PRs.
  * A new step was added for the new spec. The old spec was renamed to "legacy".
2021-08-27 19:16:43 +01:00
Andrew Morgan
25605b65a3 Don't generate matrix assets on CircleCI (#3034)
We already do this in the buildkite pipeline, so doing so in CircleCI is just
duplicate work.
2021-08-27 19:16:43 +01:00
Will
643cdd19c8 Support rendering of proposal tables 2021-08-27 19:16:42 +01:00
Will
a0316f6794 Update path to Swagger files 2021-08-27 19:16:42 +01:00
Will
00c6a866e2 Move raw API and event schemas into /data directory
Historical note: this was originally a series of several commits, spread out
over several weeks. They have been squashed together to make `git annotate`
work properly.

The original commits were:
 * 91ab3934 <Will> 2021-01-25 21:16:42 -0800 Add raw API end event schemas into /data directory
 * aae22f47 <Will> 2021-01-25 21:33:06 -0800 Remove non-data files
 * 1092d4ca <Will> 2021-01-26 20:41:33 -0800 Add data-compatiuble extension (.yaml) to all data files that currently omit one
 * 21060109 <Will> 2021-01-26 20:57:28 -0800 Remove symlink to event-schemas, and update openAPI schema paths accordingly
 * 4f633845 <Travis Ralston> 2021-04-12 21:54:54 -0600 Fix event schema examples too
 * 301c7b2f <Will> 2021-02-05 10:15:42 -0800 Restore docs describing OpenAPI extensions that we use
2021-08-27 19:16:39 +01:00
Andrew Morgan
3c66e149f3 Move validator.js to scripts/ directory, update calls 2021-08-27 18:27:11 +01:00
Andrew Morgan
64231f079d Update checker scripts to work correctly from the scripts/ dir
check-swagger-sources also had a bug which caused it to fail while validating the directory
structure of /data/api. This was fixed by @KitsuneRal - thank you!
2021-08-27 18:27:11 +01:00
Andrew Morgan
b8dafe86f4 Move and more aptly name check_examples.py scripts 2021-08-27 18:27:07 +01:00
Will
deef4f5e7c
Suppress bullets inside table of contents 2020-10-06 14:03:37 -07:00
Travis Ralston
f0ba7f014b Update i18n for emoji 2020-08-13 11:54:56 -06:00
Travis Ralston
d37f7a25b4
Make translations for SAS emoji available in-tree (#2728)
* add a base file

* Fix directory name

* Added translation using Weblate (English)

* Translated using Weblate (English)

Currently translated at 1.6% (1 of 64 strings)

Translation: matrix-doc/SAS Emoji v1
Translate-URL: https://translate.riot.im/projects/matrix-doc/sas-emoji-v1/en_EN/

* add english files

* delete english files

* Added translation using Weblate (English)

* Added translation using Weblate (English)

* Do manual translations

* Deleted translation using Weblate (English)

* Deleted translation using Weblate (English)

* Add a script to update the definitions with the translations

* update i18n

* Add a note to the spec about translations

* changelog

* Ensure translations end with json
2020-08-12 14:04:48 -06:00
Kitsune Ral
8e7c0dfb93 Merge remote-tracking branch 'origin/master' into kitsune/cleanup 2020-06-10 21:14:49 +02:00
Travis Ralston
ffea5d5e61 Document top-level UnsignedData objects 2020-05-31 21:36:47 -06:00
Kitsune Ral
b789f3e10b dump-swagger.py: fix a typo in the help string 2020-05-28 13:56:29 +02:00
Travis Ralston
e14cf35c80
Merge pull request #2563 from matrix-org/travis/spec/2240-and-assoc--r-v6
Room Version 6
2020-05-27 07:15:22 -06:00
Travis Ralston
93f68866c5 Fix spec generation not using titles on pseudo objects 2020-05-25 08:16:05 -06:00
Travis Ralston
74c51b05a4 Incorporate MSC2209 (notifications auth rules)
MSC: https://github.com/matrix-org/matrix-doc/pull/2209

The changes are slightly difficult to word without dumping the text in and playing a game of spot the difference, so we now use our pre-existing pygments support to render a representation of the difference. The difference is shown in markdown-like format instead of RST for ease of understanding. It's also not rendered HTML for largely complexity reasons.
2020-05-20 22:14:29 -06:00
Ben Parsons
7c037d2490 improve capture and add example 2020-04-07 15:26:48 +01:00
Ben Parsons
5ae8a8bcfd fix pagination in scraper 2020-04-07 14:37:55 +01:00
Kitsune Ral
6b37bb1dd9 Merge remote-tracking branch 'remotes/origin/master' into kitsune-map-to-enum-support 2019-10-03 11:06:27 +09:00
Travis Ralston
afd5018494 Spec the terms of service handling for identity servers
Part of MSC2140

Convert status codes to strings if there is a string status code. Fixes a build error when we mix 4xx and 403 in the same definition. We also have to correct stringified numbers to pass the build.
2019-09-03 14:04:05 -06:00
Travis Ralston
de3802cd5c List deprecated endpoints as deprecated
Affects the title and the table of contents. We can't realistically alter just the table of contents, but the table of contents is generated from this header.

Fixes https://github.com/matrix-org/matrix-doc/issues/1800
2019-08-27 19:24:13 -06:00
Kitsune Ral
65cd10249c Render enums inside additionalProps as one more table
Closes #2242.
2019-08-24 21:56:48 +09:00
Jimmy Cuadra
5384b61d95 Fix style issues brought up during code review.
Signed-off-by: Jimmy Cuadra <jimmy@jimmycuadra.com>
2019-06-14 17:35:39 -07:00
Jimmy Cuadra
bc71dacaf4 Clarify the distinction between *m.key.verification.start* and its *m.sas.v1* variant.
Currently the *m.key.verification.start* event appears twice with the
exact same title, in the "Key verification framework" section and the
"Short Authentication (SAS) verification" section. It's not immediately
clear that the first occurrence describes the format of the event in
general terms and that the second occurrence describes the fields when
the *m.sas.v1* verification method is being used. This is a similar
relationship to the *m.room.message* event and its various *msgtype*
variants.

This commit does three things:

* It tweaks the generation of the documentation to change the title
  of the second occurrence of *m.key.verification.start* to
  distinguish it from the first.
* It updates the language in the description of the two versions of the
  event to better describe the relationship between the two.
* It adds the optional `next_method` field to the schema of the
  *m.sas.v1* variant, as specified in the general form of
  *m.key.verification.start*.

Signed-off-by: Jimmy Cuadra <jimmy@jimmycuadra.com>
2019-06-14 16:20:51 -07:00
Travis Ralston
e60d2defbd Fix changelog generation
Only include the target version, not all versions. Additionally, make sure the appservice spec isn't hardcoded as "unstable".
2019-06-12 13:47:09 -06:00
Travis Ralston
2d18f81807
Merge pull request #2087 from matrix-org/travis/1.0/events-are-extensible
Reorganize event structure in c2s spec and clarify event capabilities
2019-06-11 09:55:17 -06:00
Travis Ralston
4b6e2cc956
Merge pull request #2072 from matrix-org/travis/1.0/msc1717-msc1267-sas-verification
Spec SAS verification and the common key verification framework
2019-06-07 10:34:08 -06:00