-
-
Notifications
You must be signed in to change notification settings - Fork 485
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
YAML 1.1 indicators #487
Comments
This is part of the work that I am doing on Schemas. Yaml 1.1 is just another shema. |
It is a little bit more involved. Our standard parser ( However, it is the responsibility of deserializer, to merge and override values by the spec. YamlDotNet/YamlDotNet/Serialization/EventEmitters/JsonEventEmitter.cs Lines 36 to 39 in b3cf637
so it is not easy to visualize the feature parity of Merge Key type. (I did not find any issue tracking it, should we open one?) The end to end expectation for this example input: x:
y: &anchor1
name: yy
env:
a: "a1"
b: $b
z:
<<: *anchor1
name: zz
env:
c: "cc"
a: "az1"
b: $b is: {
"x": {
"y": {
"name": "yy",
"env": {
"a": "a1",
"b": "$b"
}
},
"z": {
"name": "zz",
"env": {
"c": "cc",
"a": "az1",
"b": "$b"
}
}
}
} In other words, this program should not throw runtime exception: https://dotnetfiddle.net/rk9eWv and output the JSON as shown above. |
Some of the v1.1 types are supported by the base parser, while others are not: https://yaml.org/type/. For instance, we can implement
!!merge
orMerge Key Language-Independent Type
in base parser and deprecateMergingParser
which only does the copy/paste, and disregards the overriding rules per spec.These are currently not covered by the official spec test suite, so it would require test coverage of our own.
The text was updated successfully, but these errors were encountered: