Changed specification to rise an error when inserting with a negative index. Added new scenario to check this condition

This commit is contained in:
Héctor Hurtado
2019-08-23 13:18:12 +02:00
parent d564ff9206
commit b38023a033
2 changed files with 21 additions and 2 deletions
+3 -2
View File
@@ -209,7 +209,7 @@ field must be a json scaped string.
]
```
* **Sample Call**: `$ curl $KAPOW_URL/routes`
* **Notes**: Currently all routes are returned; in the future, a filter may be
* **Notes**: Currently all routes are returned; in the future, a filter may be
accepted.
@@ -314,10 +314,11 @@ A new id is created for the appended route so it can be referenced later.
```
* **Notes**:
* Route numbering starts at zero.
* When `index` is not provided or is less than `0` the route will be inserted
* When `index` is not provided or is `0` the route will be inserted
first, effectively making it index `0`.
* Conversely, when `index` is greater than the number of entries on the route
table, it will be inserted last.
* Finally, when `index` is less than `0` a 422 error is raised.
* A successful request will yield a response containing all the effective
parameters that were applied.