Skip to content

Refine ProjectedPayload argument handling for an optional input argument #550

Closed
@rstoyanchev

Description

@rstoyanchev

A @ProjectedPayload method parameter can be declared with java.util.Optional as of #506, and that allows handling optional input arguments. We should allow it to be declared with ArgumentValue, introduced in #518.

If neither wrapper is used, currently ProjectionFactory fails with IllegalArgumentException if the input value is null. We should change that to allow null to be passed in if we want it to be consistent with the handling of regular @Argument method parameters. This allows the controller method to handle a null argument value.

Alternatively, we could keep the current behavior of the @ProjectionPayload argument handling, in effect requiring an optional wrapper for optional input, and otherwise rejecting it. In this case, we should also align the handling of regular @Argument parameters to do the same. That would be a breaking change, however, for an application that handles the null within he controller method.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions