News for hackers. Stuff that matters.
Re:Microsoft REST API Guidelines by tracker1 on Thursday July 21, 2016 @06:13PM (#12140454)
in C# terms...

    //use CamelCasePropertyNamesContractResolver

    public class ApiResponse<T> {
      public T Data { get; set; }
      public Exception Error { get; set; }

      public ApiResponse(T data) {
        this.Data = data;
      }
   
      public ApiResponse(Exception error) {
        this.Error = error;
      }
    }
In this way, all API requests return ApiResponse<TypeOfData>

There are no comments on this comment yet.