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

Adding a custom root name for array serializer #105

Open
sarah-mica opened this issue Sep 16, 2021 · 1 comment
Open

Adding a custom root name for array serializer #105

sarah-mica opened this issue Sep 16, 2021 · 1 comment
Assignees

Comments

@sarah-mica
Copy link

sarah-mica commented Sep 16, 2021

In ActiveModelSerializer you can specify a custom root name for an array like so:

render json :@items, root: 'custom item list'

With the following result:

{
  "custom item list": [
    {
      "item_id": 1,
      "item name": "item 1"
    },
    {
      "item_id": 2,
      "item_name": "item 2"
    }
  ]
}

Is there any way do this in panko??

@yosiat
Copy link
Owner

yosiat commented Sep 21, 2021

Hi @sarah-mica ,

Specifying root name is not supported in Panko as of today.

I'll try to give it a check next weekend.

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

No branches or pull requests

2 participants