You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in #44 where it was discovered that rule keys didn't support dashes, it has become apparent that rule keys don't currently support the full character set of available string values that can be used in YAML. Notably, they do not currently support spaces, which are fairly commonly used in string keys in YAML due to its natural language-like syntax. In order to add this support, we'll need to change the syntax to allow for quoted strings to be passed as rule keys, which will likely create both a plain bareword string syntax, as well as a quoted string syntax. As it stands, I would expect that we could leave the existing regex in place to match bareword strings, though, quoted strings should probably provide support for spaces. This could probably take advantage of the built-in common.ESCAPED_STRING rule (though I personally couldn't figure out how to get it to work).
I'd think that bareword strings should probably be based on the previous regex as well, something like /[a-zA-z0-9_-]+/. Though, I'd say that's probably not as big of a deal
The text was updated successfully, but these errors were encountered:
wilrodriguez
changed the title
Broaden rule key character support
Broaden rule key character support for quoted rule names
Jan 15, 2023
wilrodriguez
changed the title
Broaden rule key character support for quoted rule names
Broaden character support for quoted rule names
Jan 15, 2023
As part of PR #45 I have implemented an update to the rule names to support all unicode characters and key names with spaces. This has been released in 0.2.1. As suggested, key names with spaces need to be enclosed with double quotes. For example, given the following schema:
schema {
"my awesome key" str
}
Should be able to evaluate:
my awesome key: hello world
If this isn't working on your end. Can you please share your schema file?
As mentioned in #44 where it was discovered that rule keys didn't support dashes, it has become apparent that rule keys don't currently support the full character set of available string values that can be used in YAML. Notably, they do not currently support spaces, which are fairly commonly used in string keys in YAML due to its natural language-like syntax. In order to add this support, we'll need to change the syntax to allow for quoted strings to be passed as rule keys, which will likely create both a plain bareword string syntax, as well as a quoted string syntax. As it stands, I would expect that we could leave the existing regex in place to match bareword strings, though, quoted strings should probably provide support for spaces. This could probably take advantage of the built-in
common.ESCAPED_STRING
rule (though I personally couldn't figure out how to get it to work).I'd think that bareword strings should probably be based on the previous regex as well, something like
/[a-zA-z0-9_-]+/
. Though, I'd say that's probably not as big of a dealThe text was updated successfully, but these errors were encountered: