mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-28 22:14:10 +01:00
render-operation: pass an anchor_base into resolve-additional-types
This commit is contained in:
parent
06d3ad4d2c
commit
a0c9f6b6e2
|
|
@ -22,13 +22,14 @@
|
||||||
{{ $endpoint := .endpoint }}
|
{{ $endpoint := .endpoint }}
|
||||||
{{ $operation_data := .operation_data }}
|
{{ $operation_data := .operation_data }}
|
||||||
{{ $path := .path }}
|
{{ $path := .path }}
|
||||||
|
{{ $anchor := anchorize $endpoint }}
|
||||||
|
|
||||||
<section class="rendered-data http-api {{ $method }}">
|
<section class="rendered-data http-api {{ $method }}">
|
||||||
|
|
||||||
<details {{ if not site.Params.ui.rendered_data_collapsed }}open{{ end }}>
|
<details {{ if not site.Params.ui.rendered_data_collapsed }}open{{ end }}>
|
||||||
<summary>
|
<summary>
|
||||||
|
|
||||||
<h1 id="{{ lower $method }}{{ anchorize $endpoint }}">
|
<h1 id="{{ lower $method }}{{ $anchor }}">
|
||||||
<span class="http-api-method {{ $method }}">{{ $method }}</span>
|
<span class="http-api-method {{ $method }}">{{ $method }}</span>
|
||||||
<span class="endpoint{{ if $operation_data.deprecated }} deprecated-inline{{ end }}">{{ $endpoint }}</span>
|
<span class="endpoint{{ if $operation_data.deprecated }} deprecated-inline{{ end }}">{{ $endpoint }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
@ -63,9 +64,9 @@
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<hr/>
|
<hr/>
|
||||||
{{ partial "openapi/render-request" (dict "parameters" $operation_data.parameters "path" $path) }}
|
{{ partial "openapi/render-request" (dict "parameters" $operation_data.parameters "path" $path "anchor_base" $anchor ) }}
|
||||||
<hr/>
|
<hr/>
|
||||||
{{ partial "openapi/render-responses" (dict "responses" $operation_data.responses "path" $path) }}
|
{{ partial "openapi/render-responses" (dict "responses" $operation_data.responses "path" $path "anchor_base" $anchor ) }}
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
* `parameters`: OpenAPI/Swagger data specifying the parameters
|
* `parameters`: OpenAPI/Swagger data specifying the parameters
|
||||||
* `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
|
||||||
|
|
||||||
This template renders:
|
This template renders:
|
||||||
* the "simple parameters" (header, path, query parameters)
|
* the "simple parameters" (header, path, query parameters)
|
||||||
|
|
@ -14,6 +15,7 @@
|
||||||
|
|
||||||
{{ $parameters := .parameters }}
|
{{ $parameters := .parameters }}
|
||||||
{{ $path := .path }}
|
{{ $path := .path }}
|
||||||
|
{{ $anchor_base := .anchor_base }}
|
||||||
|
|
||||||
<h2>Request</h2>
|
<h2>Request</h2>
|
||||||
|
|
||||||
|
|
@ -38,7 +40,7 @@
|
||||||
{{ $schema := partial "json-schema/resolve-refs" (dict "schema" $body_parameter.schema "path" $path) }}
|
{{ $schema := partial "json-schema/resolve-refs" (dict "schema" $body_parameter.schema "path" $path) }}
|
||||||
{{ $schema := partial "json-schema/resolve-allof" $schema }}
|
{{ $schema := partial "json-schema/resolve-allof" $schema }}
|
||||||
|
|
||||||
{{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $schema) }}
|
{{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $schema "anchor_base" $anchor_base) }}
|
||||||
{{ $additional_types = uniq $additional_types }}
|
{{ $additional_types = uniq $additional_types }}
|
||||||
{{ range $additional_types }}
|
{{ range $additional_types }}
|
||||||
{{ partial "openapi/render-object-table" . }}
|
{{ partial "openapi/render-object-table" . }}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
* `responses`: OpenAPI/Swagger data specifying the responses
|
* `responses`: OpenAPI/Swagger 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
|
||||||
|
|
||||||
This template renders:
|
This template renders:
|
||||||
* a summary of all the different responses
|
* a summary of all the different responses
|
||||||
|
|
@ -15,6 +16,7 @@
|
||||||
|
|
||||||
{{ $responses := .responses }}
|
{{ $responses := .responses }}
|
||||||
{{ $path := .path }}
|
{{ $path := .path }}
|
||||||
|
{{ $anchor_base := .anchor_base }}
|
||||||
|
|
||||||
<h2>Responses</h2>
|
<h2>Responses</h2>
|
||||||
|
|
||||||
|
|
@ -71,7 +73,7 @@
|
||||||
response. (This will be a no-op for response types which aren't
|
response. (This will be a no-op for response types which aren't
|
||||||
objects or arrays.)
|
objects or arrays.)
|
||||||
*/}}
|
*/}}
|
||||||
{{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $schema) }}
|
{{ $additional_types := partial "json-schema/resolve-additional-types" (dict "schema" $schema "anchor_base" $anchor_base) }}
|
||||||
{{ $additional_types = uniq $additional_types }}
|
{{ $additional_types = uniq $additional_types }}
|
||||||
{{ range $additional_types }}
|
{{ range $additional_types }}
|
||||||
{{ partial "openapi/render-object-table" . }}
|
{{ partial "openapi/render-object-table" . }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue