Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-17506

olingo4 should always look for a single entity when a predicate key is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.25.2, 3.14.0
    • 3.14.1, 3.15.0
    • camel-olingo4
    • None
    • Unknown

    Description

      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:

      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));
      } 

      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) 4.3.6 example 26, a key predicate with several parts is just that, a multi-part key predicate still adressing a single entity.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              damienb Damien B
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: