[ 
https://issues.apache.org/jira/browse/OLINGO-425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14278848#comment-14278848
 ] 

Christian Holzer commented on OLINGO-425:
-----------------------------------------

Hi Mark,
Thanks for your quick response. As I found out, the client uses the java type 
to determine the correct format. The type used in the meta document  will not 
be considered. Can you please check, if the java type UUID.

@Test
public void keyAsSegement() throws Exception {
   getClient().getConfiguration().setKeyAsSegment(true);
   final UUID guid = UUID.fromString("f872e367-02c7-4012-a01c-0f5b7c5636ae");
   final UUID guidUser = 
UUID.fromString("148d1101-58fb-410b-ad6d-7379fd9564ca");
   final URI uri = 
getClient().newURIBuilder("myhost/myService").appendEntitySetSegment("ProductDetails")
        
.appendKeySegment(guid).appendEntitySetSegment("users").appendKeySegment(guidUser).build();

   assertEquals(new 
URI("myhost/myService/ProductDetails/f872e367-02c7-4012-a01c-0f5b7c5636ae/users/"
        + "148d1101-58fb-410b-ad6d-7379fd9564ca"),  uri);
    getClient().getConfiguration().setKeyAsSegment(false);
  }
 
Best Regards,
Christian


> The key should not be in quotes when setKeyAsSegment is enabled
> ---------------------------------------------------------------
>
>                 Key: OLINGO-425
>                 URL: https://issues.apache.org/jira/browse/OLINGO-425
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-client
>    Affects Versions: V4 4.0.0-beta-01
>            Reporter: Mark Sztainbok
>             Fix For: (Java) V4 4.0.0-beta-02
>
>         Attachments: Olingo425.diff
>
>
> When setKeyAsSegment is set to true on the client configuration, Olingo is 
> incorrectly placing the key in quotes i.e. it is putting the URI as 
> /f872e367-02c7-4012-a01c-0f5b7c5636ae/users/'148d1101-58fb-410b-ad6d-7379fd9564ca'
>  when it should be 
> /f872e367-02c7-4012-a01c-0f5b7c5636ae/users/148d1101-58fb-410b-ad6d-7379fd9564ca
> Having the quotes causes failures in the service in this case.



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

Reply via email to