-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reference Path with unicode doesn't validate #23
Comments
Sorry, there's a notification problem of some sort and I didn't get alerted about this issue. Sounds like a bug, will have a look. |
@timbray Thanks. |
This appears to be a problem in j2119's JSONPathChecker, which uses a regex to validate JSONPaths. |
Hmm in J2119 json_path_checker.rb, the RE is built using regex character classes like Lt and Mc which I thought were supposed to be unicode-correct. But I look at https://ruby-doc.org/core-2.5.1/Regexp.html and I guess this should use the Posix classes like /[[:alpha:]]/ |
Hold on, further down it says “A Unicode character's General Category value can also be matched with \p{Ab} where Ab is the category's abbreviation as described below:” so it should be OK. Looking further… The pattern here is ['£'] so it's complaining that £ isn't doesn't match any of 'Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl' - so that regex insists that the first character be a letter or number, but £ isn't. But now I think the idea is just wrong because in a JSON path when I say $.foo['X'] I can put really any unicode string where X is. So I don't see why bracket_step requires name_re in between the [' and '], any old string should be fine. Of course ' has to be escaped if you want to use it. Sorry, still thinking. I guess we used name_re because we were thinking of things that can be JavaScript names. But in arbitrary user data, JSON object field names can be any string. |
If a Reference Path contains a unicode character
statelint
give a validation error. I can create the following definition in the AWS console without error.Similar to #17
The text was updated successfully, but these errors were encountered: