jsona icon indicating copy to clipboard operation
jsona copied to clipboard

Switching nested attribute object keys to camel case is not working

Open Kousuke-N opened this issue 3 years ago • 1 comments

Hello.

When I tried to switch the following json to camel case, the change to camel case for nested keys was not done.

{
  "data": [
    {
      "attributes": {
        "reportable": {
          "latest_image_urls": {
            "large": "test.jpg"
          }
        }
      }
    }
  ]
}

I read the json api spec and it says "Attributes may contain any valid JSON value". Can you please fix this so that nested attributes are converted to camel cases according to the specification?

This is my first time creating an OSS issue, so if there is any information missing, please point it out.

Thank you.

Kousuke-N avatar May 30 '22 06:05 Kousuke-N

Hello, Sorry, now I do not have a time to implement it myself. Please make a PR with implementation of this.

In general, you need to patch getAttributes & setAttributes methods in switchCasePropertyMappers.ts and add tests to switchCasePropertyMappers

olosegres avatar Jun 25 '22 14:06 olosegres