You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would be nice if all of spa-starter-kit's REST API responses conform to the JSend Specification.
This means that every response will have a status and a data field in the JSON response. The status field will give either a success or fail. In the case of a success, the data will contain the requested data. In the case of a fail, the data will contain error messages.
For example, in the case of a bad request:
{
"status": "fail",
"data": {
"errors": [
{ "name": "title", "message": "cannot be this ridiculous" },
{ "name": "description", "message": "must be provided" }
]
}
}
Here is an example of a successful request of a public profile:
@jaonoctus Thanks for the suggestion, at this moment we have a similar structure, except we dont have a status field, I didn't think it was needed because we are using the http status codes to know if there was any errors or not, that way we always have to use the right status codes when returning a response, but what do you think @vedovelli ?
@jaonoctus@flyingluscas If we have something in place, I'd suggest leave it as it is. Specially because a package was suggested to implement the idea. Thanks guy, I'm closing this issue.
Would be nice if all of spa-starter-kit's REST API responses conform to the JSend Specification.
This means that every response will have a
status
and adata
field in the JSON response. Thestatus
field will give either asuccess
orfail
. In the case of asuccess
, the data will contain the requested data. In the case of afail
, the data will contain error messages.The text was updated successfully, but these errors were encountered: