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

oData v4 not working after upgrade to 1.54 #2014

Closed
hschaefer123 opened this issue Apr 27, 2018 · 8 comments
Closed

oData v4 not working after upgrade to 1.54 #2014

hschaefer123 opened this issue Apr 27, 2018 · 8 comments
Assignees

Comments

@hschaefer123
Copy link

OpenUI5 version: 1.54.3
(CacheBuster is using SAPUI5 for demonstration SCP Feature and running on SCP /resource, but the issue will be the same ;-)

Browser/version (+device/version): Chrome

Any other tested browsers/devices(OK/FAIL): no

URL (minimal example if possible):
https://cachebuster-p1940953245trial.dispatcher.hanatrial.ondemand.com/index.html

Steps to reproduce the problem:
The issues directly thrown during load so no additional task here

What is the expected result?
Loading oData model with products and displaying as list

What happens instead? console log error:

Failed to get contexts for /V4/Northwind/Northwind.svc/Products with start index 0 and length 100 - Error: Expected 'OData-Version' header with value '4.0' but received value '4.0;' in response for /V4/Northwind/Northwind.svc/Products?$skip=0&$top=100

Have a look at received value comparisation and the trailing ";" inside comparator!!!
"4.0" !== "4.0;" ;-)

@ThomasChadzelek
Copy link
Member

Hello @hschaefer123 !

According to the ABNF, Northwind is wrong here. The spec clearly states that the OData version must be "4.0" w/o a trailing semicolon. We are trying to contact someone from Microsoft to get this issue fixed. Thanks a lot for using OData V4 and pointing out this issue. Sorry for any inconvenience caused.

Best regards,
Thomas

;------------------------------------------------------------------------------
; 8. Header values
;------------------------------------------------------------------------------

header = content-id
/ odata-entityid
/ odata-isolation
/ odata-maxversion
/ odata-version
/ prefer

content-id = "Content-ID" COLON OWS 1*unreserved

odata-entityid = "OData-EntityID" COLON OWS IRI-in-header
odata-isolation = "OData-Isolation" COLON OWS "snapshot"
odata-maxversion = "OData-MaxVersion" COLON OWS "4.0"
odata-version = "OData-Version" COLON OWS "4.0"

@philippthiele
Copy link

philippthiele commented May 20, 2020

@ThomasChadzelek any update here? This is even a problem when using Snippix to reproduce errors, so it could really help. Also it wouldn't really hurt to make UI5 a little more error tolerant, so allowing the ; . In the end it doesn't really matter where it is "fixed", but for testing things out, northwind is the standard and that doesn't work currently.

I would even take a code snippet from your side that overwrites the function that checks for "4.0", I wasn't really able to figure out how. But when I stop there with a debugger and overwrite the variable that contains "4.0;" with "4.0" then everything works fine.

@ThomasChadzelek
Copy link
Member

Hello @philippthiele !

Sorry, but we adhere to the spec. Northwind is also broken in other ways, we cannot work around all of that. If you test with Northwind and run into other issues, how would you know if UI5 is wrong or Northwind is wrong? I really suggest to test with a compliant service, that should make your life and our life easier.

We apologize for any inconvenience caused.

Best regards,
Thomas

@philippthiele
Copy link

philippthiele commented May 20, 2020

Hi @ThomasChadzelek ,

ok sure, that is also a possibility, but I was not able to find an open compliant service which I can use to send examples to other people, could you point me and potentially others reading this to such a service?

Thanks and BR

@SeriousSoftware
Copy link

SeriousSoftware commented May 21, 2020

Hello @philippthiele !

Sorry, but we adhere to the spec. Northwind is also broken in other ways, we cannot work around all of that. If you test with Northwind and run into other issues, how would you know if UI5 is wrong or Northwind is wrong? I really suggest to test with a compliant service, that should make your life and our life easier.

We apologize for any inconvenience caused.

Best regards,
Thomas

As a Dutchman I embrace John Postel's Robustness Principle, "Be conservative in what you send, be liberal in what you accept". Thanks to this quality the internet is much better.
This in contrast with a "Gesetz ist Gesetz" principle, The robustness quality is what I miss in OData-land. It could make OData a success.

Best regards

@ThomasChadzelek
Copy link
Member

Hello @SeriousSoftware !

I appreciate Mr. Postel's idea and I am much in favor of robustness, but there is also some criticism for "Postel's law". It is not a simple decision. Fail-fast is also a nice idea.

@philippthiele I would recommend to use TripPin.

Best regards,
Thomas

@ThomasChadzelek
Copy link
Member

Hint: go to https://www.odata.org/ > Developers > Reference Services :-)

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

No branches or pull requests

4 participants