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

Ability to escape . in order to set a literal destination key #76

Open
eatplaysleep opened this issue Feb 18, 2020 · 1 comment
Open

Comments

@eatplaysleep
Copy link

When the actual destination key contains . there is no way to actually set it.

Expected

Escaping . would result in setting the destination key as a literal.

Actual

Performs deep mapping.

Example

Origin

{
   "username": "some value",
   "name": "some value"
}

Map

{
   "username": "profile\.username",
   "name": "profile\.name"
}

Expected Result

{
   "profile.username": "some value",
   "profile.name": "some value"
}

Actual Result

{
   "profile": {
      "username": "some value",
      "name": "some value"
   }
}
@ptychu
Copy link

ptychu commented Apr 15, 2021

Hi @eatplaysleep,
I just tried this project for the first time. I had the same problem. It appears, that it's already possible to escape a period in destination key. It's required to use double back slash. To get your expected result you should use following map:

{
   "username": "profile\\.username",
   "name": "profile\\.name"
}

I hope it helps.

@wankdanker, I'm not sure if this should be enough to close this issue, or should single backslash escaping be supported? Perhaps mentioning this in the README.md would help to avoid confusion?

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