fixes json path field error rendering

pull/3554/head
KPrasch 2024-07-03 16:28:21 +08:00 committed by derekpierre
parent 40b7b65508
commit e727f95744
No known key found for this signature in database
1 changed files with 2 additions and 2 deletions

View File

@ -19,13 +19,13 @@ from nucypher.utilities.logging import Logger
class JSONPathField(Field):
default_error_messages = {
"invalidType": "Expression of type '{type(value)}' is not valid for JSONPath",
"invalidType": "Expression of type {value} is not valid for JSONPath",
"invalid": "'{value}' is not a valid JSONPath expression",
}
def _deserialize(self, value, attr, data, **kwargs):
if not isinstance(value, str):
raise self.make_error("invalidType", input=value)
raise self.make_error("invalidType", value=type(value))
try:
parse(value)
except (JsonPathLexerError, JsonPathParserError):