Hi there for implementing the symfony2 base REST api bundle i have installed the following bundle.
- FosOauth server bundle for Oauth2.0 base authentication
- FosRest bundle for REST api creation.
now can any body suggest me how can i create generalize prototype for all REST API call response. in json format like
{
"responseType" : "[FAILED|PASSED]",
"data" : ["RESPECTIVE DATA WILL COME HERE"],
"errorCode" : "if any ERROR comes we can set those respective code here",
"errorMessage": "respective error messages either in the string or array"
}
Thanks in advance :)