Skip to content
This repository was archived by the owner on Aug 23, 2018. It is now read-only.
This repository was archived by the owner on Aug 23, 2018. It is now read-only.

Adding a root object to the JSON output #4

@hourback

Description

@hourback

Hi there! Another Ember.js-related issue. :-) Just wondering if you can give me an idea of the most Go-like or Martini-like way to handle this.

Here's a related post on Stack Overflow:

http://stackoverflow.com/a/18650879/16609

Basically, Ember's RESTAdapter expects the JSON from the server to contain a root object that is the same name as the model. I'm unsure how to modify your API example to accommodate this requirement. (I'm new to Go.) Maybe changing the functions that pull the data, e.g., GetAll(), is the easiest, as opposed to monkeying with the encoder? I think there will be additional types/models in the future so it seems like the encoders should be as generic as possible.

TIA,

Ali

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions