odata-client-php icon indicating copy to clipboard operation
odata-client-php copied to clipboard

Support for OData Int64 identifiers

Open gRegorLove opened this issue 2 years ago • 1 comments

I think the wrapKey function is not aware of 64-bit integers (Edm.Int64) with format [-] [0-9]+L.

I tried a query with one which generated the filter: $filter=(ID eq '354760000354760L').

Instead, I would expect it to generate: $filter=(ID eq 354760000354760L).

The error response from the service was:

The query specified in the URI is not valid. A binary operator with incompatible types was detected. Found operand types 'Edm.Int64' and 'Edm.String' for operator kind 'Equal'.

(Originally published at: https://gregorlove.com/2023/07/support-for-odata-int64-identifiers/)

gRegorLove avatar Jul 13 '23 18:07 gRegorLove

@gRegorLove,

But you should be able to do 354760000354760 without the L suffix.

    $client->from('EntitySet')->whereKey(354760000354760);

Let me know if that doesn't work.

anderly avatar Sep 06 '23 16:09 anderly