Skip to content

Commit

Permalink
fix: deprecated json response method (#488)
Browse files Browse the repository at this point in the history
* fix deprecated json response method

* apply changesets
  • Loading branch information
Frog-kt authored Apr 30, 2024
1 parent 4194ac6 commit 1cc5e0a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .changeset/ninety-rules-give.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion packages/swagger-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ app.openapi(
}
}),
(c) => {
return c.jsonT({
return c.json({
message: 'hello'
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/typebox-validator/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
})
Expand Down
2 changes: 1 addition & 1 deletion packages/typia-validator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
})
Expand Down
2 changes: 1 addition & 1 deletion packages/typia-validator/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
})
Expand Down

0 comments on commit 1cc5e0a

Please sign in to comment.