[
https://issues.apache.org/jira/browse/OLINGO-1129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16103862#comment-16103862
]
Hui Wang commented on OLINGO-1129:
----------------------------------
Hi Ramya,
The url parser of Olingo already provides adequate functionality for dealing
with type filters, but it seems that the ODataJsonSerializer is not generating
the appropriate response for the entities, which is this story meant to be. The
result is that, only the properties that belong to the base entity type are
shown in the response, but the properties that only belong to the derived type
are missing in the response because the serializer doesn't deal with the
typeFilter when it's writing the expanded navigation properties. I took a look
at the new commits for this issue but I didn't find any change that seems to be
able to fix it. I think the method that should take this responsibility is
ODataJsonSerializer.writeExpandedNavigationProperty(). And I didn't find any
logic there handles the typeFilter, or even gets the typeFilter passed in. A
possible solution I think of is to add one more argument into the method to
indicate the derived type: EdmEntityType typeFilter. This typeFilter will be
retrieved from the ExpandOption in the caller method
writeNavigationProperties().
Not sure if I missed some information and perhaps the fix was somewhere already
but I don't know.
Thanks,
Hui
> ODataJsonSerializer Does Not Support Derived Type in $expand Option
> -------------------------------------------------------------------
>
> Key: OLINGO-1129
> URL: https://issues.apache.org/jira/browse/OLINGO-1129
> Project: Olingo
> Issue Type: New Feature
> Components: odata4-server
> Affects Versions: (Java) V4 4.3.0
> Reporter: Hui Wang
> Priority: Minor
>
> Currently we need to use type casting to a derived type in $expand. Here is
> the corresponding part in the OData Protocol.
> http://docs.oasis-open.org/odata/odata/v4.0/errata03/os/complete/part2-url-conventions/odata-v4.0-errata03-os-part2-url-conventions-complete.html#_Toc453752352
> To reproduce:
> Here is an example URL provided in the documentation that could be used for
> reproducing the defect:
> http://host/service/Orders?$expand=Customer/Model.VipCustomer
> In the current 4.3 version, ODataJsonSerializer only deals with expand on
> Customer but ignores the type filter Model.VipCustomer. It means, the
> response would only show the content of super type Customer. Any custom
> properties in derived type VipCustomer wouldn't be returned.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)