olosegres/jsona

Switching nested attribute object keys to camel case is not working

Kousuke-N opened this issue · 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.

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