Skip to content

JSON API v1.0 support #271

Open
Open
@ghost

Description

Hi.

I'm planning to use JSON API v1.0 standard with Grape API + Grape Entities + Grape Swagger in my project, but unfortunately I couldn't manage to make it work.

I've stumbled upon an issue that I cannot create nested attributes. The result I'm trying to achieve should look like so:

{
  "links": {
    "self": "http://example.com/posts",
    "next": "http://example.com/posts?page[offset]=2",
    "last": "http://example.com/posts?page[offset]=10"
  },
  "data": {
    "type": "posts",
    "id": "1",
    "attributes": {
      "title": "JSON API paints my bikeshed!"
    }
    relationships: {
      author: {
        data: {
          id: 1,
          type: 'users'
        }
      }
    }
  }
}

Is it even possible with Grape::Entity + Grape Swagger?

Forgot to mention, Swagger UI just shows flat list of attributes in both request parameters section and response model.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions