Skip to content

Include self links are wrong #27

@rgant

Description

@rgant

For the request http://localhost:8080/v1/books/7?include=author I get the following for the included key:

{
    "data": "...",
    "included": [{
        "id": "2",
        "type": "authors",
        "attributes": {
            "name": "J. K. Rowling",
            "date_of_birth": "1965-07-31",
            "date_of_death": null,
            "created_at": "2016-02-24 17:56:52",
            "updated_at": "2016-02-24 17:56:52"
        },
        "relationships": {
            "books": {
                "links": {
                    "self": "/v1/books/2/relationships/books",
                    "related": "/v1/books/2/books"
                }
            },
            "photos": {
                "links": {
                    "self": "/v1/books/2/relationships/photos",
                    "related": "/v1/books/2/photos"
                }
            }
        },
        "links": {
            "self": "/v1/books/2"
        }
    }]
}

I believe that the included.links.self should be "/v1/authors/2" instead of "/v1/books/2"

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