You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Non-binding parameters that are nullable ... MAY be omitted from the request body. ... it MUST be interpreted as having the null value.
This statement cannot apply to collection-valued parameters, because they can at most be interpreted as having an empty collection as value. Is this meant here?
If yes, can an empty collection be omitted even if non-nullable?
If not, a collection-valued parameter must always be included even if empty.
Conversely, can an empty array be omitted in a response, similar to omit-values=nulls?
The text was updated successfully, but these errors were encountered:
For collection-valued parameters nullable expresses whether null is allowed as collection items. The collection itself cannot be null, it can only be empty.
Given that, omission of a collection-valued parameter means "sender has no opinion, receiver can fill in a default", which may be an empty collection.
Note: a collection-valued parameter is never nullable (nullable=true references the members of the collection-valued parameter, not the parameter itself). Therefore, the statement on nullable non-binding parameters doesn't apply.
2025-2-12: discussed treating an absent collection valued parameter as up to the service (equivalent to an optional parameter with no defined value), including returning an error. This is arguably the most useful and flexible, and the most backward compatible.
General agreement that this is a reasonable direction.
Heiko will come back with a proposed change.
Also: we noted that text on omit-null shouldn't apply to collection-valued properties (since they are not nullable) but the wording could be made crisper. Heiko will look at this as well. Thanks Heiko! :-)
OData-JSON, section 18 states
This statement cannot apply to collection-valued parameters, because they can at most be interpreted as having an empty collection as value. Is this meant here?
Conversely, can an empty array be omitted in a response, similar to
omit-values=nulls
?The text was updated successfully, but these errors were encountered: