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

Is it possible to consume output from this library with openui5? #774

Closed
mgerzabek opened this issue Jan 12, 2024 · 2 comments
Closed

Is it possible to consume output from this library with openui5? #774

mgerzabek opened this issue Jan 12, 2024 · 2 comments

Comments

@mgerzabek
Copy link
Contributor

mgerzabek commented Jan 12, 2024

I was stumbling over this library when looking on how to integrate a small demo of an openui5 app without a SAP backend. After setting up CORS it was easy to expose the $metadata file and access the catalogues defined in AppProvider.

But when I want to access entitysets in ui5 I get the message »Unsupported OData version 4.01«

Log.js?eval:499 2024-01-12 13:27:25.467800 Failed to get contexts for http://localhost/odata/Times with start index 0 and length 500 - Error: http://localhost/odata/$metadata: Unsupported OData version 4.01
    at _V4MetadataConverter.finalize (http://localhost:8080/resources/sap/ui/model/odata/v4/lib/_V4MetadataConverter.js:37:10)
    at _MetadataConverter.convertXMLMetadata (http://localhost:8080/resources/sap/ui/model/odata/v4/lib/_MetadataConverter.js:141:8)
    at convertXMLMetadata (http://localhost:8080/resources/sap/ui/model/odata/v4/lib/_MetadataRequestor.js:77:24) sap.ui.model.odata.v4.ODataListBinding

This brings me to my initial stated question: Is it possible to consume output from this library with openui5?

If yes, any hints are welcomed.
Thanks

@27pchrisl
Copy link
Contributor

Hi @mgerzabek, based on the error I'm going to guess the openui5 library supports OData 4.0, but not 4.01, and isn't sending the OData-Version header to indicate what versions it supports.

If you publish the lodata.php configuration you can edit the default version to 4.0 instead of 4.01 which is used if the client doesn't send a version.

Does that help?

@mgerzabek
Copy link
Contributor Author

Thank you @27pchrisl that worked!

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

No branches or pull requests

2 participants