Closed marcinadd closed 4 years ago
Should I just validate the message using a simple regex expression?
First of all, remember to fetch all changes from branch api_mappings and you should work on this branch (I've just pushed a commit with //TODO). I hope that this branch will be merged into master as soon as possible. Anyway, to validate you should implement Validator from org.springframework.validation. Remember to check if a user with given recipientUsername exists. Message title and text should be empty too. That's my minimal requirements. If you want you can implement your own ideas.
I just have to add a validator and pass the message through the it before sending in message service, right? Well, I'll add a custom error to be thrown if the user is not present in the list.
Message title and text should be empty too.
I guess there's a typo. Correct me if I'm wrong! 😅
Ofc they shouldn't be empty. Moreover they shouldn't be blank.
I just have to add a validator and pass the message through the it before sending in message service, right?
Right
@scheleon are you working on it? if no, I can.
Sorry for keeping the issue blocked for time. And yes please go on and get it done.
@marcinadd added a pull request #55 . please let me know
[x] Add MessageValidator
[x] Validate message on send (add validation to sendMessage() in MessageService)