KafkaMessageBus v4.2.1 KafkaMessageBus.MessageDataValidator View Source
Module includes a set of validate functions. These functions take wither the message data in isolation or in the context of the message itself and it returns the validation result.
Validation results will either return one of the following:
- The tuple {:ok, :message_contract_excluded} 1.1. This indicates that the specified message is excluded from validation.
- {:ok, %{}} (empty map) 2.1. This indicates the message is valid with no suggested changes.
{:ok, map}
3.1. This indicates that the data is valid but was provided as the wrong type. For example, the message contract could be expected an integer but encounters a string that could be parsed into an integer. The map returned in the :ok tuple is a map of suggested changes with the data in the proper type for the specified field. Using the example above, if the data included something like %{the_field: "42"}, the resulting map would include %{the_field: 42}.
- An error tuple.
Link to this section Summary
Link to this section Functions
Link to this function
validate(error) View Source
Link to this function