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
Describe the bug
I have a YAML schema that has an array of items that can have the same key, e.g.
choices:
correct: answer1
wrong: answer2
wrong: answer3
correct: answer4
In order to make this I used the following setup: public List<object> choices { get; set; }
and the following usage of this property: choices.Add( isCorrect ? new { correct = answer } : new { wrong = answer });
When serializing the object with this collection of anonymous objects, I have errors in the output (in bold):
choices:
correct: 30
wrong: 20
wrong: 40
&o0
wrong: 10
or:
choices:
&o3
wrong: false
correct: Java
wrong: true
wrong: Scala
Describe the solution you'd like
I would like to have a setup that enables proper serialization of anonymous objects.
Describe alternatives you've considered
Building the YAML object in the c# code instead of serialization.
The text was updated successfully, but these errors were encountered:
Describe the bug
I have a YAML schema that has an array of items that can have the same key, e.g.
choices:
In order to make this I used the following setup:
public List<object> choices { get; set; }
and the following usage of this property:
choices.Add( isCorrect ? new { correct = answer } : new { wrong = answer });
When serializing the object with this collection of anonymous objects, I have errors in the output (in bold):
choices:
wrong: 10
or:
choices:
wrong: false
Describe the solution you'd like
I would like to have a setup that enables proper serialization of anonymous objects.
Describe alternatives you've considered
Building the YAML object in the c# code instead of serialization.
The text was updated successfully, but these errors were encountered: