Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

HeikoTheissen
Copy link
Contributor

Fixes #2045

Comment on lines 341 to 343
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.
Copy link
Contributor Author

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

ralfhandl
ralfhandl previously approved these changes Feb 13, 2025
Comment on lines 340 to 343
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.
Copy link
Contributor

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

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
Copy link
Contributor

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,
Copy link
Contributor

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 :-(

Copy link
Contributor

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.

ralfhandl
ralfhandl previously approved these changes Feb 20, 2025
ralfhandl
ralfhandl previously approved these changes Feb 22, 2025
ralfhandl
ralfhandl previously approved these changes Feb 28, 2025
@@ -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,
Copy link
Contributor

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,..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Omission of collection-valued action parameters
3 participants