-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Describe the Bug
The api to get the binary data for a purchase order returns the data in the OutputBinaryData property as Base64Url encoded, but the sdk expects base64 encoded which fails the deserialization.
Api used:
odata4/sap/api_purchaseorder_2/srvd_a2x/sap/purchaseorder/0001/PurchaseOrder/:id/SAP__self.GetOutputBinaryData()
AI summary of the problem:
odata-v4-core binary deserialization rejects valid Base64URL values for Edm.Binary.
In ODataGenericConverter ODataGenericConverter.java, binary decoding uses Base64.getDecoder() only. If an OData V4 service returns URL-safe Base64 (- and _) in an Edm.Binary field, typed deserialization fails and logs Not deserializable.
This Breaks typed deserialization for services returning Base64URL-encoded binary (for example, S/4HANA GetOutputBinaryData response field OutputBinaryData).
Steps to Reproduce
- Compile a purchase order service
- Use the service to GetOutputBinaryData()
- See deserialisation error when trying to deserialize the response to D_PurOrdGetOutputBinaryDataR.
Expected Behavior
Either the API should conform to returning base64 encoded binaries (which probably would be tricky to roll out), or the sdk needs to correctly treat the OutputBinaryData property to be Base64Url-encoded.
Used Versions
- Java and Maven version via
mvn --version: ... - SAP Cloud SDK version: 5.26.0
- Spring Boot or CAP version: ...
Impact
Inconvenience, We implemented a work around where we get the response raw and manually decode the property.