-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Description
Consider the following example:
import swagger from '@elysiajs/swagger'
import Elysia, {t} from 'elysia'
const app = new Elysia()
.use(swagger())
.model({score: t.Number()})
.get('/scores', () => [5, 4, 9], {response: t.Array(t.Ref('score'))})
await app
.handle(new Request('http://localhost/swagger/json'))
.then(async (res) => console.log(res.status, JSON.stringify(await res.json(), null, 2)))
Then we'll see this output:
"$ref": "score"
is an invalid $ref
.
Additionally, I don't know why items
property exists there? It seems it's unnecessary and can be omitted:
"responses": {
"200": {
- "items": {
- "$ref": "score"
- },
"content": {
// ...
}
Versions:
"elysia": "1.3.20"
"@elysiajs/swagger": "1.3.1"
Bun v1.2.20
mirismaili
Metadata
Metadata
Assignees
Labels
No labels