keithwhor / nodal

API Services Made Easy With Node.js
http://www.nodaljs.com/
MIT License
4.51k stars 209 forks source link

JSON API formatting #283

Closed denzo closed 8 years ago

denzo commented 8 years ago

In the documentation it states

... built-in JSON API formatting

The default payload I get is not serialized as JSON API.

 {
  "meta": {
    "total": 1,
    "count": 1,
    "offset": 0,
    "error": null
  },
  "data": [
    {
      "id": 2,
      "title": "Hello world",
      "text": "Today was a good day",
      "created_at": "2016-07-18T02:42:32.503Z",
      "updated_at": "2016-07-18T02:42:32.504Z"
    }
  ]
}

What is the right way to configure Nodal to serialiaze the responses as jsonapi?

keithwhor commented 8 years ago

A better PR would be to fix the documentation to remove ambiguity in the wording I used. ;) I meant "JSON API" generically, not in direct reference to jsonapi.org, but totally understand the confusion.

I don't have any intention of supporting the "JSON API Standard" as defined by jsonapi.org, because the way we're heading is towards GraphQL and away from traditional REST anyway. Apologies for the lack of clarity there!

denzo commented 8 years ago

That's awesome news! Can't wait for GraphQL!