-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
バックエンドAPIのエラー応答方針を決定し、ドキュメントとサンプルアプリケーションに反映する #1635
Comments
409 Conflictについて409 を返却しない場合フロント側でステータスコードに合わせた処理を行う要件がない場合は、400にまとめてしまうことも考えられる。 409を返却する場合Controllerで都度DbUpdateConcurrencyExceptionをcatchするのではなく、 レスポンスボディについて
|
RFC7807 (Problem Details for HTTP APIs)メンバーはtype、title、status、detail、instanceの5つで、
Consumers MUST use the "type" string as the primary identifier for
the problem type; {
"type": "https://example.com/probs/out-of-credit",
"title": "You do not have enough credit.",
"detail": "Your current balance is 30, but that costs 50.",
"instance": "/account/12345/msgs/abc",
"balance": 30,
"accounts": ["/account/12345",
"/account/67890"]
} {
"type": "https://example.net/validation-error",
"title": "Your request parameters didn't validate.",
"invalid-params": [ {
"name": "age",
"reason": "must be a positive integer"
},
{
"name": "color",
"reason": "must be 'green', 'red' or 'blue'"}
]
} |
maiaの下記のissueでProblemDetailsのメンバーの拡張が検討されているので、対応されたら内容をmarisにも取り込む必要がある。 |
概要
現状、例外発生時のエラー応答方針が以下の点において定まっていない。
POST / PUT / DELETE / PATCH でキーに対応するリソースが見当たらない場合
決めの問題だが、どちらを採用するにせよサンプルの実装は方針に合わせる必要がある。
完了条件
The text was updated successfully, but these errors were encountered: