* Re #265 - Use extended JSONpath support, Allow a JSONPath selector to not match anything (yet) Adding test Correctly capture invalid JSONPath query error
This commit is contained in:
@@ -179,7 +179,7 @@ class ValidateCSSJSONInput(object):
|
||||
def __call__(self, form, field):
|
||||
if 'json:' in field.data:
|
||||
from jsonpath_ng.exceptions import JsonPathParserError, JsonPathLexerError
|
||||
from jsonpath_ng import jsonpath, parse
|
||||
from jsonpath_ng.ext import parse
|
||||
|
||||
input = field.data.replace('json:', '')
|
||||
|
||||
@@ -189,6 +189,8 @@ class ValidateCSSJSONInput(object):
|
||||
message = field.gettext('\'%s\' is not a valid JSONPath expression. (%s)')
|
||||
raise ValidationError(message % (input, str(e)))
|
||||
|
||||
# Re #265 - maybe in the future fetch the page and offer a
|
||||
# warning/notice that its possible the rule doesnt yet match anything?
|
||||
|
||||
class quickWatchForm(Form):
|
||||
# https://wtforms.readthedocs.io/en/2.3.x/fields/#module-wtforms.fields.html5
|
||||
|
||||
Reference in New Issue
Block a user