-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
openapi: replace implementation with swagger-ui #523
- Loading branch information
Showing
44 changed files
with
4,071 additions
and
4,199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
description: "UI for your OpenAPI / Swagger specifications" | ||
title: "OpenAPI" | ||
--- | ||
|
||
The `openapi` shortcode uses the [Swagger UI](https://github.com/swagger-api/swagger-ui) library to display your OpenAPI / Swagger specifications. | ||
|
||
{{% notice note %}} | ||
This only works in modern browsers. | ||
{{% /notice %}} | ||
|
||
## Usage | ||
|
||
While the examples are using shortcodes with named parameter you are free to also call this shortcode from your own partials. | ||
|
||
{{< tabs groupId="shortcode-parameter">}} | ||
{{% tab name="shortcode" %}} | ||
|
||
````go | ||
{{</* openapi src="https://petstore3.openapi.io/api/v3/openapi.json" */>}} | ||
```` | ||
|
||
{{% /tab %}} | ||
{{% tab name="partial" %}} | ||
|
||
````go | ||
{{ partial "shortcodes/openapi.html" (dict | ||
"context" . | ||
"src" "https://petstore3.openapi.io/api/v3/openapi.json" | ||
)}} | ||
```` | ||
|
||
{{% /tab %}} | ||
{{< /tabs >}} | ||
|
||
### Parameter | ||
|
||
| Name | Default | Notes | | ||
|:---------------------|:-----------------|:------------| | ||
| **src** | _<empty>_ | The URL to the OpenAPI specification file. This can be relative to the URL of your page if it is a leaf or branch bundle. | | ||
|
||
{{% notice note %}} | ||
If you want to print out (or generate a PDF) from your OpenAPI documentation, don't initiate printing directly from the page because the elements are optimized for interactive usage in a browser. | ||
|
||
Instead, open the [print preview]({{% relref "basics/configuration/#activate-print-support" %}}) in your browser and initiate printing from that page. This page is optimized for reading and expands most of the available sections. | ||
{{% /notice %}} | ||
|
||
## Example | ||
|
||
### Using Local File | ||
|
||
````go | ||
{{</* openapi src="petstore.json" */>}} | ||
```` | ||
|
||
{{< openapi src="petstore.json" >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
description: "Adds UI fer yer OpenAPI / Swaggerrr Specificat'ns" | ||
title: "OpenAPI" | ||
--- | ||
{{< piratify true >}} |
Oops, something went wrong.