NormalGravity / debate-n-go-api

The rest service for debate-n-go
0 stars 0 forks source link

API i/o objects and keys need to be the same structure/name #21

Closed LongLiveCHIEF closed 10 years ago

LongLiveCHIEF commented 10 years ago

For example, a Post object returned looks like:

         {
            "id": "000000000000000000000003",
            "user": {
                "$id": "000000000000000000000001"
            },
            "message": "I think this because",
            "postDate": {
                "sec": 1390867276,
                "usec": 713000
            }

But to insert, I have to format it like:

 { 
      user_id: "<crazyLongUserId>",
      title: "The tagline/title of the message",
      message: "The message",
      vote_options: <array of the vote options>,
      vote_topic_id: "<topic id>"
  };

need to change user_id:"string" to expect:

      "user": {
                "$id": "000000000000000000000001"
            }

. message is fine, but need to make sure the API also accepts title. This review should be done for replies as well, since they would also be sent as object when doing insert operations.

maximx1 commented 10 years ago

So you want to send me?

{
      user: {
            "$id": "000000000000000000000001"
      }
      title: "The tagline/title of the message",
      message: "The message",
      vote_options: <array of the vote options>,
      vote_topic_id: "<topic id>"
};
maximx1 commented 10 years ago

I'm not reading this right. The api does accept title. And what about replies?

LongLiveCHIEF commented 10 years ago

all i had to go by was the readme, I didn't want to assume (regarding titles.) as for replies... i haven't even looked at 'em, just wanted to make sure they didn't have that underscore vs no underscore thing (or object in one and non-object in another.).

And yes... that's exactly what I'd like to send you.