SwaggerUI API
Render the Academy Theme swaggerui-api shortcode.
1 minute read
The swaggerui-api shortcode renders an interactive Swagger UI viewer for an OpenAPI spec.
{{< swaggerui-api src="example.json" >}}
{{< swaggerui-api src="/data/openapi.json" >}}
Parameters:
| Parameter | Description | Default |
|---|---|---|
src | Path to the OpenAPI spec. Root-relative paths (files under static/) are used as-is; anything else resolves against the page bundle, then assets/ | (required) |
deepLinking | "true" writes the expanded operation into the URL fragment. Only safe with one viewer per page | "false" |
Example:
Place the spec alongside index.md in a page bundle to keep it with the page that uses it, or in assets/ to share it across pages. The spec must be part of this site — remote URLs are rejected at build time.