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
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 have validate receive the payload as unknown 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.
The text was updated successfully, but these errors were encountered:
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.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.Either way the interface of
Dispatcher.dispatch
should then allow to pass unknown data.The text was updated successfully, but these errors were encountered: