Inconsistency between date format in API
Summary
When querying (create, read, update) a resource with a date parameter (Maintenance or Incident) the date format is not always the same.
Difference in format :
- In the documentation :
YYYY-MM-DDTHH:MM:SSZ
- In Swagger dashboard examples :
YYYY-MM-DDTHH:MM:SS.aaaZ
- In API returned data :
YYYY-MM-DDTHH:MM
Also, when the date is passed in an invalid format, the application return a not helping error message.
Relevant logs and/or screenshots
Example of error message when the user provide a date with an invalid format :
{
"message": "Maintenance creation failed",
"reasons": {
"scheduled_end_date": [
"This field is required."
],
"scheduled_start_date": [
"This field is required."
]
}
}
Valid format for date in queries can be found in routes/<XXX>/forms.py
files. (for example : https://gitlab.com/prod-manager/prod-manager/-/blob/master/ProdManager/routes/maintenance/forms.py#L60)
Valid format for date displayed to the user can be found here : https://gitlab.com/prod-manager/prod-manager/-/blob/master/ProdManager/helpers/date.py#L13
Environment info
0.16.0