• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ERRest embedded relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ERRest embedded relationships


  • Subject: Re: ERRest embedded relationships
  • From: Jesse Tayler <email@hidden>
  • Date: Thu, 19 Sep 2013 20:39:02 -0400


there’s only going to be one root so you could create a transient entity which has a relationship to each type and return one of those maybe.

On Sep 19, 2013, at 8:07 PM, Michael Kondratov <email@hidden> wrote:

I did that. But I am still unable to return two types of objects in the same root node. I can only pass to (response method ) a single object or an array of objects of the same type .

Sent from my iPhone

On Sep 19, 2013, at 14:51, Kieran Kelleher <email@hidden> wrote:

One solution might be to create  a custom er.rest.format.IERXRestWriter implementation and register a new format for ember js in er.rest.format.ERXRestFormat static block where it calls ERXRestFormat.registerFormatNamed repeatedly to provide customized API for different types of clients.


On Sep 19, 2013, at 2:22 PM, Michael Kondratov <email@hidden> wrote:

Hello,
I am working on an Ember.js connector for ERRest. Everything is working beautifully, except embedded relationships. I can't figure out how to generate this style of JSON:


{
  "post": {
    "id": 1
    "title": "Rails is omakase",
    "comments": ["1", "2"],
    "_links": {
      "user": "/people/dhh"
    },
  },

  "comments": [{
    "id": "1",
    "body": "Rails is unagi"
  }, {
    "id": "2",
    "body": "Omakase O_o"
  }]
}

Any pointers?



Michael Kondratov
Aspire Auctions, Inc.
216-231-5515
Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >ERRest embedded relationships (From: Michael Kondratov <email@hidden>)
 >Re: ERRest embedded relationships (From: Kieran Kelleher <email@hidden>)
 >Re: ERRest embedded relationships (From: Michael Kondratov <email@hidden>)

  • Prev by Date: Re: ERRest embedded relationships
  • Next by Date: Re: ERRest embedded relationships
  • Previous by thread: Re: ERRest embedded relationships
  • Next by thread: Re: ERRest embedded relationships
  • Index(es):
    • Date
    • Thread