-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add support for OData V4 specifications #234
Comments
I really appreciate this. The SAP API Business Hub contains a lot of OData API specs. This one, for instance, is v4 and the edmx file can be downloaded in Overview > API resources > API Specification. You're probably already aware of the OASIS reference implementation for mapping OData to Open API using JavaScript or XSLT. This seems to be pretty reliable. https://github.com/oasis-tcs/odata-openapi#further-description-of-this-repository |
Here's another relevant use case: the Microsoft Graph API |
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
Any news on this? OData v4 is becoming more prevalent with new SAP releases. Since the CLI already supports v2 and the OASIS converter reference implementation also supports v4, is this a lot of effort to implement? |
I would like to second the request as well. In our company we currently have an OData v4 use case we can't convert through the CLI tool and are struggling now on how to move on. |
The current code detects odata4 specification and throws an error. We need to write a mapping from odata4 to opeanapi using Apache Olingo. I will prioritize it for the next release. |
To let you know @rathnapandi there is an existing branch that already contains support for OData V4. Maybe it helps as an inspiration. |
Can't you use one of the OASIS reference implementations for mapping OData to Open API? https://github.com/oasis-tcs/odata-openapi#further-description-of-this-repository |
Thanks @cwiechmann. @davidgeiger I am open with other options too. The github page says it is a POC. Do let me know if you have tested the xslt and works? |
Yes, we have worked with both converters (mostly the Node.js version though) and the results are quite good. It does lack support for some things such as adding a root method / and /$metadata, which some SAP-specific applications rely on. This may also be an issue with the underlying specification, though, and can be added after conversion. |
Additional remark on this: The aim of at least the OASIS converters appears to be a "nice" human-readable representation of an OData API in Swagger UI. This is obviously very different from using a converted spec to validate API traffic in a gateway. See, for instance, this comment. That being said, so far we've only run into issues with the lack of the previously mentioned root and /$metadata methods. The linked discussion on handling enums does raise additional concerns, though. |
Thanks for sharing, the issue oasis-tcs/odata-openapi#38 handled in odata 4 conversion. |
fixed as part v1.13.1 release |
Thanks @rathnapandi. Could you share which conversion approach is now used (OASIS conversion, Apache Olingo...)? And does the CLI add endpoints for / and /$metadata? |
We are using Apache Olingno as I do see lot of TODO list on xsl implementation. Also, it requires xsl customization to work with API Manager. The endpoint should use $metadata e.g - https://github.com/Axway-API-Management-Plus/apim-cli/blob/f7d8be10dd5ba1bd71979a9d918f031585035c70/modules/apis/assembly/samples/basic/odata-v4-trippin-api.json Filtering example - https://github.com/Axway-API-Management-Plus/apim-cli/blob/develop/modules/apis/assembly/samples/basic/odata-v4-trippin-api-filtered.json We can give edmx file as input with backendBasepath parameter. |
I just downloaded v.1.13.1 and tried it out. This is the result:
I'm not sure what I could be doing wrong. I think I got the right version (1.13.1), it's properly unzipped and I'm executing the correct executable. Please let me know for any hint. (I was always puzzled why the initial screen keeps on telling me about v1.5.0, however, I just think this is a text relict and has nothing to do with the actual functionality.) |
The log says it using version 1.5.0. Can you check the lib folder for apim cli version 1.13.1 jar files? API-Manager CLI: 1.5.0 |
Is this what you're looking for?
|
Perhaps you need to update any env variables such as AXWAY_APIM_CLI_HOME? |
That could be it, at least it's ringing a bell. I need to get admin rights to check this and will report back here, thank you. |
So yes, it was that AXWAY_APIM_CLI_HOME variable. Once this was set properly, I was able to import an Odata V4 based service and didn't get the error anymore. I can't judge the quality of the import yet, this will take a bit time. It seems to look more different than expected compared with the output from other (open source) tools, so that's a bit surprising to me. |
Check the video for how OData2 works on API gateway - https://www.youtube.com/watch?v=K4q7HR3wBqQ&t=455s OData4 follows same approach. The openapi generated from OASIS TC GitHub repositories and APIM cli won't be same as we tailored the open api specification to work with Axway APIM. |
User story
It should be possible to use the APIM-CLI to import OData V4 Metadata-Specifications into the API-Manager without the need of an additional converter.
For that, the APIM-CLI should internally convert the OData-Metadata-Specification into an OpenAPI 3 spec and import it as any other API.
Please vote only once on the issue (OData V3 or OData V4 (this issue)) that has a higher priority for you. Since OData V3 and V4 are massively different, support for both versions cannot be added at the same time. Maybe V3 will not be supported at all, because it is not widely used.
Please vote on this issue 👍 if you have need for this feature. It would also help, if you can share a OData Metadata-Description which can be used for Unit-Testing the converter.
The text was updated successfully, but these errors were encountered: