mirror of
https://github.com/zoriya/elysia-swagger.git
synced 2025-12-06 00:36:10 +00:00
🔧 fix: reference model path
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
# 0.7.2 - 21 Sep 2023
|
||||
Bug fix:
|
||||
- Paths is undefined
|
||||
- Models is not showing
|
||||
|
||||
# 0.7.1 - 20 Sep 2023
|
||||
Bug fix:
|
||||
- Add openapi-types as dependencies
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@elysiajs/swagger",
|
||||
"version": "0.7.1",
|
||||
"version": "0.7.2",
|
||||
"description": "Plugin for Elysia to auto-generate Swagger page",
|
||||
"author": {
|
||||
"name": "saltyAom",
|
||||
@@ -40,7 +40,7 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.1.4",
|
||||
"bun-types": "^0.7.0",
|
||||
"elysia": "0.7.0",
|
||||
"elysia": "0.7.5",
|
||||
"eslint": "^8.40.0",
|
||||
"rimraf": "4.3",
|
||||
"typescript": "^5.0.4"
|
||||
|
||||
@@ -89,7 +89,7 @@ export const swagger =
|
||||
method: route.method,
|
||||
path: route.path,
|
||||
// @ts-ignore
|
||||
models: app.definitions,
|
||||
models: app.definitions.type,
|
||||
contentType: route.hooks.type
|
||||
})
|
||||
})
|
||||
@@ -114,7 +114,7 @@ export const swagger =
|
||||
...documentation.components,
|
||||
schemas: {
|
||||
// @ts-ignore
|
||||
...app.definitions,
|
||||
...app.definitions.type,
|
||||
...documentation.components?.schemas
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +180,8 @@ export const registerSchemaPath = ({
|
||||
)
|
||||
}
|
||||
} else if (typeof responseSchema === 'string') {
|
||||
if(!(responseSchema in models)) return
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { type, properties, required, ...rest } = models[
|
||||
responseSchema
|
||||
|
||||
Reference in New Issue
Block a user