(self, query: str, data: dict)
return False
Does the given data match the given jsonpath query
Does the given data match the given jsonpath query
Does the given data match the given jsonpath query
def json_match(self, query: str, data: dict) -> bool:
        """Does the given data match the given jsonpath query"""
        match = re.match(r"(.+?)(<|>|<=|>=|!=|=)(.+)", query)
        if not match:
            sys.stderr.write("Invalid json query\n")
            sys.exit(1)

        query, comparator, value = match.groups()
        found_values = jsonpath(data, query)

        if not found_values:
            return False

        for found_value in found_values:
            if self.compare(comparator, left_value=found_value, right_value=value):
                return True

        return False
def json_match ( self , query : str , data : dict ) -> bool : match = re . match ( r"(.+?)(<|>|<=|>=|!=|=)(.+)" , query ) if not match : sys . stderr . write ( "Invalid json query\n" ) sys . exit ( 1 ) query , comparator , value = match . groups ( ) found_values = jsonpath ( data , query ) if not found_values : return False for found_value in found_values : if self . compare ( comparator , left_value = found_value , right_value = value ) : return True return False