Skip to content
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

Decide the error format of API #108

Open
chimame opened this issue Feb 4, 2017 · 4 comments
Open

Decide the error format of API #108

chimame opened this issue Feb 4, 2017 · 4 comments
Labels

Comments

@chimame
Copy link
Member

chimame commented Feb 4, 2017

Problems and suggestions:問題・課題点/提案

In the case of an error, since the JSON format is not fixed, it is difficult to use for the client.
ex.

  1. Response at mandatory error when posting to /communities.
    {
      "description": [
        "を入力してください"
      ]
    }
    
  2. Response at the time of NotFound error when getting to /communities/0.
    {"status":404,"error":"Not Found"}
    

Countermeasure:対応方法(案)

I considered the following format. What do you think.

{
  "level": 1,#1=warning, 2=error
  "messages": [] #I am considering entering multiple messages.
}
@chimame chimame added the backend label Feb 4, 2017
@ytorii
Copy link
Contributor

ytorii commented Feb 26, 2017

I thought case 1 corresponds to level 1(warning) and case 2 corresponds to level 2(error), is that correct?
If possible, I think the format of RFC 7807 is worthy of consideration.
https://www.eisbahn.jp/yoichiro/2017/01/rfc_7807.html

@springaki
Copy link
Member

@chimame @ytorii これはどうなるの?

@chimame
Copy link
Member Author

chimame commented Oct 7, 2017

これは置いておいてもらっていいですか?

@springaki
Copy link
Member

はーい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants