Skip to content

Commit e406b68

Browse files
authored
fixed a few typos (#541)
- Fixed a code typo that said `.get` instead of `.post` - Updated wording about "warning" in anticipation of honojs/hono#3707 - Reworded code block descriptors
1 parent a471fa1 commit e406b68

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/guides/validation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ Validation targets include `json`, `query`, `header`, `param` and `cookie` in ad
5252
5353
::: warning
5454
When you validate `json`, the request _must_ contain a `Content-Type: application/json` header
55-
otherwise the request body will not be parsed and you will invalid JSON errors.
55+
otherwise the request body will not be parsed and you will receive a warning.
5656
5757
It is important to set the `content-type` header when testing using
5858
[`app.request()`](../api/request.md).
5959
60-
If you had an app set up like this.
60+
Given an application like this.
6161
6262
```ts
6363
const app = new Hono()
64-
app.get(
64+
app.post(
6565
'/testing',
6666
validator('json', (value, c) => {
6767
// pass-through validator
@@ -73,7 +73,9 @@ app.get(
7373
}
7474
)
7575
```
76-
And your tests were set up like this.
76+
77+
Your tests can be written like this.
78+
7779
```ts
7880
// ❌ this will not work
7981
const res = await app.request('/testing', {
@@ -82,9 +84,7 @@ const res = await app.request('/testing', {
8284
})
8385
const data = await res.json()
8486
console.log(data) // undefined
85-
```
8687

87-
```ts
8888
// ✅ this will work
8989
const res = await app.request('/testing', {
9090
method: 'POST',

0 commit comments

Comments
 (0)