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=62283#comment-62283 ] 

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

I think I would rather have absence always mean "null", and not default if there is a non-null default value. The default value specifies the value of the property if no value is specified when the row is created, which is different from saying that's it's default value when omitted from a payload. Requiring the client to know the default value defined in metadata to interpret the value in the json payload  makes us more dependent upon metadata and less generic in consuming the payload.

I still worry about the size of the context URL if there are a lot of properties (which there often are) and the service wants to omit a few. But, as you say, that's the defined behavior today.

This further blurs the distinction between properties that aren't present and properties that are present but have a known value of null. This is true for dynamic properties and maybe it's fine to make that same rule apply to all properties, I just want to make sure we consider the ramifications.

The real question is: are there cases where we need to be able to distinguish between a property that doesn't exist and a property that exists but has no value?

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