You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Frederic Souchu (JIRA)" <ji...@apache.org> on 2015/04/08 16:45:12 UTC

[jira] [Updated] (OLINGO-625) EntitySet JSON serializer outputs only base type, not actual instance fields

     [ https://issues.apache.org/jira/browse/OLINGO-625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Frederic Souchu updated OLINGO-625:
-----------------------------------
    Description: 
How to reproduce:
(using the Trips data model)
An entity set defined with a base type 'PlanItem' will be serialized using only *base* type properties, regardless of the actual objects in the set ('Flight' or 'Event' instances)

For reference, the Trips reference service produces the 'correct' output, e.g. serializes actual types, not only 'PlanItem' fields:
http://services.odata.org/V4/(S(q24kmcmzy4slj1gfcisdytwp))/TripPinServiceRW/People('russellwhyte')/Trips(0)/PlanItems

Olingo 4.0.0-beta-02 'removes' derived class fields (Event:Description or Flight:From, To...):
{code:JavaScript}
{
	"@odata.context" : "$metadata#PlanItems",
	"value" : [ {
		"PlanItemId" : 11,
		"ConfirmationCode" : "JH58493",
		"StartsAt" : "2014-01-01T06:15:00Z",
		"EndsAt" : "2014-01-01T11:35:00Z",
		"Duration" : "PT0S",
	}, {
		"PlanItemId" : 13,
		"ConfirmationCode" : "JH38143",
		"StartsAt" : "2014-01-04T17:55:00Z",
		"EndsAt" : "2014-01-04T20:45:00Z",
		"Duration" : "PT0S"
	}, {
		"PlanItemId" : 12,
		"ConfirmationCode" : "4372899DD",
		"StartsAt" : "2014-01-02T13:00:00Z",
		"EndsAt" : "2014-01-02T16:00:00Z",
		"Duration" : "PT3H"
	}]
}
{code}




  was:
An entity set defined with a base type 'PlanItem' will always be serialized using base type properties, regardless of the actual objects in the set ('Flight' or 'Event' instances)

For reference, the Trips reference service produces the 'correct' output, e.g. serializes actual types, not only 'PlanItem' fields:
http://services.odata.org/V4/(S(q24kmcmzy4slj1gfcisdytwp))/TripPinServiceRW/People('russellwhyte')/Trips(0)/PlanItems

Incorrect Olingo output:
{code:JavaScript}
{
	"@odata.context" : "$metadata#PlanItems",
	"value" : [ {
		"PlanItemId" : 11,
		"ConfirmationCode" : "JH58493",
		"StartsAt" : "2014-01-01T06:15:00Z",
		"EndsAt" : "2014-01-01T11:35:00Z",
		"Duration" : "PT0S",
	}, {
		"PlanItemId" : 13,
		"ConfirmationCode" : "JH38143",
		"StartsAt" : "2014-01-04T17:55:00Z",
		"EndsAt" : "2014-01-04T20:45:00Z",
		"Duration" : "PT0S"
	}, {
		"PlanItemId" : 12,
		"ConfirmationCode" : "4372899DD",
		"StartsAt" : "2014-01-02T13:00:00Z",
		"EndsAt" : "2014-01-02T16:00:00Z",
		"Duration" : "PT3H"
	}]
}
{code}





> EntitySet JSON serializer outputs only base type, not actual instance fields
> ----------------------------------------------------------------------------
>
>                 Key: OLINGO-625
>                 URL: https://issues.apache.org/jira/browse/OLINGO-625
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-server
>    Affects Versions: (Java) V4 4.0.0-beta-02
>            Reporter: Frederic Souchu
>
> How to reproduce:
> (using the Trips data model)
> An entity set defined with a base type 'PlanItem' will be serialized using only *base* type properties, regardless of the actual objects in the set ('Flight' or 'Event' instances)
> For reference, the Trips reference service produces the 'correct' output, e.g. serializes actual types, not only 'PlanItem' fields:
> http://services.odata.org/V4/(S(q24kmcmzy4slj1gfcisdytwp))/TripPinServiceRW/People('russellwhyte')/Trips(0)/PlanItems
> Olingo 4.0.0-beta-02 'removes' derived class fields (Event:Description or Flight:From, To...):
> {code:JavaScript}
> {
> 	"@odata.context" : "$metadata#PlanItems",
> 	"value" : [ {
> 		"PlanItemId" : 11,
> 		"ConfirmationCode" : "JH58493",
> 		"StartsAt" : "2014-01-01T06:15:00Z",
> 		"EndsAt" : "2014-01-01T11:35:00Z",
> 		"Duration" : "PT0S",
> 	}, {
> 		"PlanItemId" : 13,
> 		"ConfirmationCode" : "JH38143",
> 		"StartsAt" : "2014-01-04T17:55:00Z",
> 		"EndsAt" : "2014-01-04T20:45:00Z",
> 		"Duration" : "PT0S"
> 	}, {
> 		"PlanItemId" : 12,
> 		"ConfirmationCode" : "4372899DD",
> 		"StartsAt" : "2014-01-02T13:00:00Z",
> 		"EndsAt" : "2014-01-02T16:00:00Z",
> 		"Duration" : "PT3H"
> 	}]
> }
> {code}



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