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

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

Michael Pizzo commented on ODATA-818:

We have not allowed this in the past, because the meaning of omitted properties is not always clear. Possible interpretations:
1) It's null.
2) It's the default value for the service
3) You don't have permissions to read it
4) You didn't explicitly ask for it, and I decided not to give it to you
5) It's not applicable in this instance
6) I wanted you to guess :-)

We did add the select list to the context URL as a way to address #4, although that's not a perfect solution because:
1) The set of properties that the service returns could vary on an instance-by-instance basis
2) If I have a lot of properties and want to exclude just a few, it can be pretty verbose and add a fair amount of complexity

We also added the "permissions" annotation to address #3.

So, if we pick a default meaning for "omitted" we really need to define annotations to distinguish the other cases.

> Omit properties whose value is null
> -----------------------------------
>                 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
>            Reporter: Ralf Handl
>             Fix For: V4.1_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

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]