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

Incorrect Handling of sap:display-format="Date" decorator #301

Closed
sosl-beep opened this issue Jul 3, 2024 · 3 comments · Fixed by oasis-tcs/odata-csdl-schemas#100
Closed
Labels

Comments

@sosl-beep
Copy link

sosl-beep commented Jul 3, 2024

Hi,

Version used is 0.25.4

I found a bug in the logic for converting EDMX files which contain properties with the decorator sap:display-format="Date".

to replicate this EDMX file from SAP can be used. It's for the SalesOrder API which uses OData V2.
2022_FPS_02_OP_API_SALES_ORDER_SRV_0001.txt

Expected behavior is that all properties with type Edm.Datetime gets converted to

"Name": {
  "type": "string",
  "example" "/Date(1492098664000)/",
  "nullable": true
}

What currently happens is that the properties get converted to

"Name": {
  "type": "string",
  "format": "date",
  "example" "2017-04-13",
  "nullable": true
}

If the decorator is removed from the properties then the OpenApi spec is generated correctly.

As a test the correct OpenApi spec should match the one provided by SAP:
2022_FPS_02_OP_API_SALES_ORDER_SRV_0001.json

@ralfhandl
Copy link
Contributor

@sosl-beep This is a bug in the JS-based implementation, whose support for OData V2 is incomplete.

You may want to use the XSLT-based implementation in https://github.com/oasis-tcs/odata-openapi/tree/main/tools, it produces the expected output.

@ralfhandl
Copy link
Contributor

Fixed with version 0.26.0

This was linked to pull requests Jul 4, 2024
@ralfhandl ralfhandl removed a link to a pull request Jul 4, 2024
@sosl-beep
Copy link
Author

Hi @ralfhandl,

Thank you very much! Awesome turnaround.

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

Successfully merging a pull request may close this issue.

2 participants