Important notes on all requests¶
All api-requests are valid with or without trailing slash.
Important notes on Json-Requests¶
All Json-request objects will be validated and cleaned. The following cleaning rules will be applied on each request with a json body:
Auto-conversion Convert properties automatically where possible:
- Non-string values are converted to a String if a String is expected
- Strings that are numbers are converted to Numbers if a Number is expected
- Strings that are "true" or "false" are converted to Boolean if a Boolean is expected
- Numbers are converted to Boolean if a Boolean is expected, with 0 being false and all other numbers being true
- Non-array values are converted to a one-item array if an Array is expected
Remove empty Strings All keys in a normal object will be removed if the value is an empty string (all strings will be trimmed)
Trim Strings All leading and trailing spaces from string values will be removed
Remove nulls from Arrays
nulls will be removed from arrays
GET-requests of collections are filterable by query parameters. Query parameters will be converted to an object which will be validated and cleaned with the same rules explained under 'Important notes on Json-Requets'. After validating and cleaning the query-object will be used to query the collection by example.
POST, PUT and PATCH requests¶
Default values will be applied for all write requests if necessary - that is if specific optional properties are not specified within the json body of the request. This is also true for nested objects. Properties of the root object and all nested objects will be merged with the default values.
Arrays will not be merged
And in case of a patch request with the existing persistent object. A property which should be deleted must be specified explicitly with
null within the json body of the request.