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 yer Merrrmaid code 'n th' mermaid shorrrtcode like this:

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

Th' src parameter be mandatory an' can be either an absolute URL or a relative one point'n into yer Cap'n Hugo file system.

Example