🔧 fix: clone hook

This commit is contained in:
saltyaom
2024-10-09 02:09:01 +07:00
parent 8c4634ad07
commit 55b86f0335
2 changed files with 3 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@elysiajs/swagger", "name": "@elysiajs/swagger",
"version": "1.1.4", "version": "1.1.5",
"description": "Plugin for Elysia to auto-generate Swagger page", "description": "Plugin for Elysia to auto-generate Swagger page",
"author": { "author": {
"name": "saltyAom", "name": "saltyAom",

View File

@@ -124,6 +124,8 @@ export const registerSchemaPath = ({
hook?: LocalHook<any, any, any, any, any, any, any> hook?: LocalHook<any, any, any, any, any, any, any>
models: Record<string, TSchema> models: Record<string, TSchema>
}) => { }) => {
hook = cloneHook(hook)
const contentType = hook?.type ?? [ const contentType = hook?.type ?? [
'application/json', 'application/json',
'multipart/form-data', 'multipart/form-data',