@elysiajs/swagger
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -8,3 +8,3 @@ import { type Elysia } from 'elysia'; | ||
*/ | ||
export declare const swagger: <Path extends string = "/swagger">({ provider, scalarVersion, scalarCDN, scalarConfig, documentation, version, excludeStaticFile, path, exclude, swaggerOptions, theme, autoDarkMode, excludeMethods }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<"", false, { | ||
export declare const swagger: <Path extends string = "/swagger">({ provider, scalarVersion, scalarCDN, scalarConfig, documentation, version, excludeStaticFile, path, exclude, swaggerOptions, theme, autoDarkMode, excludeMethods, excludeTags }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<"", false, { | ||
decorator: {}; | ||
@@ -11,0 +11,0 @@ store: {}; |
@@ -12,3 +12,3 @@ "use strict"; | ||
*/ | ||
const swagger = ({ provider = 'scalar', scalarVersion = 'latest', scalarCDN = '', scalarConfig = {}, documentation = {}, version = '5.9.0', excludeStaticFile = true, path = '/swagger', exclude = [], swaggerOptions = {}, theme = `https://unpkg.com/swagger-ui-dist@${version}/swagger-ui.css`, autoDarkMode = true, excludeMethods = ['OPTIONS'] } = { | ||
const swagger = ({ provider = 'scalar', scalarVersion = 'latest', scalarCDN = '', scalarConfig = {}, documentation = {}, version = '5.9.0', excludeStaticFile = true, path = '/swagger', exclude = [], swaggerOptions = {}, theme = `https://unpkg.com/swagger-ui-dist@${version}/swagger-ui.css`, autoDarkMode = true, excludeMethods = ['OPTIONS'], excludeTags = [] } = { | ||
provider: 'scalar', | ||
@@ -25,3 +25,4 @@ scalarVersion: 'latest', | ||
autoDarkMode: true, | ||
excludeMethods: ['OPTIONS'] | ||
excludeMethods: ['OPTIONS'], | ||
excludeTags: [] | ||
}) => (app) => { | ||
@@ -64,3 +65,3 @@ const schema = {}; | ||
}); | ||
}).get(`${path}/json`, () => { | ||
}).get(path === '/' ? '/json' : `${path}/json`, () => { | ||
const routes = app.routes; | ||
@@ -87,2 +88,3 @@ if (routes.length !== totalRoutes) { | ||
...documentation, | ||
tags: documentation.tags?.filter((tag) => !excludeTags?.includes(tag?.name)), | ||
info: { | ||
@@ -89,0 +91,0 @@ title: 'Elysia Documentation', |
@@ -92,2 +92,6 @@ import type { OpenAPIV3 } from 'openapi-types'; | ||
excludeMethods?: string[]; | ||
/** | ||
* Exclude tags from Swagger or Scalar | ||
*/ | ||
excludeTags?: string[]; | ||
} |
@@ -8,3 +8,3 @@ import { type Elysia } from 'elysia'; | ||
*/ | ||
export declare const swagger: <Path extends string = "/swagger">({ provider, scalarVersion, scalarCDN, scalarConfig, documentation, version, excludeStaticFile, path, exclude, swaggerOptions, theme, autoDarkMode, excludeMethods }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<"", false, { | ||
export declare const swagger: <Path extends string = "/swagger">({ provider, scalarVersion, scalarCDN, scalarConfig, documentation, version, excludeStaticFile, path, exclude, swaggerOptions, theme, autoDarkMode, excludeMethods, excludeTags }?: ElysiaSwaggerConfig<Path>) => (app: Elysia) => Elysia<"", false, { | ||
decorator: {}; | ||
@@ -11,0 +11,0 @@ store: {}; |
@@ -9,3 +9,3 @@ import { SwaggerUIRender } from './swagger'; | ||
*/ | ||
export const swagger = ({ provider = 'scalar', scalarVersion = 'latest', scalarCDN = '', scalarConfig = {}, documentation = {}, version = '5.9.0', excludeStaticFile = true, path = '/swagger', exclude = [], swaggerOptions = {}, theme = `https://unpkg.com/swagger-ui-dist@${version}/swagger-ui.css`, autoDarkMode = true, excludeMethods = ['OPTIONS'] } = { | ||
export const swagger = ({ provider = 'scalar', scalarVersion = 'latest', scalarCDN = '', scalarConfig = {}, documentation = {}, version = '5.9.0', excludeStaticFile = true, path = '/swagger', exclude = [], swaggerOptions = {}, theme = `https://unpkg.com/swagger-ui-dist@${version}/swagger-ui.css`, autoDarkMode = true, excludeMethods = ['OPTIONS'], excludeTags = [] } = { | ||
provider: 'scalar', | ||
@@ -22,3 +22,4 @@ scalarVersion: 'latest', | ||
autoDarkMode: true, | ||
excludeMethods: ['OPTIONS'] | ||
excludeMethods: ['OPTIONS'], | ||
excludeTags: [] | ||
}) => (app) => { | ||
@@ -61,3 +62,3 @@ const schema = {}; | ||
}); | ||
}).get(`${path}/json`, () => { | ||
}).get(path === '/' ? '/json' : `${path}/json`, () => { | ||
const routes = app.routes; | ||
@@ -84,2 +85,3 @@ if (routes.length !== totalRoutes) { | ||
...documentation, | ||
tags: documentation.tags?.filter((tag) => !excludeTags?.includes(tag?.name)), | ||
info: { | ||
@@ -86,0 +88,0 @@ title: 'Elysia Documentation', |
@@ -92,2 +92,6 @@ import type { OpenAPIV3 } from 'openapi-types'; | ||
excludeMethods?: string[]; | ||
/** | ||
* Exclude tags from Swagger or Scalar | ||
*/ | ||
excludeTags?: string[]; | ||
} |
{ | ||
"name": "@elysiajs/swagger", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Plugin for Elysia to auto-generate Swagger page", | ||
@@ -5,0 +5,0 @@ "author": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
161053
4141