Skip to content

Page query param added to collection self link #20

@weierophinney

Description

@weierophinney

When I request a collection route while using pagination I get the links rendered as follows:

    "_links": {
        "self": {
            "href": "http://hostname/api/v1/users?page=1"
        },
        "first": {
            "href": "http://hostname/api/v1/users"
        },
        "last": {
            "href": "http://hostname/api/v1/users?page=2"
        }
    },

The url I requested was http://hostname/api/v1/users. The self link in the response gets a pagination param while the first page doesn't. Shouldn't it be the other way around?
So like this:

    "_links": {
        "self": {
            "href": "http://hostname/api/v1/users"
        },
        "first": {
            "href": "http://hostname/api/v1/users?page=1"
        },
        "last": {
            "href": "http://hostname/api/v1/users?page=2"
        }
    },

On the client I would like to dynamically create links to my other pages by adding a page query parameter including a page number to the collection self link. Right now I cannot do this because the self link already holds a page param. I would expect the self link to be a base collection link.


Originally posted by @Wilt at zfcampus/zf-hal#90

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