Warning 'Data and type mismatch found.' with 'date-time' format
I get a warning: 'Data and type mismatch found.' with this response description:
DiffCreatedEvent:
description: 'diff index created
type: object
additionalProperties: false
properties:
updatedAt: { $ref: '#/components/schemas/Timestamp' }
example:
{
"updatedAt": '2020-06-30T06:43:51.391Z',
}
Timestamp: { type: string, format: date-time, description: 'timestamp', example: '2020-06-30T06:43:51.391Z' }
but no warning with this:
DiffCreatedEvent:
description: 'diff index created
type: object
additionalProperties: false
properties:
updatedAt: { type: string, format: date-time, description: 'timestamp', example: '2020-06-30T06:43:51.391Z' }
example:
{
"updatedAt": '2020-06-30T06:43:51.391Z',
}
Thanks for raising this @adsk-duszykf
The warning seems to be raised by the OpenApi.Net library as it parses the description at https://github.com/microsoft/OpenAPI.NET/blob/29b1a1a9acbc65d7b2961b3f08e681a1e59d7c38/src/Microsoft.OpenApi/Validations/Rules/RuleHelpers.cs#L42C28-L42C52
Any chance you can post the issue at the https://github.com/microsoft/openAPI.NET repo for the team to investigate? @MaggieKimani1
Or we can simply transfer the issue @andrueastman ;)
Or we can simply transfer the issue @andrueastman ;)
Much more efficient
Unfortunately we are very aware of this issue and are working hard to make the problem go away in v2. There are a range of issues with the way this particular validation works today and we have never found a good way of fixing it that didn't involve just ripping all the datatype mismatch errors out. The good news is that in V2 it will actually do proper, full JSON Schema validation of the examples.
@darrelmiller thank you !
@MaggieKimani1 Let us validate if it is fixed in v2 and then close.