konradhalas / dacite

Simple creation of data classes from dictionaries.
MIT License
1.76k stars 106 forks source link

Feature proposal: enable mapping of keys between json structure and object #123

Closed acethepace closed 3 years ago

acethepace commented 3 years ago

Not sure if this is already available but I have a case where I want to change the key name for it to match the object completely. Couldn't find anything in the docs so I've raised it as a feature request.

JSON : 
{
    player: [{...}]
}

Object : 

{
    players: [{...}]
}

I want to enable the mapping from player to players based on a configuration.

konradhalas commented 3 years ago

Hi @acethepace - thank you for reporting this issue :)

This feature was discussed many times (e.g. #115, #108). Long story short - I think it's out of scope of dacite library. Please read more here - #38