-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Description
After upgrading to 1.4.12, hitting /docs/json on my elysia app spits out dozens of errors like this:
TypeError: Cannot read properties of undefined (reading 'target')
at Object.output (/workspace/node_modules/@ark/schema/out/roots/root.js:45:67)
at unwrapSchema (/workspace/node_modules/@elysiajs/openapi/dist/index.mjs:2959:48)
at toOpenAPISchema (/workspace/node_modules/@elysiajs/openapi/dist/index.mjs:3268:26)
at openAPISchema (/workspace/node_modules/@elysiajs/openapi/dist/index.mjs:10240:9)
at handle (eval at composeHandler (file:///workspace/vgback/elysia.init.js:399:52), <anonymous>:26:13)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Reproduction
import { Elysia } from 'elysia';
import { openapi } from '@elysiajs/openapi';
import { type } from 'arktype';
const ResponseType = type({
items: type({ id: 'string', name: 'string' }).array(),
});
new Elysia()
.use(openapi())
.get('/test', () => ({ items: [] }), {
response: ResponseType,
})
.listen(3000);Then visit http://localhost:3000/openapi/json
Error
TypeError: undefined is not an object (evaluating 'opts.target')
at output (@ark/schema/out/roots/root.js:45:62)
at unwrapSchema (@elysiajs/openapi/dist/index.mjs:2959:48)
at toOpenAPISchema (@elysiajs/openapi/dist/index.mjs:3268:26)
at openAPISchema @elysiajs/openapi/dist/index.mjs:10240:9)
at handle (node_modules/elysia/dist/bun/index.js:6:76)
at handle (elysia/dist/bun/index.js:6:80)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels