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
After the fixes from #491, the SerializationTests.ExampleFromSpecificationIsHandledCorrectlyWithLateDefine() test should fail. Placement of anchors after aliases referring to them is not spec-compliant.
To Reproduce
Execute the SerializationTests.ExampleFromSpecificationIsHandledCorrectlyWithLateDefine() test.
Expected
Test should fail due to an AnchorNotFoundException or ForwardAnchorNotSupportedException (I'm not sure which). It's not clear whether forward references should always be disallowed or if the IList<> constraint is correct but over-zealous. If IList<> types should indeed be special cased, perhaps aliases must reference anchors defined in the same list or earlier in the document❔
My suspicion is special-casing IList<> is incorrect because ordering within a sequence node is semantically important. I haven't found when ForwardAnchorNotSupportedException or the IList<> constraint were introduced to get a sense of the reasoning. Nor have I found anything in the spec indicating a contextual relaxation of "first occurrence", "the most recent event in the serialization having the specified anchor", and similar wording.
Nits
References to AnchorNotFoundException in ForwardAnchorNotSupportedException constructor doc comments are incorrect.
Wording of the $"The anchor '{anchor}' does not exists" message should be $"The anchor '{anchor}' does not exist" (singular).
Even better, should consistently use $"Anchor '{alias.Value}' not found" when AnchorNotFoundException is thrown and use ForwardAnchorNotSupportedException at
Describe the bug
After the fixes from #491, the
SerializationTests.ExampleFromSpecificationIsHandledCorrectlyWithLateDefine()
test should fail. Placement of anchors after aliases referring to them is not spec-compliant.To Reproduce
Execute the
SerializationTests.ExampleFromSpecificationIsHandledCorrectlyWithLateDefine()
test.Expected
Test should fail due to an
AnchorNotFoundException
orForwardAnchorNotSupportedException
(I'm not sure which). It's not clear whether forward references should always be disallowed or if theIList<>
constraint is correct but over-zealous. IfIList<>
types should indeed be special cased, perhaps aliases must reference anchors defined in the same list or earlier in the document❔My suspicion is special-casing
IList<>
is incorrect because ordering within a sequence node is semantically important. I haven't found whenForwardAnchorNotSupportedException
or theIList<>
constraint were introduced to get a sense of the reasoning. Nor have I found anything in the spec indicating a contextual relaxation of "first occurrence", "the most recent event in the serialization having the specified anchor", and similar wording.Nits
AnchorNotFoundException
inForwardAnchorNotSupportedException
constructor doc comments are incorrect.$"The anchor '{anchor}' does not exists"
message should be$"The anchor '{anchor}' does not exist"
(singular).$"Anchor '{alias.Value}' not found"
whenAnchorNotFoundException
is thrown and useForwardAnchorNotSupportedException
atYamlDotNet/YamlDotNet/Serialization/ValueDeserializers/AliasValueDeserializer.cs
Line 107 in 8472305
The text was updated successfully, but these errors were encountered: