API: extracted helper method to validate required parameters, code clean up
Added a helper method to check if required parameters are given in an API call. Can be used to return a `400 Bad Request` return code if a required attribute is missing. Code clean up and fixed tests.
This commit is contained in:
parent
43d7596030
commit
7499f65014
10 changed files with 35 additions and 42 deletions
|
@ -368,7 +368,7 @@ Removes a hook from project. This is an idempotent method and can be called mult
|
|||
Either the hook is available or not.
|
||||
|
||||
```
|
||||
DELETE /projects/:id/hooks/:hook_id
|
||||
DELETE /projects/:id/hooks/
|
||||
```
|
||||
|
||||
Parameters:
|
||||
|
@ -379,6 +379,7 @@ Parameters:
|
|||
Return values:
|
||||
|
||||
+ `200 Ok` on succes
|
||||
+ `403 Forbidden` if user is not allowed to delete a hook
|
||||
+ `404 Not Found` if the project can not be found
|
||||
|
||||
Note the JSON response differs if the hook is available or not. If the project hook
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue