You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Frédéric SOUCHU <Fr...@ingenico.com> on 2015/04/07 19:23:35 UTC

Is it possible to expand a derived type?

I'd like to output an 'extension' property (named 'ext') attached to my main record (say, 'transactions').
The base complex type only contains the name of the extension, the actual instances are derived complex types (say Ext_A and Ext_B types).

Edm declaration is fine, I can type:
http://myservice/Transactions?$expand=ext/mycompany.com.Ext_A

However, the serializer does nothing (?) with the expand option.
E.g. the output always produce 'Ext' fields only, not derived instance fields:
{
     "value":[{
           "transactionid":1,
          "ext": { "name": "Ext_A"}
           },
{
           "transactionid":2,
          "ext": { "name": "Ext_B"}
           }]
}

Looking at the OData specs, I was kind of expecting a JSON output such as:
{
     "value":[{
           "transactionid":1,
          "ext": {
"name": "Ext_A",
// 'expanded' fields using the correct type
"A_field1" : value,
"A_field2" : value,
...
}
           },
{
           "transactionid":2,
          "ext": { "name": "Ext_B"}
           }]
}

Regards,
Frederic