# {{ $key }} {{ range .tags }} {{ . }} {{ end }}
{{ with .description }}{{ . }}
{{ end }}
{{ with .schema }}
{{ template "schema" . }}
{{ end }}
{{ define "schema" }} {{ with .description }}
{{ . }}{{ end }}
{{ with .element }}
{{ with $.name }}
{{ . }}:
{{ end }}
{{ if (eq $.kind "array") }}
arrayOf [
{{ template "schema" . }}
]
{{ end }}
{{ if (eq $.kind "dictionary") }}
dictionary
<
{{ $.key.name }}, {{ template "schema" . }}>
{{ end }}
{{ else }}
{{ if (eq .name .kind) }}
{{ .kind }}
{{ else }}
{{ with .name }}
{{ . }}{{ if $.isPointer }}
*
{{ end }}:
{{ end }}
{{ if (eq $.kind "enum") }}
enum (
{{ with $.enumValues }}{{ delimit . " | " }}{{ end }}
)
{{ else }}
{{ .kind }}
{{ end }}
{{ end }}
{{ with .keys }}
{
{{ range . }}
- {{ template "schema" . }}
{{ end }}
}
{{ end }}
{{ end }}
{{ end }}
{{ define "main" }}
{{ $datafile := index .Site.Data.api .Params.version }}
{{ $keys := $datafile.api }}