Skip to content

Commit

Permalink
api documentation wrote for bmi calculator
Browse files Browse the repository at this point in the history
  • Loading branch information
nimaafshar committed Apr 9, 2020
1 parent 3e285db commit b84083e
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion api-documentation.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
#Daily diet api documentation

##v1.0
##v1.0

### `/calculate/bmi`
method: `POST`

*input*:
- height in centimiters
- weight in kilograms
```json
{
"height":180,
"weight":80
}
```

*output*:
- `bmi_value` rounded up to 2 decimal points
- `bmi_status` one of **Underweight**, **Normal weight**, **Overweight** and **Obesity**
```json
{
"bmi_status": "Normal weight",
"bmi_value": 24.69
}

```

*in case of errors*: response code will be **400**
```json
{
"errors": {
"height": [
"This field is required."
],
"weight": [
"This field is required."
]
}
}
```

0 comments on commit b84083e

Please sign in to comment.