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
When a message from another agent is received it is transformed from JSON into a class instance of that message. Most agent message classes already contain decorators from the class-validator package that specify how we want to validate properties. For example the ConnectionInvitationMessage contains decorators to validate.
The Dispatcher class transforms the JSON of a message to a class instance. After the transformation we should use the validate function of the class-validator package to check if the message is valid.
In the future we can send a problem report message from the problem report protocol (#58) if the message is not valid according to the validation (which should be based on the requirements of the RFCs)
Add validation decorators to all message classes. Also check messages that already contain validation decorators.
Validate message class instance with class-transormer package after transformation from JSON
When a message from another agent is received it is transformed from JSON into a class instance of that message. Most agent message classes already contain decorators from the
class-validator
package that specify how we want to validate properties. For example theConnectionInvitationMessage
contains decorators to validate.The Dispatcher class transforms the JSON of a message to a class instance. After the transformation we should use the
validate
function of theclass-validator
package to check if the message is valid.In the future we can send a problem report message from the problem report protocol (#58) if the message is not valid according to the validation (which should be based on the requirements of the RFCs)
class-transormer
package after transformation from JSONResources
The text was updated successfully, but these errors were encountered: