[ 
https://issues.apache.org/jira/browse/CAMEL-17506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen updated CAMEL-17506:
--------------------------------
    Priority: Minor  (was: Major)

> olingo4 should always look for a single entity when a predicate key is used
> ---------------------------------------------------------------------------
>
>                 Key: CAMEL-17506
>                 URL: https://issues.apache.org/jira/browse/CAMEL-17506
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-olingo4
>    Affects Versions: 2.25.2, 3.14.0
>            Reporter: Damien B
>            Priority: Minor
>
> In org.apache.camel.component.olingo4.api.impl.Olingo4AppImpl , the following 
> snippet of code is used to decide wether we receive an entity or an entitySet 
> on a read query with a keyPredicate:
> {code:java}
> List<UriParameter> keyPredicates = uriResourceEntitySet.getKeyPredicates();
> // Check result type: single Entity or EntitySet based
> // on key predicate detection
> if (keyPredicates.size() == 1) {
>   response = (T) odataReader.readEntity(content, 
> getResourceContentType(uriInfo));
> } else {
>   response = (T) odataReader.readEntitySet(content, 
> getResourceContentType(uriInfo));
> } {code}
> It assumes that if we have multiple parts in the key predicate, then we 
> expect several entities in the response. But as we can see in [OData Version 
> 4.01. Part 2: URL Conventions 
> (oasis-open.org)|https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_KeyasSegmentConvention]
>  4.3.6 example 26, a key predicate with several parts is just that, a 
> multi-part key predicate still adressing a single entity.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to