We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug The serialization of date-time not work if the field is in a additionalProperties object
To Reproduce
The openapi definition
/test: get: responses: '200': description: foo content: application/json: schema: type: object properties: good_date: type: string format: date-time other_info: type: object additionalProperties: type: object properties: bad_date: type: string format: date-time
Express server implementation
app.use( OpenApiValidator.middleware({ apiSpec: './openapi.yaml', validateRequests: true, // (default) validateResponses: true, // false by default serDes: [ OpenApiValidator.serdes.date, OpenApiValidator.serdes.dateTime, ] // the default ones }), ) app.get('/test', (req:Request,res:Response,next:NextFunction)=>{ return res.json({ good_date: new Date(), other_info: { something:{ bad_date: new Date() } } }) })
Actual behavior The serializer does not convert the bad_date from date to string and so the validator produce an error
bad_date
"message": "/response/other_info/something/bad_date must be string", "errors": [ { "path": "/response/other_info/something/bad_date", "message": "must be string", "errorCode": "type.openapi.validation" } ]
Expected behavior The response should be validated succesfully
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
The serialization of date-time not work if the field is in a additionalProperties object
To Reproduce
The openapi definition
Express server implementation
Actual behavior
The serializer does not convert the
bad_date
from date to string and so the validator produce an errorExpected behavior
The response should be validated succesfully
The text was updated successfully, but these errors were encountered: