-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omission of collection-valued parameters/properties #2049
base: main
Are you sure you want to change the base?
Conversation
of nullability or optionality. Unless a `Core.OptionalValue` with `DefaultValue` is annotated, | ||
the interpretation of such an omitted parameter is up to the service, | ||
this includes assuming an empty collection or reporting an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This allows a service to treat an absent mandatory parameter of type Collection(Edm.Int16)
like [1,2]
.
Non-binding collection-valued parameters MAY be omitted from the request body regardless | ||
of nullability or optionality. Unless a `Core.OptionalValue` with `DefaultValue` is annotated, | ||
the interpretation of such an omitted parameter is up to the service, | ||
this includes assuming an empty collection or reporting an error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mention this in the "Changes" section
odata-protocol/8 Header Fields.md
Outdated
null values from the response, in which case it MUST specify the | ||
`Preference-Applied` response header with `omit-values=nulls`. | ||
|
||
If `defaults` is specified, then the service MAY omit properties | ||
If `defaults` is specified, then the service MAY omit single-valued properties | ||
containing default values from the response, including nulls for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"containing" -> "having"
@@ -337,6 +337,11 @@ how to interpret the omitted parameter. Note: a nullable non-binding | |||
parameter is equivalent to being annotated as optional with a default | |||
value of `null`. | |||
|
|||
Non-binding collection-valued parameters MAY be omitted from the request body regardless | |||
of nullability or optionality. Unless a `Core.OptionalValue` with `DefaultValue` is annotated, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DefaultValue has type String, so it only works for primitive single-valued :-(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could extend the term Core.OptionalParameter
with AnyDefaultValue
or NonPrimitiveDefaultValue
or similar of type Edm.Untyped
.
@@ -337,6 +337,11 @@ how to interpret the omitted parameter. Note: a nullable non-binding | |||
parameter is equivalent to being annotated as optional with a default | |||
value of `null`. | |||
|
|||
Non-binding collection-valued parameters MAY be omitted from the request body regardless | |||
of nullability or optionality. The interpretation of such an omitted parameter is up to the service, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"May be omitted" and "reporting an error" seem in conflict. Can we remove the first part, and just say something like "If collection-valued parameters are omitted from the request, the interpretation is up to the service,..."
Fixes #2045