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/layouts/partials/openapi/render-parameters.html

31 lines
895 B
HTML

{{/*
Render the parameters of a given type, given:
* `parameters`: OpenAPI/Swagger data specifying the parameters
* `type`: the type of parameters to render: "header, ""path", "query"
* `caption`: caption to use for the table
This template renders a single table containing parameters of the given type.
*/}}
{{ $parameters := .parameters }}
{{ $type := .type }}
{{ $caption := .caption }}
{{ $parameters_of_type := where $parameters "in" $type }}
{{ with $parameters_of_type }}
{{/* build a dict mapping from name->parameter, which render-object-table expects */}}
{{ $param_dict := dict }}
{{ range $parameter := . }}
{{ $param_dict = merge $param_dict (dict $parameter.name $parameter )}}
{{ end }}
{{/* and render the parameters */}}
{{ partial "openapi/render-object-table" (dict "caption" $caption "properties" $param_dict) }}
{{ end }}