Skip to content
This repository has been archived by the owner on Jun 29, 2019. It is now read-only.

Preferences error message #113

Closed
mistic100 opened this issue Apr 18, 2016 · 2 comments
Closed

Preferences error message #113

mistic100 opened this issue Apr 18, 2016 · 2 comments
Milestone

Comments

@mistic100
Copy link
Contributor

I set up this regex validation for URL
https://github.com/mistic100/hain-plugin-rss/blob/master/preferences.json#L21

It works well but Hain directly displays the JSON schema error which is kinda ugly when using a pattern :

Does not match regular expression "(?(?:(http|https|ftp)://)?(?:((?:[^\W\s]|.|-|[:]{1})+)@{1})?((?:www.)?(?:[^\W\s]|.|-)+[.][^\W\s]{2,4}|localhost(?=/)|\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})(?::(\d_))?([/]?[^\s\?][/]{1})(?:/?([^\s\n\?\[\]\{\}\#](?:(?=.)){1}|[^\s\n\?\[\]\{\}\.\#])?([.]{1}[^\s\?\#])?)?(?:?{1}([^\s\n\#\[\]]))?([#][^\s\n]_)?)?"

Perhaps Hain could expose a way to customize the error message, for example by extending the JSON schema declaration with a "messages" field.

Similar question on other projects using JSON schema :
geraintluff/tv4#115 (comment)

@appetizermonster
Copy link
Collaborator

@mistic100 it looks your suggestion would be good solution for this, I think i can implement it by referencing your suggestion

@mistic100
Copy link
Contributor Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants