OpenAPI
Th' openapi
shortcode uses th' Swagger UI library t' display yer OpenAPI / Swagger specificat'ns.
Usage
While th' examples be us'n shorrrtcodes wit' named parameter ye be free t' also call this shortcode from yer own partials.
{{< openapi src="https://petstore3.openapi.io/api/v3/openapi.json" >}}
{{ partial "shortcodes/openapi.html" (dict
"page" .
"src" "https://petstore3.openapi.io/api/v3/openapi.json"
)}}
Parameter
Name | Default | Notes |
---|---|---|
src | <empty> | Th' path t' th' t' th' OpenAPI specificat'n resource or URL t' be used. Resource paths adhere t' Hugo’s logical path. |
Avast
If ye want t' print out (or generate a PDF) from yer OpenAPI documentat'n, don’t initiate print'n directly from th' plank because th' elements be optimized fer interactive usage 'n a browser.
Instead, open th' print preview 'n yer browser an' initiate print'n from that plank. This plank be optimized fer read'n an' expands most o' th' avail'ble sections.
Example
Us'n Local File
{{< openapi src="petstore.json" >}}