lib/matchers/json/json_path.rb
# TODO: the regular expressions below will catch very few errors
the regular expressions below will catch very few errors
the regular expressions below will catch very few errors
def json_path_valid?(path)
        notation = path.include?('[\'') ? :bracket : :dot
        path_regex = /^\$[a-zA-Z0-9_(\[\d\])\.]*[^\.]$/ if notation == :dot
        path_regex = /^\$[a-zA-Z0-9_(\[\d\])\.\']*[^\.]$/ if notation == :bracket
        path_regex.match(path)
      end
def json_path_valid? ( path ) notation = path . include? ( '[\'' ) ? :bracket : :dot path_regex = / ^ \$ [a-zA-Z0-9_( \[ \d \] ) \. ]*[^ \. ]$ / if notation == :dot path_regex = / ^ \$ [a-zA-Z0-9_( \[ \d \] ) \. \' ]*[^ \. ]$ / if notation == :bracket path_regex . match ( path ) end
TODO: the regular expressions below will catch very few errors
TODO : the regular expressions below will catch very few errors
path
<not_specific>