mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-26 04:54:10 +01:00
Remove mentions of Swagger in docs
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
This commit is contained in:
parent
bae676da70
commit
ec4db7f8ee
|
|
@ -22,7 +22,7 @@ The Matrix spec is compiled with [Hugo](https://gohugo.io/) (a static site gener
|
||||||
|
|
||||||
* `/data`: this can contain TOML, YAML, or JSON files. Files kept here are directly available to template code as
|
* `/data`: this can contain TOML, YAML, or JSON files. Files kept here are directly available to template code as
|
||||||
[data objects](https://gohugo.io/templates/data-templates/), so templates don't need to load them from a file and
|
[data objects](https://gohugo.io/templates/data-templates/), so templates don't need to load them from a file and
|
||||||
parse them. This is also where our Swagger/OpenAPI definitions and schemas are.
|
parse them. This is also where our OpenAPI definitions and schemas are.
|
||||||
|
|
||||||
* `/layouts`: this contains [Hugo templates](https://gohugo.io/templates/). Some templates define the overall layout of
|
* `/layouts`: this contains [Hugo templates](https://gohugo.io/templates/). Some templates define the overall layout of
|
||||||
a page: for example, whether it has header, footer, sidebar, and so on.
|
a page: for example, whether it has header, footer, sidebar, and so on.
|
||||||
|
|
@ -52,7 +52,7 @@ Additionally, the following directories may be of interest:
|
||||||
* `/data-definitions`: Bits of structured data consumable by Matrix implementations.
|
* `/data-definitions`: Bits of structured data consumable by Matrix implementations.
|
||||||
* `/meta`: Documentation relating to the spec's processes that are otherwise untracked (release instructions, etc).
|
* `/meta`: Documentation relating to the spec's processes that are otherwise untracked (release instructions, etc).
|
||||||
* `/scripts`: Various scripts for generating the spec and validating its contents.
|
* `/scripts`: Various scripts for generating the spec and validating its contents.
|
||||||
* `/packages`: Various packages for shipping spec files like OpenAPI/swagger bindings and data definitions.
|
* `/packages`: Various packages for shipping spec files like OpenAPI bindings and data definitions.
|
||||||
|
|
||||||
## Authoring changes to the spec
|
## Authoring changes to the spec
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ steps for authoring changes to the specification and instead of `hugo serve` run
|
||||||
spec to `/spec`. If you'd like to serve the spec off a path instead of a domain root (eg: `/unstable`), add `--baseURL "/unstable"`
|
spec to `/spec`. If you'd like to serve the spec off a path instead of a domain root (eg: `/unstable`), add `--baseURL "/unstable"`
|
||||||
to the `hugo -d "spec"` command.
|
to the `hugo -d "spec"` command.
|
||||||
|
|
||||||
For building the swagger definitions, create a python3 virtualenv and activate it. Then run `pip install -r ./scripts/requirements.txt`
|
For building the OpenAPI definitions, create a python3 virtualenv and activate it. Then run `pip install -r ./scripts/requirements.txt`
|
||||||
and finally `python ./scripts/dump-swagger.py` to generate it to `./scripts/swagger/api-docs.json`. To make use of the generated file,
|
and finally `python ./scripts/dump-swagger.py` to generate it to `./scripts/swagger/api-docs.json`. To make use of the generated file,
|
||||||
there are a number of options:
|
there are a number of options:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ paths:
|
||||||
one_time_keys:
|
one_time_keys:
|
||||||
# $ref: "definitions/one_time_keys.yaml"
|
# $ref: "definitions/one_time_keys.yaml"
|
||||||
# XXX: We can't define an actual object here, so we have to hope
|
# XXX: We can't define an actual object here, so we have to hope
|
||||||
# that people will look at the swagger source or can figure it out
|
# that people will look at the OpenAPI source or can figure it out
|
||||||
# from the other endpoints/example.
|
# from the other endpoints/example.
|
||||||
type: object
|
type: object
|
||||||
title: OneTimeKeys
|
title: OneTimeKeys
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{{/*
|
{{/*
|
||||||
|
|
||||||
Resolves the `allOf` keyword (https://swagger.io/specification/v2/#composition-and-inheritance-polymorphism),
|
Resolves the `allOf` keyword (https://spec.openapis.org/oas/v3.1.0#composition-and-inheritance-polymorphism),
|
||||||
given a JSON schema object.
|
given a JSON schema object.
|
||||||
|
|
||||||
`allOf` is used to support a kind of inheritance for JSON schema objects.
|
`allOf` is used to support a kind of inheritance for JSON schema objects.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Render an HTTP API, given:
|
Render an HTTP API, given:
|
||||||
|
|
||||||
* `api_data`: the OpenAPI/Swagger data
|
* `api_data`: the OpenAPI data
|
||||||
* `base_url`: the base URL: that is, the part we glue onto the front
|
* `base_url`: the base URL: that is, the part we glue onto the front
|
||||||
of each value in `paths` to get a complete URL.
|
of each value in `paths` to get a complete URL.
|
||||||
* `path`: the directory under /data where we found this API definition.
|
* `path`: the directory under /data where we found this API definition.
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
* `method`: the method, e.g. GET, PUT
|
* `method`: the method, e.g. GET, PUT
|
||||||
* `endpoint`: the endpoint
|
* `endpoint`: the endpoint
|
||||||
* `operation_data`: the OpenAPI/Swagger data for the operation
|
* `operation_data`: the OpenAPI data for the operation
|
||||||
* `path`: the path where this definition was found, to enable us to resolve "$ref"
|
* `path`: the path where this definition was found, to enable us to resolve "$ref"
|
||||||
|
|
||||||
This template renders the operation as a `<section>` containing:
|
This template renders the operation as a `<section>` containing:
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Render the parameters of a given type, given:
|
Render the parameters of a given type, given:
|
||||||
|
|
||||||
* `parameters`: OpenAPI/Swagger data specifying the parameters
|
* `parameters`: OpenAPI data specifying the parameters
|
||||||
* `type`: the type of parameters to render: "header, ""path", "query"
|
* `type`: the type of parameters to render: "header, ""path", "query"
|
||||||
* `caption`: caption to use for the table
|
* `caption`: caption to use for the table
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
Render the request part of a single HTTP API operation, given:
|
Render the request part of a single HTTP API operation, given:
|
||||||
|
|
||||||
* `parameters`: OpenAPI/Swagger data specifying the parameters
|
* `parameters`: OpenAPI data specifying the parameters
|
||||||
* `request_body`: OpenAPI/Swagger data specifying the request body
|
* `request_body`: OpenAPI data specifying the request body
|
||||||
* `path`: the path where this definition was found, to enable us to resolve "$ref"
|
* `path`: the path where this definition was found, to enable us to resolve "$ref"
|
||||||
* `anchor_base`: a prefix to add to the HTML anchors generated for each object
|
* `anchor_base`: a prefix to add to the HTML anchors generated for each object
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Render the response part of a single HTTP API operation, given:
|
Render the response part of a single HTTP API operation, given:
|
||||||
|
|
||||||
* `responses`: OpenAPI/Swagger data specifying the responses
|
* `responses`: OpenAPI data specifying the responses
|
||||||
* `path`: the path where this definition was found, to enable us to resolve "$ref"
|
* `path`: the path where this definition was found, to enable us to resolve "$ref"
|
||||||
* `anchor_base`: a prefix to add to the HTML anchors generated for each object
|
* `anchor_base`: a prefix to add to the HTML anchors generated for each object
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
{{/*
|
{{/*
|
||||||
|
|
||||||
This template is used to render an HTTP API, given an OpenAPI/Swagger definition.
|
This template is used to render an HTTP API, given an OpenAPI definition.
|
||||||
|
|
||||||
It expects to be passed two parameters:
|
It expects to be passed two parameters:
|
||||||
|
|
||||||
* a `spec` parameter identifying the spec, which must be the name of
|
* a `spec` parameter identifying the spec, which must be the name of
|
||||||
a directory under /data/api
|
a directory under /data/api
|
||||||
* an `api` parameter, identifying an OpenAPI/Swagger definition,
|
* an `api` parameter, identifying an OpenAPI definition,
|
||||||
which is the name of a schema file under "data/api/$spec".
|
which is the name of a schema file under "data/api/$spec".
|
||||||
The file extension is omitted. For example:
|
The file extension is omitted. For example:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# dump-swagger reads all of the swagger API docs used in spec generation and
|
# dump-swagger reads all of the OpenAPI docs used in spec generation and
|
||||||
# outputs a JSON file which merges them all, for use as input to a swagger UI
|
# outputs a JSON file which merges them all, for use as input to an OpenAPI
|
||||||
# viewer.
|
# viewer.
|
||||||
# See https://github.com/swagger-api/swagger-ui for details of swagger-ui.
|
|
||||||
|
|
||||||
# Copyright 2016 OpenMarket Ltd
|
# Copyright 2016 OpenMarket Ltd
|
||||||
#
|
#
|
||||||
|
|
@ -85,7 +84,7 @@ def edit_links(node, base_url):
|
||||||
edit_links(item, base_url)
|
edit_links(item, base_url)
|
||||||
|
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
"dump-swagger.py - assemble the Swagger specs into a single JSON file"
|
"dump-swagger.py - assemble the OpenAPI specs into a single JSON file"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--base-url", "-b",
|
"--base-url", "-b",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
# Runs an HTTP server on localhost:8000 which will serve the generated swagger
|
# Runs an HTTP server on localhost:8000 which will serve the generated OpenAPI
|
||||||
# JSON so that it can be viewed in an online swagger UI.
|
# JSON so that it can be viewed in an online OpenAPI viewer.
|
||||||
|
|
||||||
# Copyright 2016 OpenMarket Ltd
|
# Copyright 2016 OpenMarket Ltd
|
||||||
#
|
#
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue