Skip to content
New issue

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

Warning 'Data and type mismatch found.' with 'date-time' format #1640

Open
adsk-duszykf opened this issue Apr 25, 2024 · 5 comments
Open

Warning 'Data and type mismatch found.' with 'date-time' format #1640

adsk-duszykf opened this issue Apr 25, 2024 · 5 comments
Assignees
Labels
priority:p2 Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 days type:bug A broken experience

Comments

@adsk-duszykf
Copy link

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',
    }
@andrueastman
Copy link
Member

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

@baywet baywet transferred this issue from microsoft/kiota Apr 25, 2024
@baywet
Copy link
Member

baywet commented Apr 25, 2024

Or we can simply transfer the issue @andrueastman ;)

@andrueastman
Copy link
Member

Or we can simply transfer the issue @andrueastman ;)

Much more efficient

@darrelmiller
Copy link
Member

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.

@adsk-duszykf
Copy link
Author

@darrelmiller thank you !

@MaggieKimani1 MaggieKimani1 added type:bug A broken experience priority:p2 Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 days labels Jun 3, 2024
@MaggieKimani1 MaggieKimani1 self-assigned this Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p2 Medium. Generally has a work-around and a smaller sub-set of customers is affected. SLA <=30 days type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

5 participants