-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
The current typing of the optional validate
method of commands assumes that the payload data is already checked for correct data types. As incoming messages by clients must never be trusted without data type checking, there should be a canonical way of doing so, e.g.
- have the dispatcher call
validate
before setting the payload and havevalidate
receive the payload asunknown
data type. If the method returns true, the data can be trusted and is of the specified payload data type. - add a separate (optional) method to commands for checking the payload data, that is called by the dispatcher before setting the payload.
Either way the interface of Dispatcher.dispatch
should then allow to pass unknown data.
Metadata
Metadata
Assignees
Labels
No labels