Breaking change in URL encoding of OData key properties
See original GitHub issueHi, 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:
- Created 2 years ago
- Comments:8 (6 by maintainers)
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!
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.