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

Eugene Kari commented on OLINGO-1246:
-------------------------------------

{quote}The key properties are included as part of the context url and also the 
response payload even if the select clause does not include the key properties
{quote}
[~ramya.vasanth], this fix added duplication values of the key properties to 
the response.

Example:
{code:java}
Request:
localhost:3333/data/Entities?%24filter=Id%20eq%201&%24select=Currency

Response:
{
   "@odata.context": "$metadata#Entities",
   "value": [   {
      "@odata.id": "Entities(Id=1,Type='check')",
      "Id": 1,
      "Type": "check",
      "Currency": null
   }]
}

Metadata:
{
   "$Version": "4.01",
   "OData.Ent":    {
      "Entity":       {
         "$Kind": "EntityType",
         "$Key":          [
            "Id",
            "Type"
         ],
         "Id": {"$Type": "Edm.Int64"},
         "Type": {"$Type": "Edm.String"},
         "Currency": {"$Type": "Edm.String"}
      },
      "Container":       {
         "$Kind": "EntityContainer",
         "Entities":          {
            "$Kind": "EntitySet",
            "$Type": "OData.Ent.Entity"
         }
      }
   }
}
{code}
Following the OData documentation, adding odata.id was done correctly in the 
absence of key properties in the request, but the appearance of the key 
properties themselves in this response is redundant. Don't you think so?

> OData V4: Fixes for Context url when the URL has select clause and expand 
> clause having select
> ----------------------------------------------------------------------------------------------
>
>                 Key: OLINGO-1246
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1246
>             Project: Olingo
>          Issue Type: Bug
>    Affects Versions: (Java) V4 4.4.0
>            Reporter: Ramya
>            Priority: Major
>
> If url is of the form 
> EntitySetA?$select=NavPropertyToMany&$expand=NavPropertyToMany
> then context url should be of the form 
> #EntitySetA(NavPropertyToMany,NavPropertyToMany())
> If url is of the form 
> EntitySetA?$select=NavPropertyToMany&$expand=NavPropertyToMany($select=Property)
>  then the context url should be of the form
> #EntitySetA(NavPropertyToMany,NavPropertyToMany(Property))
> If url is of the form 
> EntitySetA?$expand=NavPropertyToOne1($expand=NavPropertyToOne2), then the 
> context url should be 
> #EntitySetA(NavPropertyToOne1(NavPropertyToOne2()))
> If url is of the form 
> EntitySetA?$expand=NavPropertyToOne,NavPropertyToMany($select=Property), then 
> context url should be
> #EntitySetA(NavPropertyToOne(),NavPropertyToMany(Property))



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to