OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

odata message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: [OASIS Issue Tracker] (ODATA-1003) Allow casting of entities and complex type instances to arbitrary structural type


    [ https://issues.oasis-open.org/browse/ODATA-1003?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=64940#comment-64940 ] 

Michael Pizzo commented on ODATA-1003:
--------------------------------------

Do we have useful scenarios for arbitrary structural casting by names? 

Note that ODATA-696 defines casting a cast segment that is not based on names.  It basically allows an instance to be of more than one type, and to treat it as any of a number of types that may have all, some, or no names in common, and may have different definitions for the same name.  This allows us to use types similar to interfaces  -i.e., a type may (explicitly) support multiple different interfaces, and casting a type to a supported interface may provide a completely different set of properties.

I'm a bit concerned about defining the cast() function with different semantics; unless we have a use case for doing so, it seems like it could minimally lead to confusion, and worse lead to unexpected results.

> Allow casting of entities and complex type instances to arbitrary structural type
> ---------------------------------------------------------------------------------
>
>                 Key: ODATA-1003
>                 URL: https://issues.oasis-open.org/browse/ODATA-1003
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: New Feature
>          Components: OData URL Conventions
>    Affects Versions: V4.0_ERRATA03
>            Reporter: Hubert Heijkers
>            Assignee: Hubert Heijkers
>            Priority: Minor
>             Fix For: V4.01_CSD02
>
>
> Currently we allow casting, by means of a type segment, which implicitly filters or, in expressions in our query options, by using the cast function.
> Whereas the cast function allows, optionally, casting to an arbitrary structured type, there is no way to request for an instance of a type and have it, before returning it, be cast to a different arbitrary, typically sibling (read: same base type) type.
> BTW if a cast would be not supported/allowed I'd simply expected a 400 Bad Request to be returned by the server.



--
This message was sent by Atlassian JIRA
(v6.2.2#6258)


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]