You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Frederic Souchu (JIRA)" <ji...@apache.org> on 2015/06/02 09:47:18 UTC

[jira] [Created] (OLINGO-680) URI parser does not allow counting filtered collections

Frederic Souchu created OLINGO-680:
--------------------------------------

             Summary: URI parser does not allow counting filtered collections
                 Key: OLINGO-680
                 URL: https://issues.apache.org/jira/browse/OLINGO-680
             Project: Olingo
          Issue Type: Bug
          Components: odata4-server
    Affects Versions: (Java) V4 4.0.0-beta-03
            Reporter: Frederic Souchu


According to OData specifications:
[11.2.9 Requesting the Number of Items in a Collection|http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398314]
…
Example 64: return the number of all products whose Price is less than $10.00
http://host/service/Products/$count?$filter=Price lt 10.00
The /$count segment can be used in combination with the $filter system query option.

Using provider based on the ServiceHandler class, the following URL:
{code}
http://localhost/myservice/Stores/$count?$filter=ID eq '123465'
{code}
produces that error:
{code}
{
  "error": {
    "code": null,
    "message": "The key value 'ID' is invalid."
  }
}
{code}

Initial analysis:
The $count option (UriResourceCountImpl) pushes a context without any type (context.contextTypes = []).
The $filter option then raises an exception when trying to introspect the type provided by the last URI segment.

 




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)