From 25861ffff3f9b75066fde8ce5c477ccd0c644716 Mon Sep 17 00:00:00 2001 From: gulpin Date: Thu, 6 Jul 2017 13:57:21 +0900 Subject: [PATCH] Add JSON syntax highlight to README.md make it more readable --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 39b53d3..68bb25e 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ When your APIs are public other third parties, upgrading the APIs with some brea ### 9.5 Send feedbacks #### 9.5.1 Errors Response messages must be self descriptive. A good error message response might look something like this: -``` +```json { "code": 1234, "message" : "Something bad happened", @@ -242,7 +242,7 @@ Response messages must be self descriptive. A good error message response might ``` or for validation errors: -``` +```json { "code" : 2314, "message" : "Validation Failed", @@ -334,7 +334,7 @@ Optional: photo_id=[alphanumeric] Content: { id : 12 } ``` * Error Response, Most endpoints have many ways to fail. From unauthorised access, to wrongful parameters etc. All of those should be listed here. It might seem repetitive, but it helps prevent assumptions from being made. For example - ``` + ```json "Code": 403 "message" : "Authentication failed", "description" : "Invalid username or password"