I try to check my JSON fields and their types. So, I use voluptuous and its methods.
An example is here.
check = Schema({
Required('Id'): All(str, Length(min=1)),
Required('CalculationId'): All(str, Length(min=1)),
Required('Routes'): All([
{Required('Id'): All(str, Length(min=1)),
Required('Origin'): {
Required('Longitude'): float,
Required('Latitude'): float},
Required('Destination'): {
Required('Longitude'): float,
Required('Latitude'): float}}], Length(min=1)),
Required('CreateDate'): str,
Required('CreateUserName'): str,
Required('CreateUserEmail'): str})
Can I make all fields required in a shorter and more convenient way? I would like to do not use this "Required" mark at the beginning of each line =)