{{ .Title }}
- {{ $openapi := index site.Data.api .Params.apidata }} - {{ printf "## %s version %s" $openapi.info.title $openapi.info.version | .RenderString }} - {{ .RenderString $openapi.info.description }} - {{ range $path, $pathKeys := $openapi.paths }} - {{ range $key, $properties := $pathKeys }} - {{ if in "get put patch post delete" $key }} - {{ if isset $properties "operationId" }} - {{ printf "### %s {#%s}" $properties.summary $properties.operationId | $.RenderString }} - {{ else }} - {{ printf "### %s {#%s}" $properties.summary (urlize $properties.summary) | $.RenderString }} - {{ end }} - {{ $badgeColors := (dict - "get" "bg-blue-light-500 dark:bg-blue-dark-300" - "head" "bg-gray-light-500 dark:bg-gray-dark-300" - "put" "bg-green-light-500 dark:bg-green-dark-300" - "post" "bg-violet-light-500 dark:bg-violet-dark-300" - "delete" "bg-red-light-500 dark:bg-red-dark-300" - "patch" "bg-amber-light-500 dark:bg-amber-dark-500" - ) - }} - {{ $key }}{{ $path }}
- {{ $curlExample := printf
- `curl -X %s \
- "%sapi%s"` ($key | upper) (index $openapi.servers 0).url $path
- }}
- {{ highlight $curlExample "console" }}
- {{ $properties.description | $.RenderString (dict "display" "block") }}
- {{ with $properties.parameters }}
- {{ T "apiPropParam" }} | -{{ T "apiPropType" }} | -{{ T "apiPropValue" }} | -{{ T "apiPropReq" }} | -{{ T "apiPropDesc" }} | -
---|---|---|---|---|
{{ $paramData.name }} | -{{ $paramData.in }} | -
- {{ if isset $paramData.schema "$ref" }}
- {{ $refName := index (last 1 (split (index $paramData.schema "$ref") "/")) 0 }}
- {{ range (index $openapi.components.schemas $refName).enum }}
- {{ . }}
- {{ end }}
- {{ else }}
- {{ $paramData.schema.type }}
- {{ end }}
- |
- {{ $paramData.required }} | -{{ $paramData.description | $.RenderString }} | -
{{ (index $openapi.components.examples $component).value | jsonify (dict "indent" " ") }}
-
- {{- $example.value | jsonify (dict "indent" " ") }}
-
- {{ end }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ end }}
- {{ end }}
-