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

Ignore a key (or set of keys)? #49

Open
michaelrbock opened this issue Dec 28, 2021 · 1 comment
Open

Ignore a key (or set of keys)? #49

michaelrbock opened this issue Dec 28, 2021 · 1 comment

Comments

@michaelrbock
Copy link

michaelrbock commented Dec 28, 2021

Hey there, occasionally there is a use case for having an ID as a key in a JSON object. For example:

{
  "INTERNAL_ID": {
    "id": "INTERNAL_ID",
    "additional_stuff": []
  }
}

OliveBranch will change that to:

{
  "internalId": {
    "id": "INTERNAL_ID",
    "additional_stuff": []
  }
}

Is there a way to ignore certain keys (e.g. using a list of ignored keys)?

@efatsi
Copy link
Contributor

efatsi commented Dec 28, 2021

@michaelrbock perhaps you could implement a custom camelize method that ignores keys that match a certain conditional? https://github.com/vigetlabs/olive_branch#optimizations-and-configuration

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