diff --git a/bun.lockb b/bun.lockb index bcaa0d4..b7530c9 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/example/index.ts b/example/index.ts index aa2246a..2f71ada 100644 --- a/example/index.ts +++ b/example/index.ts @@ -27,8 +27,11 @@ const app = new Elysia() }) .get('/unpath/:id', ({ params: { id } }) => id, { schema: { + params: t.Object({ + id: t.String({ description: 'ID to get' }) + }), detail: { - deprecated: false + deprecated: true } } }) @@ -41,16 +44,32 @@ const app = new Elysia() { schema: { body: 'sign', - response: t.Object({ - username: t.String(), - password: t.String(), - id: t.String() - }) + response: { + 200: t.Object( + { + username: t.String({ + title: 'A' + }), + password: t.String(), + id: t.String() + }, + { + description: 'A', + title: 'A' + } + ), + 400: t.Object({ + error: t.String() + }) + }, + detail: { + summary: 'A' + } } } ) .get('/unpath/:id/:name', ({ params: { id } }) => id) - .post('/json', ({ body }) => '1', { + .post('/json', ({ body }) => body, { schema: { body: 'sign', response: 'sign' diff --git a/package.json b/package.json index ace1b23..4d8459c 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@types/swagger-ui-dist": "^3.30.1", "bun-types": "^0.5.0", "eslint": "^8.26.0", - "elysia": "^0.2.0-rc.0", + "elysia": "../elysia", "typescript": "^4.9.3" }, "dependencies": {