presslabs / zinc

Route 53 zone manager.
https://www.presslabs.com/code/zinc/
Other
42 stars 2 forks source link

Validate the entire payload at once #170

Closed vtemian closed 7 years ago

vtemian commented 7 years ago

When creating new records with an invalid payload, it would be nice to receive errors for each invalid field at once. For example:

{
    'name': '',
    'type': 'A',
    'values': ['a.com'],
    'ttl': '-1'
}

I expect to receive a 400 response

{
    'name': 'Name can't empty',
    'ttl': 'Ensure this value is greater than or equal to 1.',
    'values': 'Value is not a valid IPv4 address.'
}