Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic/Additional properties of a non-open type #400

Closed
congysu opened this issue Dec 1, 2015 · 3 comments
Closed

Dynamic/Additional properties of a non-open type #400

congysu opened this issue Dec 1, 2015 · 3 comments
Assignees
Milestone

Comments

@congysu
Copy link
Contributor

congysu commented Dec 1, 2015

A dynamic property in a non-open type is asymmetric - Set by server, read by client; but not other way around.

Properties declared as part of a structured type's definition are called declared properties. Instances of structured types may contain additional undeclared dynamic properties. A dynamic property cannot have the same name as a declared property. Entity or complex types which allow clients to persist additional undeclared properties are called open types.
...
To create an open entity (an instance of an open type), additional property values beyond those specified in the metadata MAY be sent in the request body. The service MUST treat these as dynamic properties and add them to the created instance.
If the entity being created is not an open entity, additional property values beyond those specified in the metadata SHOULD NOT be sent in the request body. The service MUST fail if unable to persist all property values specified in the request.
http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html

Dynamic properties can be used in the same way as declared properties. If they are not defined on an instance, they evaluate to null.
http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part2-url-conventions.html

Note: structural and navigation properties MAY be returned by the service on instances of any structured type, whether or not the type is marked as open. Clients MUST always be prepared to deal with additional properties on instances of any structured type, see [OData‑Protocol].
http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part3-csdl.html

@congysu congysu added this to the 6.15 milestone Dec 1, 2015
@congysu
Copy link
Contributor Author

congysu commented Dec 1, 2015

A related issue #179 with PR #218's done in 6.13, when EnableFullValidation is false.

@VikingsFan
Copy link
Contributor

Cost estimating: 4 days
Pruduct Code: Support open property in ODataJsonLightEntryAndFeedDeserializer & ODataJsonLightPropertySerializer (this is already supported by option (IgnoreUndeclaredValueProperties & EnableFullValidation but need always supported))
Test Code: Need add cases and fix non-throwing exception behavior caused failed case.

@LianwMS
Copy link
Contributor

LianwMS commented Jan 15, 2016

Submitted with 27ded6a

@LianwMS LianwMS closed this as completed Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants