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=64304#comment-64304 ] 

Ralf Handl commented on ODATA-1003:
-----------------------------------

Note that ODATA-953 removes the current wording on structural casting with the cast() function. 

Does this issue want to reintroduce arbitrary casting between structured types with the cast() function, and just remove the assumption of casting properties by name?

New text (guess):
- Services MAY support structural casting of entities and complex type instances to a derived type, or to an arbitrary structured type. If an instance of the type doesn't support the cast, a null is returned. The target type of the cast may have some or no properties in common with the source type, and properties with the same name may have different values and even different types. 

Old text
- Services MAY support structural casting of entities and complex type instances to a derived type, or arbitrary structured type, by assigning values of identically named properties and casting them recursively. The cast fails if one of the property-value casts fails or the target type contains non-nullable properties that have not been assigned a value.



> 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
>            Priority: Minor
>
> 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]