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

[BUG] Date format published with timestamp. #685

Closed
KartikKumar02 opened this issue Oct 11, 2024 · 4 comments
Closed

[BUG] Date format published with timestamp. #685

KartikKumar02 opened this issue Oct 11, 2024 · 4 comments

Comments

@KartikKumar02
Copy link

Release version

v5.1.4

Describe the bug

When an openapi specification is published with parameters having format date then these properties are published to include a timestamp.
E.g. if the property looks like "startDate": "2024-10-03" it is published as "startDate": "2024-10-03T12:00:00.0000000+00:00"

Expected behavior

The expected behaviour is to publish api specifications with schema properties having the format date without a timestamp in it.

Actual behavior

The actual behaviour is to publish properties with the format date without a timestamp.

Reproduction Steps

contact-api-spec.json

  1. Use the attached api specification and update any existing api managed by apiops

  2. Extract the api using the exract pipeline.

  3. Merge the pull request created by the extract pipeline and allow apiops to publish the api.

Screenshot of the exported specifications having date in the correct format:
Image

Screenshot of the published api on api management after the publish pipeline executes successfully:
Image

Copy link

  Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
  Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.

@riosengineer
Copy link

Hi,

The latest version is currently v6.0.1.2 - so I assume the maintainers would want you to verify if it's present in the current release or not. Your version is from March of this year so it's pretty old now.

@guythetechie
Copy link
Contributor

Also, this is beyond the scope of our product. We take the OpenAPI spec and pass it to Azure API Management as is. How it chooses to handle dates is out of our control.

@guythetechie guythetechie closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2024
@rubenaster
Copy link

@guythetechie the problem is the Microsoft.OpenApi.Readers package version that was used in APIOps v5.x.

APIOps v5.1.4 uses Microsoft.OpenApi.Readers v1.4.1, which changes the date format to datetime format in GetOpenApiV3SpecificationText() when reading the file content with OpenApiDocument.Serialize.

The latest APIOps version uses Microsoft.OpenApi.Readers 1.6.17 which doesn't produce this error anymore.

Might also be interesting for your release notes, since users of previous versions might rely on the "previous" serialization behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants