hivemq-edge
hivemq-edge copied to clipboard
Pattern-based validations need a better UX approach
Expected behaviour
The error message for the validation of a url field should tell humans what the error is about, not regex parser :-)
Actual behaviour
The standard error message for a pattern attribute of a JSONSchema string is literally transcribing the wronged regular expression. Which, in the case of a url`, can be long and unreadable, therefore unusable

To Reproduce
Creating an HTTP adapter with an incorrect URL, like in #106
Details
- consider the implication for both (or either) backend and frontend validation
- human-readable (short?) statement would be better (suggestion, drop the printout of the regex)
- in the frontend, consider using destructured validation to pinpoint errors and utilise field-associated error messages:
- the domain
xxxis not valid - the protocol
httpxyzis not valid
- the domain
I will ensure that the HTTP adapter uses the URL format and the pattern is removed