-
Notifications
You must be signed in to change notification settings - Fork 15
Description
While working with the UCE API directly I've noticed that many API responses in some cases return a JSON message body (usually when the request was successful) and in others a string or sometimes even html.
This makes it very tedious to work with the API (especially in JAVA) since one always needs to define two cases for the response, which is especially more tedious since the response contentType sometimes is set and sometimes not.
I think edge-cases like serving html are fine (as long as we set the contentType properly) but I'd really appreciate it if we were to standardize the responses.
E.g. I'd suggest that we always return json.
Something like would be nice:
{
status: "success" | "error", // we could also replace this with status codes in the HTTP response, which could make the keys content/message obsolete
content?: ResponseData,
message?: string // error_message
}There's probably quite a few ideas on how to structure this. I'm open to input and would also be willing to rewrite the API code once a consensus is reached.