diff --git a/error.go b/error.go index 966ca44..cac42dd 100644 --- a/error.go +++ b/error.go @@ -19,7 +19,7 @@ var ( type ( // HTTPError http error HTTPError struct { - StatusCode int `json:"status_code,omitempty"` + StatusCode int `json:"statusCode,omitempty"` Code string `json:"code,omitempty"` Category string `json:"category,omitempty"` Message string `json:"message,omitempty"` diff --git a/middleware/responder_test.go b/middleware/responder_test.go index fbe9e2b..e2a987c 100644 --- a/middleware/responder_test.go +++ b/middleware/responder_test.go @@ -39,7 +39,7 @@ func TestResponder(t *testing.T) { }) resp := httptest.NewRecorder() d.ServeHTTP(resp, req) - checkResponse(t, resp, 500, `{"status_code":500,"category":"cod","message":"invalid response"}`) + checkResponse(t, resp, 500, `{"statusCode":500,"category":"cod","message":"invalid response"}`) checkJSON(t, resp) }) @@ -51,7 +51,7 @@ func TestResponder(t *testing.T) { }) resp := httptest.NewRecorder() d.ServeHTTP(resp, req) - checkResponse(t, resp, 500, `{"status_code":500,"message":"abc"}`) + checkResponse(t, resp, 500, `{"statusCode":500,"message":"abc"}`) checkJSON(t, resp) }) @@ -67,7 +67,7 @@ func TestResponder(t *testing.T) { }) resp := httptest.NewRecorder() d.ServeHTTP(resp, req) - checkResponse(t, resp, 400, `{"status_code":400,"category":"custom","message":"abc"}`) + checkResponse(t, resp, 400, `{"statusCode":400,"category":"custom","message":"abc"}`) checkJSON(t, resp) })