forked from sphinix27/notifier_api_test
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Description
In order to create or update a new channel there are required fields like name and type. If you send a post or put request without one of those param it would fail with a response saying that value is required. If you send a post or put request without both param the error response only display the type is required.
Environment
- An Notifier Server installed with version 1.0
- Operating System and version:
Windows Server 2012 R2
Requirements
- Rest Client: E.g. Postman.
API
- Method:
POST - Endpoint:
/api/channels
Steps to Reproduce
- Open Postman.
- In Postman select 'POST' method for URL.
- In Postman Enter the endpoint to send a notification.. E.g. http://128.0.0.1/api/channels
- In Postman select Body tab. A Key - Value appears.
- In Postman under Body tab select the radio button with the 'raw' option.
- In Postman under Body tab press the drop down list button that says 'Text' and select the 'JSON(application/json)' option.
- In Postman in text area field write the body for send a notification. E.g.
{
"configuration": {
"url": "https://www.example.com/"
}
}
- Click on Send button. Receive a json response similar to this e.g.
{
"timestamp": 1507725099872,
"status": 400,
"error": "Bad Request",
"exception": "org.springframework.web.bind.MethodArgumentNotValidException",
"errors": [
{
"field": "name",
"code": "name.required",
"defaultMessage": null
},
{
"field": "type",
"code": "NotNull",
"defaultMessage": "may not be null"
}
],
"message": "Bad Request",
"path": "/channels"
}
Actual Result
The status code is 400 and the response contains.
{
"timestamp": 1507725099872,
"status": 400,
"error": "Bad Request",
"exception": "org.springframework.web.bind.MethodArgumentNotValidException",
"errors": [
{
"field": "type",
"code": "NotNull",
"defaultMessage": "may not be null"
}
],
"message": "Bad Request",
"path": "/channels"
}
It only validates the type field.
Expected Result
It should validate both param name and type because both of them are required.
Reactions are currently unavailable