Openui5: OData request URLs: eliminate whitespaces between comma-separated query values

Created on 7 Feb 2020  路  2Comments  路  Source: SAP/openui5

URL (minimal example if possible)

  1. Issue: https://blogs.sap.com/2017/12/05/new-sap-gateway-demo-system-available/#comment-466182
  2. Sample: https://jsbin.com/diroyed/edit?js,output (My proxy server is taken down)

Prerequisite

  • Valid user account to access sample OData services from https://sapes5.sapdevcenter.com (Follow the linked blog post above)

Steps to reproduce the problem

  1. Open the linked JSBin sample. After entering credentials, the entities are fetched.
  2. Add a space after the comma in select: 'ProductID,Name' --> select: 'ProductID, Name'

What is the expected result?

Having space(s) in between, framework "normalizes" the request URL by removing them if applicable.

What happens instead?

Due to the OData service failing to handle whitespaces (which seems to be a common issue for OData services from SAP gateway), the backend throws a vague error, even though refrence services (e.g. Northwind) as well as OData spec allow such whitespaces in comma-separated query values.

Any other information? (attach screenshot if possible)

In case there is a compatibility issue; would it be possible to introduce an array-syntax for the properties in ODataListBinding? That would help developers avoid dealing with spaces

select: [ // or expand
  'propertyA',
  'ToB/propertyB',
  '...',
] // request URL ==> "...?$select=propertyA,ToB/propertyB&..."
consulting enhancement

Most helpful comment

Hello @boghyon !

This array syntax is already supported by the new OData V4 model :-)

Best regards,
Thomas

All 2 comments

Hello @boghyon !

This array syntax is already supported by the new OData V4 model :-)

Best regards,
Thomas

Hello @boghyon ,

the OData V2 spec allows these whitespaces. The colleagues of Gateway have provided a fix for SAP S/4 HANA Cloud 1911.

As to allowing the array syntax for the OData V2 model: We have discussed this but decided against providing this for the V2 model.

Best regards
Mathias.

Was this page helpful?
0 / 5 - 0 ratings