In general, this is an excellent idea. (We may have a small adaptation to make on our side when this lands, but it will be worth it).
Will the effect of moving away from the RestApiException be to expose the underlying error? What would that look like in JSON terms? From: Dinithi De Silva [mailto:[email protected]] Sent: 23 April 2015 09:48 To: dev Cc: Vanson Lim (vlim); Shaheedur Haque (shahhaqu); Martin Eppel (meppel); Imesh Gunaratne Subject: Re: Re-factoring REST API Hi, I have listed the changes in a point form below. * In all the API methods the response message format will be changed to display a status message either with "Success" or "Error" . Status code will be removed from the response message. Eg: Current format return Response.status(Response.Status.CONFLICT).entity(new ErrorResponseBean(Response.Status.CONFLICT.getStatusCode(), msg)).build(); After the modifications return Response.status(Response.Status.CONFLICT).entity(new StatusResponseBean(Constants.STATUS_ERROR, msg)).build(); * The following non API methods found in StratosAPIV41 class will be moved to the StratosAPIV41Util class. activateTenant(String) addTenant(TenantInfoBean) deactivateTenant(String) getPartialSearchTenants(String) getTenantForDomain(String) getTenants() removeTenant(String) updateTenant(TenantInfoBean) addUser(UserInfoBean) getUsers() removeUser(String) updateUser(UserInfoBean) * Removing 204 NO_CONTENT status code 204 NO_CONTENT status code will be removed from removeKubernetesHostCluster API method. * Resolving problems in exception throwing and validating requests. In this modifications we plan to give custom exceptions when needed other than throwing RestAPIException. Thank you -- Dinithi De Silva Associate Software Engineer, WSO2 Inc. m:+94716667655<tel:%2B94716667655> | e:[email protected]<mailto:[email protected]> | w: www.wso2.com<http://www.wso2.com> | a: #20, Palm Grove, Colombo 03
