이렇게 수정하면, 다음과 같이 문자열을 전달해야 하는 title 값에 숫자를 넣을 경우 에러가 나타날 것입니다.
PATCH http://localhost:4000/api/posts/5cbc59e63c3a663be73c0fb3 { "title": 123123 }
응답은 다음과 같이 나타납니다.
{
"isJoi": true,
"name": "ValidationError",
"details": [
{
"message": "\"title\" must be a string",
"path": [
"title"
],
"type": "string.base",
"context": {
"value": 123,
"key": "title",
"label": "title"
}
}
],
"_object": {
"title": 123
}
}