Add JSON syntax highlight to README.md
make it more readable
This commit is contained in:
parent
ab279cc1a7
commit
25861ffff3
@ -233,7 +233,7 @@ When your APIs are public other third parties, upgrading the APIs with some brea
|
|||||||
### 9.5 Send feedbacks
|
### 9.5 Send feedbacks
|
||||||
#### 9.5.1 Errors
|
#### 9.5.1 Errors
|
||||||
Response messages must be self descriptive. A good error message response might look something like this:
|
Response messages must be self descriptive. A good error message response might look something like this:
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"code": 1234,
|
"code": 1234,
|
||||||
"message" : "Something bad happened",
|
"message" : "Something bad happened",
|
||||||
@ -242,7 +242,7 @@ Response messages must be self descriptive. A good error message response might
|
|||||||
```
|
```
|
||||||
or for validation errors:
|
or for validation errors:
|
||||||
|
|
||||||
```
|
```json
|
||||||
{
|
{
|
||||||
"code" : 2314,
|
"code" : 2314,
|
||||||
"message" : "Validation Failed",
|
"message" : "Validation Failed",
|
||||||
@ -334,7 +334,7 @@ Optional: photo_id=[alphanumeric]
|
|||||||
Content: { id : 12 }
|
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
|
* 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
|
"Code": 403
|
||||||
"message" : "Authentication failed",
|
"message" : "Authentication failed",
|
||||||
"description" : "Invalid username or password"
|
"description" : "Invalid username or password"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user