endpoints / endpoints-example

an example api written using endpoints

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include self links are wrong

rgant opened this issue · comments

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"

+1 ...i get the same return

anyone patch this up yet?

PRs welcome ✌️