hivemq-edge icon indicating copy to clipboard operation
hivemq-edge copied to clipboard

Pattern-based validations need a better UX approach

Open vanch3d opened this issue 1 year ago • 1 comments

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

Image

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 xxx is not valid
    • the protocol httpxyz is not valid

vanch3d avatar Sep 14 '23 18:09 vanch3d