lyft / mapper

A JSON deserialization library for Swift
Apache License 2.0
1.18k stars 88 forks source link

How to handle keys with "." #157

Open walsht opened 5 years ago

walsht commented 5 years ago

I am trying to map a dictonary where the keys have ".", for example "gcm.message_id": 2002

How can I use the Mapper to not see those "." as a path?

keith commented 5 years ago

There isn't curreny a way to do this. I'm not sure what the best way to add this would be. Maybe by first checking if the key exists and then falling back to the nested path. That would technically be a breaking change but it's unlikely anyone would have conflicts like that I think.

walsht commented 5 years ago

@Keith Thank you... wonder if encoding the "." == %2E would work

keith commented 5 years ago

That wouldn't be ideal but it's worth a try. I'm not sure if our string splitting logic would catch that.

-- Keith Smiley

On Jan 7, 2019, at 08:09, Tim Walsh notifications@github.com wrote:

@keith Thank you... wonder if encoding the "." == %2E would work

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.