Skip to content
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

Working with keys that have '.' (dot) in it #64

Open
vytis opened this issue Dec 8, 2016 · 1 comment
Open

Working with keys that have '.' (dot) in it #64

vytis opened this issue Dec 8, 2016 · 1 comment

Comments

@vytis
Copy link

vytis commented Dec 8, 2016

It seems that after pull request #53 JSONCodable got functionality for encoding/decoding nested types (9782c0f). However the problem we are having is that our API JSON responses have some keys with . in them. This makes it impossible to encode (and probably parse) the JSONs using the library.

For example this JSON is not parseable correctly with the lib:

{
   "one.key" = "value"
}

Is there a way to fallback to a more low-level approach avoiding the key.components(separatedBy: ".") part in each of func encode(_ value: key:) overload?

@Nadohs
Copy link
Collaborator

Nadohs commented Dec 12, 2016

This seems to be more of an edge case while what we optimized for seemed to be more common and expected. Your welcome to submit a PR for this functionality as perhaps an OptionSet on the JSONEncoder initializer, otherwise we will keep this in mind for potential implementation in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants