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

Custom (default) CollectionSerializer #1440

Closed
MarkMurphy opened this issue Jan 18, 2016 · 1 comment
Closed

Custom (default) CollectionSerializer #1440

MarkMurphy opened this issue Jan 18, 2016 · 1 comment

Comments

@MarkMurphy
Copy link

I'd like to configure a custom CollectionSerializer which would generate output similar to the following:

{ 
  "object": "list",
  "url": "https://api.example.com/photos",
  "data": [
    {...}, 
    {...}
  ]
}

I know how to change the default collection serializer via the config settings in an initializer but I can't seem to get this output working. It continues to just output a basic array. I'm using current master

@natematykiewicz
Copy link

Which adapter are you using currently? For this kind of structure, you'll need to write your own custom adapter. Unfortunately there's currently no documentation on creating a custom adapter. See #1317 for some details, though.

I will say, this looks similar to http://jsonapi.org. JSON API is supported using the :json_api adapter.

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

3 participants