You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
name: fromDate
in: query
description: A beginning date of the time range in yyyy-mm-dd format
required: false
schema:
type: string
format: date
When I setup the route with hapi-openapi and send a request with query ?fromDate=2014-10-14, the validation passes successfully, but the route handler recieves ?fromDate=Tue+Oct+14+2014+03%3A00%3A00+GMT%2B0300+%28Eastern+European+Summer+Time%29.
According to the openapi specification the 'date' format' should represent a date in yyyy-mm-dd.
Modifying the query params during validation seems odd and unnecessary. I hope this gets fixed soon.
The text was updated successfully, but these errors were encountered:
I think the bug comes from generating the joi schema for validating date. After converting the string to date, .raw should be called to preserve the input yyyy-mm-dd format. More info here.
I have the following query parameter in the spec:
When I setup the route with hapi-openapi and send a request with query
?fromDate=2014-10-14
, the validation passes successfully, but the route handler recieves?fromDate=Tue+Oct+14+2014+03%3A00%3A00+GMT%2B0300+%28Eastern+European+Summer+Time%29
.According to the openapi specification the 'date' format' should represent a date in yyyy-mm-dd.
Modifying the query params during validation seems odd and unnecessary. I hope this gets fixed soon.
The text was updated successfully, but these errors were encountered: