Closed
Description
Hi
I want to return the created and lastModified timestamp from the database which I define in my ORM with type Date.
If I print the response object in my express router before returning it, it looks like this:
User {
id: '1fe87c1d-5d31-4426-8757-aa5e62d2344e',
lastModified: 2020-02-21T09:26:43.603Z,
created: 2020-02-21T09:25:48.151Z,
If I call the endpoint I get the following reponse object:
{
"data": [
{
"id": "1fe87c1d-5d31-4426-8757-aa5e62d2344e",
"lastModified": "2020-02-21T09:26:43.603Z",
"created": "2020-02-21T09:25:48.151Z"
},
...
-> correctly stringified
As soon as I set the validateResponses option in the OpenApiValidator on true, I get the following error message:
{
"error": ".response.data[0].lastModified should be string, .response.data[0].created should be string,
... although it is a string in the upper example
Metadata
Metadata
Assignees
Labels
No labels