You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by Ramesh Reddy <ra...@redhat.com> on 2015/06/17 22:27:06 UTC
ODataClient - Default ODataFormat
Hi,
When using Olingo V4 client and issuing a Entity request, I observed that the default ODataFormat is to "application/json;odata.metadata=full", then the request fails with 406. I know, Olingo is process of supporting the "odata.metadata=full", but the question I have wouldn't it be better this is mapped to "odata.metadata=minimal"?
I see that one can set this client configuration, but having a good default will save some time for a client developer. WDYT?
Thanks
Ramesh..
Re: ODataClient - Default ODataFormat
Posted by Ramesh Reddy <ra...@redhat.com>.
Thanks for the explanation. The choice made makes sense to me.
Ramesh..
----- Original Message -----
> On 18/06/2015 14:40, Ramesh Reddy wrote:
> > Thanks.
> >
> > I am using the last option you mentioned, "getClient()", I am not sure what
> > the difference yet with "getEDMClient()" methods, and advantages over the
> > other.
>
> The Java methods you get access to are exactly the same.
>
> The difference is in the way how JSON payloads are interpreted: when you
> know in advance (EdmEnabledClient) that a certain property is of type
> Edm.Date you will not need any @odata.type information during parsing to
> interpret its values as Date.
>
> And so on, for complex properties, function / action parameters and
> invocation...
>
> HTH
> Regards.
>
> > ----- Original Message -----
> >> On 17/06/2015 22:27, Ramesh Reddy wrote:
> >>> Hi,
> >>>
> >>> When using Olingo V4 client and issuing a Entity request, I observed that
> >>> the default ODataFormat is to "application/json;odata.metadata=full",
> >>> then
> >>> the request fails with 406. I know, Olingo is process of supporting the
> >>> "odata.metadata=full", but the question I have wouldn't it be better this
> >>> is mapped to "odata.metadata=minimal"?
> >>>
> >>> I see that one can set this client configuration, but having a good
> >>> default
> >>> will save some time for a client developer. WDYT?
> >> IIRC, the default format returned by default by client library is
> >>
> >> * ODataFormat.JSON ("odata.metadata=minimal") for EdmEnabledClient,
> >> e.g. for client library which requires Edm Metadata document fetch and
> >> parse prior to any further operation
> >> Obtain such instances via
> >>
> >> https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L32
> >>
> >> or
> >>
> >> https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L36
> >>
> >> * ODataFormat.JSON_FULL_METADATA ( Konsole output
> >> "odata.metadata=full") for 'plain' Client, e.g. for client library which
> >> does not require anything before start issuing OData calls
> >> Obtain such instances via
> >>
> >> https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L28
> >>
> >> HTH
> >> Regards.
>
> --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellence
> http://www.tirasa.net/
>
> Involved at The Apache Software Foundation:
> member, Syncope PMC chair, Cocoon PMC, Olingo PMC
> http://people.apache.org/~ilgrosso/
>
>
Re: ODataClient - Default ODataFormat
Posted by Francesco Chicchiriccò <il...@apache.org>.
On 18/06/2015 14:40, Ramesh Reddy wrote:
> Thanks.
>
> I am using the last option you mentioned, "getClient()", I am not sure what the difference yet with "getEDMClient()" methods, and advantages over the other.
The Java methods you get access to are exactly the same.
The difference is in the way how JSON payloads are interpreted: when you
know in advance (EdmEnabledClient) that a certain property is of type
Edm.Date you will not need any @odata.type information during parsing to
interpret its values as Date.
And so on, for complex properties, function / action parameters and
invocation...
HTH
Regards.
> ----- Original Message -----
>> On 17/06/2015 22:27, Ramesh Reddy wrote:
>>> Hi,
>>>
>>> When using Olingo V4 client and issuing a Entity request, I observed that
>>> the default ODataFormat is to "application/json;odata.metadata=full", then
>>> the request fails with 406. I know, Olingo is process of supporting the
>>> "odata.metadata=full", but the question I have wouldn't it be better this
>>> is mapped to "odata.metadata=minimal"?
>>>
>>> I see that one can set this client configuration, but having a good default
>>> will save some time for a client developer. WDYT?
>> IIRC, the default format returned by default by client library is
>>
>> * ODataFormat.JSON ("odata.metadata=minimal") for EdmEnabledClient,
>> e.g. for client library which requires Edm Metadata document fetch and
>> parse prior to any further operation
>> Obtain such instances via
>>
>> https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L32
>>
>> or
>>
>> https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L36
>>
>> * ODataFormat.JSON_FULL_METADATA ( Konsole output
>> "odata.metadata=full") for 'plain' Client, e.g. for client library which
>> does not require anything before start issuing OData calls
>> Obtain such instances via
>>
>> https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L28
>>
>> HTH
>> Regards.
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/
Re: ODataClient - Default ODataFormat
Posted by Ramesh Reddy <ra...@redhat.com>.
Thanks.
I am using the last option you mentioned, "getClient()", I am not sure what the difference yet with "getEDMClient()" methods, and advantages over the other.
Ramesh..
----- Original Message -----
> On 17/06/2015 22:27, Ramesh Reddy wrote:
> > Hi,
> >
> > When using Olingo V4 client and issuing a Entity request, I observed that
> > the default ODataFormat is to "application/json;odata.metadata=full", then
> > the request fails with 406. I know, Olingo is process of supporting the
> > "odata.metadata=full", but the question I have wouldn't it be better this
> > is mapped to "odata.metadata=minimal"?
> >
> > I see that one can set this client configuration, but having a good default
> > will save some time for a client developer. WDYT?
>
> IIRC, the default format returned by default by client library is
>
> * ODataFormat.JSON ("odata.metadata=minimal") for EdmEnabledClient,
> e.g. for client library which requires Edm Metadata document fetch and
> parse prior to any further operation
> Obtain such instances via
>
> https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L32
>
> or
>
> https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L36
>
> * ODataFormat.JSON_FULL_METADATA ( Konsole output
> "odata.metadata=full") for 'plain' Client, e.g. for client library which
> does not require anything before start issuing OData calls
> Obtain such instances via
>
> https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L28
>
> HTH
> Regards.
>
> --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellence
> http://www.tirasa.net/
>
> Involved at The Apache Software Foundation:
> member, Syncope PMC chair, Cocoon PMC, Olingo PMC
> http://people.apache.org/~ilgrosso/
>
>
Re: ODataClient - Default ODataFormat
Posted by Francesco Chicchiriccò <il...@apache.org>.
On 17/06/2015 22:27, Ramesh Reddy wrote:
> Hi,
>
> When using Olingo V4 client and issuing a Entity request, I observed that the default ODataFormat is to "application/json;odata.metadata=full", then the request fails with 406. I know, Olingo is process of supporting the "odata.metadata=full", but the question I have wouldn't it be better this is mapped to "odata.metadata=minimal"?
>
> I see that one can set this client configuration, but having a good default will save some time for a client developer. WDYT?
IIRC, the default format returned by default by client library is
* ODataFormat.JSON ("odata.metadata=minimal") for EdmEnabledClient,
e.g. for client library which requires Edm Metadata document fetch and
parse prior to any further operation
Obtain such instances via
https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L32
or
https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L36
* ODataFormat.JSON_FULL_METADATA ( Konsole output
"odata.metadata=full") for 'plain' Client, e.g. for client library which
does not require anything before start issuing OData calls
Obtain such instances via
https://github.com/apache/olingo-odata4/blob/master/lib/client-core/src/main/java/org/apache/olingo/client/core/ODataClientFactory.java#L28
HTH
Regards.
--
Francesco Chicchiriccò
Tirasa - Open Source Excellence
http://www.tirasa.net/
Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/
RE: ODataClient - Default ODataFormat
Posted by Mark Stafford <ma...@microsoft.com>.
FYIW, we typically default the .NET client to minimal since it's smart enough to put things back together and that saves bandwidth (obviously). There are certain scenarios (e.g., $select) where we bump up to full.
-----Original Message-----
From: Ramesh Reddy [mailto:rareddy@redhat.com]
Sent: Thursday, June 18, 2015 4:27 AM
To: dev@olingo.apache.org
Subject: ODataClient - Default ODataFormat
Hi,
When using Olingo V4 client and issuing a Entity request, I observed that the default ODataFormat is to "application/json;odata.metadata=full", then the request fails with 406. I know, Olingo is process of supporting the "odata.metadata=full", but the question I have wouldn't it be better this is mapped to "odata.metadata=minimal"?
I see that one can set this client configuration, but having a good default will save some time for a client developer. WDYT?
Thanks
Ramesh..