|
1 | 1 | // import type { ApiReferenceConfiguration as ScalarConfig } from "@scalar/api-reference"; |
2 | 2 |
|
| 3 | +/** |
| 4 | + * Swagger UI configuration options. |
| 5 | + * |
| 6 | + * @see https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/ |
| 7 | + */ |
| 8 | +export interface SwaggerUIConfig { |
| 9 | + deepLinking?: boolean; |
| 10 | + displayOperationId?: boolean; |
| 11 | + defaultModelsExpandDepth?: number; |
| 12 | + defaultModelExpandDepth?: number; |
| 13 | + defaultModelRendering?: "example" | "model"; |
| 14 | + displayRequestDuration?: boolean; |
| 15 | + docExpansion?: "list" | "full" | "none"; |
| 16 | + filter?: boolean | string; |
| 17 | + persistAuthorization?: boolean; |
| 18 | + requestSnippetsEnabled?: boolean; |
| 19 | + showExtensions?: boolean; |
| 20 | + showCommonExtensions?: boolean; |
| 21 | + /** Only "alpha" is supported (function values are not JSON-serializable). */ |
| 22 | + tagsSorter?: "alpha"; |
| 23 | + /** |
| 24 | + * Note: function callbacks cannot be passed via Nitro configuration (not JSON-serializable). |
| 25 | + */ |
| 26 | + onComplete?: never; |
| 27 | + layout?: string; |
| 28 | + configUrl?: string; |
| 29 | + oauth2RedirectUrl?: string; |
| 30 | + withCredentials?: boolean; |
| 31 | + [key: string]: unknown; |
| 32 | +} |
| 33 | + |
3 | 34 | /** |
4 | 35 | * Nitro OpenAPI configuration. |
5 | 36 | * |
@@ -57,16 +88,18 @@ export interface NitroOpenAPIConfig { |
57 | 88 | * Swagger UI configuration. |
58 | 89 | * |
59 | 90 | * Set to `false` to disable. |
| 91 | + * |
| 92 | + * @see https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/ |
60 | 93 | */ |
61 | 94 | swagger?: |
62 | 95 | | false |
63 | | - | { |
| 96 | + | (SwaggerUIConfig & { |
64 | 97 | /** |
65 | 98 | * Route for Swagger UI. |
66 | 99 | * |
67 | 100 | * @default "/_swagger" |
68 | 101 | */ |
69 | 102 | route?: string; |
70 | | - }; |
| 103 | + }); |
71 | 104 | }; |
72 | 105 | } |
0 commit comments