-
-
Notifications
You must be signed in to change notification settings - Fork 493
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
Duplicate key #407
Comments
As indicated in the exception message, there must be a duplicate key in your YAML file, on line 26, column 5. If you share your file, I may be able to provide more help. |
Thanks for the response, found an alternative way to solve my problem.
If you want i can try and replicate the problem, its just that I'm using your code in Unity 2019 (.NET 4.x) |
In that case it seems to be be a bug. I think I have the necessary information to reproduce it. I'll let you know. Thanks
…On May 21, 2019, 08:32, at 08:32, Nukadelic ***@***.***> wrote:
Thanks for the response, found an alternative way to solve my problem.
I think It was an error on the load level, looks like it wasn't able to
handle repeated loading, it could be that my code wasn't disposing the
stream properly, but didn't end up finding how to do that on the
YamlSteam class. And since the file that needed to be parsed does have
a very basic structure, I ended up using the Deserializer only, like
so:
```
var deserializer = new DeserializerBuilder()
.WithNamingConvention( new CamelCaseNamingConvention() )
.Build();
Dictionary<string, object> raw =
deserializer.Deserialize<Dictionary<string, object>>( streamReader );
string[] categories = raw.Keys.ToArray();
var data = raw.Values.Select( config => ( Dictionary<object, object> )
config ).ToArray();
List<SortedDictionary<string, string>> output = new
List<SortedDictionary<string, string>>();
foreach( var d in data )
{
SortedDictionary<string, string> dict = new SortedDictionary<string,
string>();
foreach( var k in d.Keys ) dict.Add( k.ToString(), d[ k ].ToString() );
output.Add( dict );
}
return output;
```
If you want i can try and replicate the problem, its just that I'm
using your code in Unity 2019 (.NET 4.x)
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#407 (comment)
|
Using a dropdown UI i try and load a yaml file each time the value is changing, running in Unity 2019 via simple system IO:
Here is the error i am getting :
The text was updated successfully, but these errors were encountered: