VendorV3 URL needs quotes in parameters
jaredtbates opened this issue · comments
Hi there! We're using this library and are super thankful for the effort you put in to build it. We're just encountering a small issue when trying to get an entity by its ID, specifically VendorV3
. The library creates a URL of /data/VendorsV3(dataAreaId=XXX,VendorAccountNumber=VEN-000001)
for example, but gets a 404 error. I found in order to make this work, I have to add single-quotes to the parameters, like so: /data/VendorsV3(dataAreaId='XXX',VendorAccountNumber='VEN-000001')
.
Any help you could provide would be great. If you'd like a PR, I'm fully willing to work on one, but wanted to check this wasn't already covered first. Thank you!
Glad it's going to be useful. The relevant odata 4 specification will probably mention quote usage. We should check it. I'm away camping for the week so can't sort it out for you right now but a PR welcome.
Feel free to wait till Monday when I'll address this
Thanks @davidmoten! Had some other things come up this week. I'd appreciate it if you can look at it, but no rush!
There's a bit of ambiguity in the standard about this:
with quotes:
http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_AlternateKeys
without quotes:
http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_URLsforRelatedEntitieswithReferentia
This is a bit more enlightening, appears that the presence of quotes is dependent on the type of the value (for example a string is quoted but a date-time is not):
https://docs.oasis-open.org/odata/odata/v4.01/os/abnf/odata-abnf-construction-rules.txt
Thanks very much for reporting this. I've fixed the problem in odata-client 0.1.86 which is on Maven Central now. Please give it a spin and any problems reopen this issue or open a new one.