personium / personium-core

Core module of Personium
https://personium.io
Apache License 2.0
88 stars 16 forks source link

Different exception syntaxes in REST API #360

Open dixonsiu opened 5 years ago

dixonsiu commented 5 years ago

Description

When calling Personium's REST APIs different exception syntaxes are returned. It is impossible for App developer to display exception details efficiently.

I think that it is more developer friendly to use unified exception syntax (example).

Unless we clearly stated that certain APIs are OAuth and OAuth exception syntax will be used, etc.

OAuth 2.0 exception

{
    "error_description": "[PR400-AN-0016] - Required parameter [password] missing.",
    "error": "invalid_request"
}

OData exception

{
    "code": "PR404-OD-0001",
    "message":{
        "lang": "en",
        "value": "No such entity set."
   }
}

Personium exception

{
    "code": "PR400-MC-0002",
    "message":{
         "lang": "en",
         "value": "Path based CellUrl access is not allowed."
    }
}
shimono commented 5 years ago

Please propose a unified syntax, that comply with both odata spec and oauth2 spec.