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-683) Clients should be prepared to deal with new derived types


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

Evan Ireland commented on ODATA-683:
------------------------------------

It would be necessary to define how a client is expected to "be prepared".

If the client has already received metadata that declares an entity set S of type A (which had no subtypes), and now the client receives an instance of B (which extends A; assume that the metadata has changed but the client is still working with previously received metadata), is the client allowed to treat it as an A (since the client does not have the type B in its previously received metadata). If the client were to do a PUT, sending "@odata.type" of A (since it doesn't know about B), would that be a valid instance of the client being prepared? How should the server respond? With an error (since the client has truncated the B to an A).

It might be preferable for the client to throw an exception on receipt of a B. Being prepared could mean that the client catches the exception, reloads the metadata, and reissues their request.

> Clients should be prepared to deal with new derived types
> ---------------------------------------------------------
>
>                 Key: ODATA-683
>                 URL: https://tools.oasis-open.org/issues/browse/ODATA-683
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Bug
>          Components: OData Protocol 
>    Affects Versions: V4.0_OS
>         Environment: [Proposed]
>            Reporter: Michael Pizzo
>            Priority: Minor
>             Fix For: V4.0_ERRATA02
>
>
> In metadata versioning we currently say that it's safe to add a new type as long as it "does not derive from any entity types exposed by existing entity sets, or returned by existing functions or actions"
> This implies that it is not safe to add a new entity type that derives from an entity type used in an entity set/function/action. But this restriction is unnecessary, as clients should always be prepared for new types not specified in $metadata (for example, types of dynamic properties).
> The same is true for complex types.
> For such derived types, the payload will contain the @odata.type annotation with the qualified name of the metadata describing the type, and clients should always be prepared for such types.



--
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]