Skip to content

JSON format #3

Closed
Closed
@jasonlewis

Description

@jasonlewis

I'd like to hear some feedback and discuss how the JSON should be formatted. I'd like to follow the JSON API spec.

There's a few things I'm not to sure about it.

Documents that represent singular resources are wrapped inside an array and keyed by the plural form of the resource type.

I don't particulary like this. Singular resources (IMO) should be keyed by the singular form of the resource type and not wrapped inside an array. The spec recommends this:

{
  "posts": [{
    "id": 1
    // an individual post document
  }]
}

I, personally, prefer this:

{
  "post": {
    "id": 1
    // an individual post document
  }
}

I'm thinking of allowing the way responses are handled configurable, so you can easily write your own adapter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions