question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breaking change in URL encoding of OData key properties

See original GitHub issue

Hi, I found that the cloud SDK does handle URL encoding for key properties differently since 1.45. I would like to know if this was intended as I did not find anything about this breaking change in the release notes.

The change is this: up to 1.44 the key properties were encoded when performing an OData GET. Since 1.45 this does not happen anymore.

Example:

I created an application for reading and writing BSP applications to ABAP repositories to use in our CI/CD pipelines, consuming the SAP standard service /UI5/ABAP_REPOSITORY_SRV. The entity Repository has a key consisting of only one property, Name.

In order to read information about a repository I need to perform this request:

GET /sap/opu/odata/UI5/ABAP_REPOSITORY_SRV/Repositories(Name='%2FUI2%2FUSHELL')?$format=json

When using version 1.44 of the cloud SDK exactly this URL is generated.

But since 1.45 the request looks like this:

GET /sap/opu/odata/UI5/ABAP_REPOSITORY_SRV/Repositories(Name='/UI2/USHELL')?$format=json

This is a valid URL consisting of the segments

  • Repositories(Name='
  • UI2
  • USHELL')?$format=json

where there should only be one segment

  • Repositories(Name='%2FUI2%2FUSHELL')?$format=json

So the system responds with this message: Invalid URI segment ‘Repositories(Name=’’

Is this behavior intended? In this case the calling application would have to do the encoding itself; but in this case the cloud SDK must not do additional encoding in order to prevent duplicate encoding of strings.

Thanks a lot,

Lennart

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
marikanercommented, Aug 24, 2021

Hey @lennart-m,

this issue should be fixed in version 1.48.0. I will go ahead and close this issue for now, but let us know if you encounter further problems. Thank you for reporting this!

0reactions
deekshas8commented, Feb 21, 2022

Hi @lennart-m,

We have fixed the bug in our latest released v2.1.0. Let us know if this resolves your issue. I’ll close the ticket for now. If you still experience problems, please reopen.

Note: We released our new major 2.0 version earlier this month and will no longer be fixing bugs in version 1.x. Please upgrade to v2 of the SDK. You can find the upgrade guide for the steps. If you face issues during the upgrade, feel free to open an issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

OData Version 4.01. Part 2: URL Conventions - OASIS Open
Example 2: OData URL broken down into its component parts: ... are treated as part of the key value and do not need...
Read more >
URL Conventions (OData Version 3.0)
This specification defines a set of recommended (but not required) rules for constructing URLs to identify the data and metadata exposed by an...
Read more >
ASP.NET Core OData 8.x changelog - Microsoft Learn
Be noted Breaking changes in ODataSegmentTemplate · Use ActionName in conventional routing · Make CreateRef, DeleteRef, GetRef for generic ...
Read more >
c# - OData Error: The query specified in the URI is not valid ...
Could it be the case of the property? · @Igor I've tried that. · Have you tried $filter with another property on the...
Read more >
[Feature] Configurable URL Encoding · Issue #605 - GitHub
[Feature Request] Automatic encoding of $ breaks OData APIs #592 ... it's important to recognise that query parameters are not part of URI...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found