From 1cc5e0a5b07a14723c5d21ceea33ad9caef33025 Mon Sep 17 00:00:00 2001 From: "t.kasuo" Date: Tue, 30 Apr 2024 20:32:15 +0900 Subject: [PATCH] fix: deprecated json response method (#488) * fix deprecated json response method * apply changesets --- .changeset/ninety-rules-give.md | 7 +++++++ packages/swagger-ui/README.md | 2 +- packages/typebox-validator/test/index.test.ts | 2 +- packages/typia-validator/README.md | 2 +- packages/typia-validator/test/index.test.ts | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .changeset/ninety-rules-give.md diff --git a/.changeset/ninety-rules-give.md b/.changeset/ninety-rules-give.md new file mode 100644 index 000000000..ded5b9de5 --- /dev/null +++ b/.changeset/ninety-rules-give.md @@ -0,0 +1,7 @@ +--- +'@hono/swagger-ui': patch +'@hono/typebox-validator': patch +'@hono/typia-validator': patch +--- + +Fixed a part of deprecated response json method in hono since v4. diff --git a/packages/swagger-ui/README.md b/packages/swagger-ui/README.md index 53eb3ca59..25a9f338b 100644 --- a/packages/swagger-ui/README.md +++ b/packages/swagger-ui/README.md @@ -91,7 +91,7 @@ app.openapi( } }), (c) => { - return c.jsonT({ + return c.json({ message: 'hello' }) } diff --git a/packages/typebox-validator/test/index.test.ts b/packages/typebox-validator/test/index.test.ts index 2a348f332..6699f795e 100644 --- a/packages/typebox-validator/test/index.test.ts +++ b/packages/typebox-validator/test/index.test.ts @@ -16,7 +16,7 @@ describe('Basic', () => { const route = app.post('/author', tbValidator('json', schema), (c) => { const data = c.req.valid('json') - return c.jsonT({ + return c.json({ success: true, message: `${data.name} is ${data.age}`, }) diff --git a/packages/typia-validator/README.md b/packages/typia-validator/README.md index 5975d8e4d..b6482f889 100644 --- a/packages/typia-validator/README.md +++ b/packages/typia-validator/README.md @@ -17,7 +17,7 @@ interface Author { const route = app.post('/author', typiaValidator('json', validate), (c) => { const data = c.req.valid('json') - return c.jsonT({ + return c.json({ success: true, message: `${data.name} is ${data.age}`, }) diff --git a/packages/typia-validator/test/index.test.ts b/packages/typia-validator/test/index.test.ts index 20f12b63c..f6296ad38 100644 --- a/packages/typia-validator/test/index.test.ts +++ b/packages/typia-validator/test/index.test.ts @@ -19,7 +19,7 @@ describe('Basic', () => { const route = app.post('/author', typiaValidator('json', validate), (c) => { const data = c.req.valid('json') - return c.jsonT({ + return c.json({ success: true, message: `${data.name} is ${data.age}`, })