Swaggerrr

Arrr! Pirrrates

Fello' pirrates, be awarrre some featurrres may not work fer us in this trrranslat'n. Like table of rrramblings, some Merrrmaids and stuff.

This shorrrtcode uses th' RapiDoc library t' display yer Swagger / OpenAPI Specificat'ns.

Avast

This only works 'n modern browsers.

Usage

{{< swagger src="https://petstore3.swagger.io/api/v3/openapi.json" >}}

Parameter

Name Default Notes
src <empty> Th' URL t' th' OpenAPI Specificat'n file. This can be relative t' th' URL o' yer plank if it be a leaf or branch bundle.

Configurat'n

Swagger be configured wit' default sett'ns. Ye can cust'mize Swagger’s default sett'ns fer all o' yer files thru a JSON object 'n yer config.toml or override these sett'ns per plank thru yer planks frontmatter.

Th' JSON object o' yer config.toml / frontmatter be forwarded into Swagger’s initializat'n. At th' moment, only th' theme sett'n be supported.

Th' theme sett'n can also be set by yer used color variant. This will be th' sitewide default an' can - again - be overridden by yer sett'ns 'n config.toml or frontmatter.

Global Configurat'n File

[params]
  swaggerInitialize = "{ \"theme\": \"dark\" }"

Example

Us'n Local File

{{< swagger src="petstore.json" >}}