🎉 feat: 0.1.1

This commit is contained in:
saltyaom
2023-01-08 22:44:38 +07:00
parent 8742413bed
commit 594e58c832
5 changed files with 14 additions and 11 deletions
+4
View File
@@ -1,3 +1,7 @@
# 0.1.1 - 8 Jan 2023
Bug fix:
- Infers path type
# 0.1.0-rc.3 - 13 Dec 2022
Improvement:
- Add support for Elysia 0.1.0-rc.5
BIN
View File
Binary file not shown.
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "@elysiajs/swagger",
"version": "0.1.0",
"version": "0.1.1",
"description": "Plugin for Elysia to auto-generate Swagger page",
"author": {
"name": "saltyAom",
@@ -33,18 +33,18 @@
"release": "npm run build && npm run test && npm publish --access public"
},
"peerDependencies": {
"elysia": ">= 0.1.0-rc.5"
"elysia": ">= 0.1.0"
},
"devDependencies": {
"@types/node": "^18.11.7",
"@types/swagger-ui-dist": "^3.30.1",
"bun-types": "^0.2.2",
"eslint": "^8.26.0",
"elysia": "^0.1.0-rc.5",
"elysia": "^0.1.0",
"typescript": "^4.8.4"
},
"dependencies": {
"@elysiajs/static": "0.1.0-rc.1",
"@elysiajs/static": "0.1.0",
"openapi-types": "^12.0.2",
"swagger-ui-dist": "^4.15.5"
}
+4 -5
View File
@@ -21,16 +21,16 @@ const defaultConfig: Partial<OpenAPIV2.Document> = {
* @see https://github.com/elysiajs/elysia-swagger
*/
export const swagger =
(
<Path extends string = '/swagger'>(
{
swagger = {},
excludeStaticFile = true,
path = '/swagger',
path = '/swagger' as Path,
exclude = []
}: ElysiaSwaggerConfig = {
}: ElysiaSwaggerConfig<Path> = {
swagger: {},
excludeStaticFile: true,
path: '/swagger',
path: '/swagger' as Path,
exclude: []
}
) =>
@@ -59,7 +59,6 @@ export const swagger =
...swagger.info
}
},
// @ts-ignore
paths: filterPaths(context.store[SCHEMA], {
excludeStaticFile,
exclude: Array.isArray(exclude) ? exclude : [exclude]
+2 -2
View File
@@ -1,6 +1,6 @@
import type { OpenAPIV2 } from "openapi-types"
export interface ElysiaSwaggerConfig {
export interface ElysiaSwaggerConfig<Path extends string = '/swagger'> {
/**
* Customize Swagger config, refers to Swagger 2.0 config
*
@@ -18,7 +18,7 @@ export interface ElysiaSwaggerConfig {
*
* @default '/swagger'
*/
path?: string
path?: Path
/**
* Paths to exclude from Swagger endpoint
*