Describes how each request is checked before being accepted
Each request you make to the API wll be validated to ensure it's well formed. We look for the following:
- Valid JSON in the request payload
- Required properties
- Data types
If any of the above checks fails, your request will be return with a 400 status. If the problem with the request is related to missing or invalid properties in the request body, you will also receive a response body that includes details of the problem.
For example, when creating a new project in MediaSilo we require that the "name" be present in the request body. If the request does not include this field the response body would be:
{
name: "A name is required for each Project, otherwise things get confusing."
}
Note
Notice that the property is called "name" to match the name of the invalid property.