paiden / Nett

.Net library for TOML
MIT License
223 stars 27 forks source link

Is it possible to ignore case of key names vs properties when reading? #56

Closed queil closed 6 years ago

queil commented 6 years ago

Hi @paiden,

First I must say this is a fantastic lib. Although I could not find an answer to the above question. Let's say I've got a property:

   public string KeyName {get;set;}

and a key in my toml

keyname = "value"

Then when reading the config my property is null. If the case matches it works fine. Is there a bit of TomlSettings I am missing here or it is just not implemented?

paiden commented 6 years ago

Hi,

currently this is not possible. This feature is the next item on my backlog after the parser re-write and a few bug fixes. I hope to implement it within the next few weeks.

queil commented 6 years ago

Cool, that's a great news. Thanks.

paiden commented 6 years ago

@queil commit e6c3833 implements this new feature.

The unit tests should show what the new settings API and the implemented behavior will look like.

I'm really intererested, what you think of the API and if this implementation handles all your use cases.

queil commented 6 years ago

@paiden Thanks, I will check it out shortly and give you some feedback.

queil commented 6 years ago

@paiden I've browsed through the tests and IMHO the API looks OK. I'll put it into my project soon but it seems it covers my use case. I want my configs to be as simple and as forgiving as possible that's why I've gone for TOML in the first place. Ability to ignore case will make the experience very smooth. Thanks for your work!

paiden commented 6 years ago

Released with Nett v0.10.0

queil commented 6 years ago

@paiden much appreciated - thanks for your work!