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
Key in YAML can be represented by any kind - Scalar, Sequence and Mapping. As JavaScript doesn't allow that we have to do what other libraries do - convert the non-string Key into string key. We have three options for conversion:
Yes both specifications doesn't allow that, but it doesn't change the situation. We have to be able represent this information on CST/AST level so that we could validate. Then we should be able to encode fields like that into ApiDOM so that one field defined like that doesn't stop us from generating full ApiDOM tree and possibly rendering it in editor view. Having fields defined in this way should trigger validation WARNING and not validation ERROR. This issue is about choosing strategy to use when situation like that happens.
Key in YAML can be represented by any kind - Scalar, Sequence and Mapping. As JavaScript doesn't allow that we have to do what other libraries do - convert the non-string Key into string key. We have three options for conversion:
1.) Using Symbol.toStringTag
using Object.prototype.toString to get a string representation of an object or an array.
js-yaml is using this approach.
will become
2.) Using Original YAML fragment
{[1, 2]: many}
will become
yaml library is using this approach as default behavior.
3.) Using Map Object for mapping
With new JavaScript Map type, any value (both objects and primitive values) may be used as either a key or a value.
That means that we can do the following:
{[1, 2]: many}
will become
yaml library is using this approach as opt-in behavior with
mapAsMap
option.Refs #1
The text was updated successfully, but these errors were encountered: