Embed the Swagger UI within any Orchid page.
The OrchidSwagger makes it convenient to embed the Swagger UI in your documentation site.
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'
---
dependencies {
orchidRuntime("io.github.javaeden.orchid:OrchidSwagger:0.18.0")
}
<dependency>
<groupId>io.github.javaeden.orchid</groupId>
<artifactId>OrchidSwagger</artifactId>
<version>0.18.0</version>
<type>pom</type>
</dependency>
@file:DependsOn("io.github.javaeden.orchid:OrchidSwagger:0.18.0")