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
then I would expect find_value(r#"token."https://artifactory.mysite.com""#) to succeed. Currently it throws a MissingField error. The implementation of Value::find() performs a simple split on the dot chars which is not enough in this case. A parser would have to be added which can correctly handle the quote scope.
The text was updated successfully, but these errors were encountered:
It's not clear to me that we should have "foo.bar" mean something different than foo.bar, as far as our notion of "key paths" goes. In particular, since key paths are independent of any particular format, it would be odd to base them on TOML's idea of strings. However, I do agree that it's necessary to allow some way to escape the . character. Canonically, this would be \. with \ as the escape character.
As an aside, in retrospect, giving any special meaning to characters in this context feels like the wrong approach. Instead, it would have been nice to make these functions generic on their input type, allowing various types including strings (without special meaning to any character), slices of strings, and string iterators, removing the ambiguity and thus the need to resolve it:
value.find(["foo","bar"])
value.find(&["foo","bar"])
value.find("foo.bar".split('.'));
value.find("foo.bar");// equivalent to value.find(["foo.bar"]);
In any case, I'll think about a good interim solution.
For example, if I have the following (TOML) configuration:
then I would expect
find_value(r#"token."https://artifactory.mysite.com""#)
to succeed. Currently it throws a MissingField error. The implementation ofValue::find()
performs a simple split on the dot chars which is not enough in this case. A parser would have to be added which can correctly handle the quote scope.The text was updated successfully, but these errors were encountered: