Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Edm.Binary literal representation
While Edm.Binary values are Base64 encoded in JSON payload [1][1], the specification demands a prefixed and quoted Base16 encoding for values in URIs and HTTP headers [2][2]. As there has been no specific conversion for Edm.Binary so far and we want to stay backward compatible, the Python side representation shall remain a string with the Base64 encoded payload. However there are cases, where the literal is generated from the payload and sent to the server, that expects it in the correct format. E.g. this happens when building the resource path while using a Edm.Binary property as an entity key (see #187 and phanak-sap/pyodata-issue-files#2). Another case might be when using the $include filter for a Edm.Binary property. To meet those requirements, we want to have these representations: JSON | Python | Literal --------|--------------|------------------------ Base64 | str (Base64) | prefixed quoted Base16 This adds a specific type for Edm.Binary with the necessary conversions. Further it extends the test cases to cover those conversions. As the Edm.Binary type has been used to test the generic prefixed conversions, we need to switch this to the Edm.Byte type, that remains generic. [1](https://www.odata.org/documentation/odata-version-2-0/json-format) [2](https://www.odata.org/documentation/odata-version-2-0/overview/)
- Loading branch information