Validation in the API world means checking if the data send is good or not. You never can entirely rely on having only a client-side validation. Because you don’t know what’s happening on the client, you can’t trust the data you receive. Even if you have a private API, someone could still send you invalid requests.
Server-side validation implied checking multiple things :
The JSON Schema is a way to describe any instance of JSON data, like the ones found in our HTTP request or response.
The keyword type will restrict your property to a certain type. There is several possible values :
#python #validation #flask #json #api