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 OpenAPI Specificat'ns.

Avast

This only works 'n modern browsers.

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.

Example

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

Usage

Just insert give th' URL t' yer OpenAPI Specificat'n like this:

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

If yer plank be a leaf or branch bundle, ye can also use relative URLs:

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

Th' src parameter be mandatory an' can be either an absolute or a relative URL.

Example