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

Kevin Ratnasekera commented on OLINGO-567:
------------------------------------------

Hi Christian,
I worked a bit in this issue, and attached the patch here with issue.  ( 
protocol 
http://docs.oasis-open.org/odata/odata-json-format/v4.0/errata02/os/odata-json-format-v4.0-errata02-os-complete.html
 ) But this needs to be improved and need some clean up. Please have a look at 
it, and provide me a feedback so that further improvements can be done. I just 
tested changes with the Car/Manufacturer example, furthers tests need to done 
too.
I have added entity metadata such as odata.id , odata.type, 
odata.associationLink, odata.navigationLink when accept header parameter is set 
to odata_metadata=full.

eg. GET 
http://localhost:8080/odata-server-sample-4.0.0-beta-03-SNAPSHOT/cars.svc/Manufacturers(1)

1. odata_metadata=none

{
   "Id": 1,
   "Name": "Star Powered Racing",
   "Address":    {
      "Street": "Star Street 137",
      "City": "Stuttgart",
      "ZipCode": "70173",
      "Country": "Germany"
   }
}

2. odata_metadata=minimal

{
   "@odata.context": "$metadata#Manufacturers/$entity",
   "Id": 1,
   "Name": "Star Powered Racing",
   "Address":    {
      "Street": "Star Street 137",
      "City": "Stuttgart",
      "ZipCode": "70173",
      "Country": "Germany"
   }
}

3. odata_metadata=full

{
   "@odata.type": "#olingo.odata.sample.Manufacturer",
   "@odata.id": "Manufacturers(1)",
   "@odata.context": "$metadata#Manufacturers/$entity",
   "[email protected]": "#Int16",
   "Id": 1,
   "[email protected]": "#String",
   "Name": "Star Powered Racing",
   "[email protected]": "#olingo.odata.sample.Address",
   "Address":    {
      "[email protected]": "#String",
      "Street": "Star Street 137",
      "[email protected]": "#String",
      "City": "Stuttgart",
      "[email protected]": "#String",
      "ZipCode": "70173",
      "[email protected]": "#String",
      "Country": "Germany"
   },
   "[email protected]": "Manufacturers(1)/Cars/$ref",
   "[email protected]": "Manufacturers(1)/Cars"
}

Regards
Kevin


> Support odata.metadata=full on server side serialization
> --------------------------------------------------------
>
>                 Key: OLINGO-567
>                 URL: https://issues.apache.org/jira/browse/OLINGO-567
>             Project: Olingo
>          Issue Type: Improvement
>          Components: odata4-server
>    Affects Versions: (Java) V4 4.0.0-beta-02
>            Reporter: Christian Amend
>             Fix For: (Java) V4 4.0.0-beta-03
>
>         Attachments: odata_metadata=full_support_for_V4_4_0_0-beta-02.patch
>
>
> Support odata.metadata=full on server side serialization. Currently we throw 
> a not supported exception during serializer creation.



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

Reply via email to