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:all-tabpanel ]

Michael Pizzo updated ODATA-818:
--------------------------------

    Proposal: 
Proposal:
1) Add a new preference "odata.omit-values" which can have the value "nulls" or "defaults".
2) if clients specify "omit-values=nulls" the service MAY omit null values. If the service omits null values, it MUST specify the preference-applied response with the "omit-values=nulls" response.
3) If clients specify "omit-values=defaults" the service MAY omit defaults, including nulls for properties without defaults. In this case, nulls are included in the payload if there is a non-null default value defined. Note that, in this case, there service MAY omit nulls for properties without a default defined, but include properties in the payload that are the default value.
4) If the client doesn't specify an OData-MaxVersion header the service is free to omit nulls
5) Nulls and defaults are always included if changed in delta payloads
6) Missing values in a PUT or POST are assumed to be default (current behavior). Missing values in PATCH are assumed to be untouched (current behavior).  The response to a POST must include any values not set to their default. The response to a PUT/PATCH operation must include any properties whose values were changed as part of the operation.
7) Services are always allowed to include nulls and defaults, regardless of the metadata level or preference specified.


  was:
Proposal:
1) Add a new preference "odata.omit-values" (or just "omit-values") which can have the value "nulls" or "defaults".
2) if clients specify "omit-values=nulls" the service MAY omit null values. If the service omits null values, it MUST specify the preference-applied response with the "omit-values=nulls" response.
3) If clients specify "omit-values=defaults" the service MAY omit defaults, including nulls for properties without defaults. In this case, nulls are included in the payload if there is a non-null default value defined. Note that, in this case, there service MAY omit nulls for properties without a default defined, but include properties in the payload that are the default value.
4) If the client doesn't specify an OData-MaxVersion header the service is free to omit nulls
5) Nulls and defaults are always included if changed in delta payloads
6) Missing values in a PUT or POST are assumed to be default (current behavior). Missing values in PATCH are assumed to be untouched (current behavior).  The response to a POST must include any values not set to their default. The response to a PUT/PATCH operation must include any properties whose values were changed as part of the operation.
7) Services are always allowed to include nulls and defaults, regardless of the metadata level or preference specified.



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