OrchidSwagger

Embed the Swagger UI within any Orchid page.


About

The OrchidSwagger makes it convenient to embed the Swagger UI in your documentation site.

Installation

dependencies {
    orchidRuntime("io.github.javaeden.orchid:OrchidSwagger:0.21.2")
}
<dependency>
    <groupId>io.github.javaeden.orchid</groupId>
    <artifactId>OrchidSwagger</artifactId>
    <version>0.21.2</version>
    <type>pom</type>
</dependency>
libraryDependencies += "io.github.javaeden.orchid" % "OrchidSwagger" % "0.21.2"
@file:DependsOn("io.github.javaeden.orchid:OrchidSwagger:0.21.2")

Demo

Usage

The OrchidSwagger plugin allows you to add the swagger component to any page. This will include the Swagger UI Javascript and CSS necessary to use the Swagger UI, you just need to supply the component with the URL of your OpenAPI JSON definition. Note that, since the Swagger UI fetches the openApiSource in the browser, the URL given must not be blocked by CORS.

// pages/api.md
---
components:
  - type: 'swaggerUi'
    openApiSource: 'https://petstore.swagger.io/v2/swagger.json'
---