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-818) Omit properties whose value is null or the $metadata-defined default value


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

Michael Pizzo commented on ODATA-818:
-------------------------------------

Note: the common use case for defaultvalue is for things like numbers that may not support nulls, but have defaults for their type (i.e., 0, empty string,... ).

From 2016-4-21:
Ralf: Proposal: specify preferences odata.omit-default-values and odata.omit-null-values to indicate that the client is able to fill in the blanks. odata.omit-default-values implies odata.omit-null-values
===============
(note: odata.omit-default-values only implies odata.omit-null-values for properties without specified defaults.)
(also note: current clients may not correctly update existing objects/caches if nulls/defaults are omitted from the wire)

If the client specifies odata.omit-default-values, can the service omit nulls and return odata.omit-null-values in the preference-applied header?

It might be interesting to tie this in to odata.metadata as well.  i.e., (for 4.01 and greater clients) odata.metadata=none (or even odata.metadata=minimal?) means that the service MAY omit null values even without the preference.  odata.metadata=full means the service MUST return null and default values unless the preference is specified.

Services should, of course, always be allowed to return null and default values, regardless of the metadata or preference settings.

What about PUT/POST requests; are missing fields assumed to be null in the request payload? default? is there a way for the client to say? What if I do a PATCH and, as a side-affect, a property gets set to null (or default).  Does the service have to include that in the response? If not, how do I now it got set to null (default).

> Omit properties whose value is null or the $metadata-defined default value
> --------------------------------------------------------------------------
>
>                 Key: ODATA-818
>                 URL: https://issues.oasis-open.org/browse/ODATA-818
>             Project: OASIS Open Data Protocol (OData) TC
>          Issue Type: Improvement
>          Components: OData JSON Format, OData Protocol
>    Affects Versions: V4.0_ERRATA02
>         Environment: Simplified Payload
>            Reporter: Ralf Handl
>            Assignee: Ralf Handl
>              Labels: Performance
>             Fix For: V4.01_WD01
>
>
> Entities with many properties that are sparsely filled would benefit from optimizing the payload and omitting properties whose value is null.
> With odata.metadata=minimal the client can deduce from the context URL whether a property is missing due to not being part of the projection or due to being null.
> Maybe switch this on/off via a new preference in the Prefer header.



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