You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
matrix-spec-proposals/layouts/shortcodes/http-api.html

27 lines
879 B
HTML

{{/*
This template is used to render an HTTP API, given an OpenAPI/Swagger definition.
It expects to be passed two parameters:
* a `spec` parameter identifying the spec, which must be the name of
a directory under /data/api
* an `api` parameter, identifying an OpenAPI/Swagger definition,
which is the name of a schema file under "data/api/$spec".
The file extension is omitted. For example:
{{% http-api spec="server-server" api="public_rooms" %}}
This template replaces the old {{*_http_api}} template.
*/}}
{{ $spec := .Params.spec}}
{{ $api := .Params.api}}
{{ $api_data := index .Site.Data.api .Params.spec .Params.api }}
{{ $base_url := replace $api_data.basePath "%CLIENT_MAJOR_VERSION%" "r0" }}
{{ $path := delimit (slice "api" $spec) "/" }}
{{ partial "openapi/render-api" (dict "api_data" $api_data "base_url" $base_url "path" $path) }}