I have implemented a WCD Data Services / OData server, with an entity set as an open type. I am using custom IMetadataProvider, IQueryProvider, etc. I can create my entity, set open properties, retrieve them, update, and search -- mostly. The problem comes when I attempt to search for a property with something like a "dash" in the name
This works:
GET /Service/Cases?$filter=ABC eq 'ABC'
This doesn't work:
GET /Service/Cases?$filter=A-BC eq 'ABC'
This also doesn't work:
GET /Service/Cases?$filter=A%2DBC eq 'ABC'
I get the following error:
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code />
<message xml:lang="en-US">Syntax error at position 7.</message>
</error>
(And as I said, I am able to get an entity with an open property with a dash in the name. And update it, etc.)
I would guess that whatever is parsing the URL is interpreting the dash as a subtraction expression, which makes sense. Except that if I read the OData spec correctly, an entity's property name is defined by entitySimpleProperty (which isn't defined in the spec, but I presume is a typo for entityProperty)... which is defined as *pchar, as defined in RFC 3986 section 3.3. That, in turn, evaluates to...
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
/ "*" / "+" / "," / ";" / "="
Where ALPHA is %41-%5A and %61-%7A, DIGIT is %30-%39, hyphen is %2D, period is %2E, underscore is %5F, and tilde is %7E.
And that shows that a dash is a legal character, coming full circle. Not that I need it to be. So, what part of the spec dictates what the allowable characters are?
Thanks for any help!