Skip to content
This repository was archived by the owner on Jan 2, 2023. It is now read-only.

Paging links are duplicated unless removed from URI #129

Open
shadowhand opened this issue Jun 17, 2017 · 2 comments
Open

Paging links are duplicated unless removed from URI #129

shadowhand opened this issue Jun 17, 2017 · 2 comments

Comments

@shadowhand
Copy link

Unless the pagination links are removed from the URI passed to Document::addPaginationLinks() the output will be duplicated:

	"links": {
		"first": "https:\/\/api.acme.net\/users?page%5Blimit%5D=5?page%5Blimit%5D=5",
		"next": "https:\/\/api.acme.net/users?page%5Blimit%5D=5?page%5Blimit%5D=5&page%5Boffset%5D=5"
	}

It should be clearly documented that the passed URI must be stripped of query parameters or addPaginationLinks should automatically strip them.

@shadowhand shadowhand changed the title Paging links are duplicated Paging links are duplicated unless removed from URI Jun 17, 2017
@franzliedke
Copy link
Contributor

The second parameter is an array of query parameters, so that should make it clear, right? On the other hand, maybe the first parameter can be called $path?

In any case, any improvements should probably be added to the new API.

@shadowhand
Copy link
Author

@franzliedke I'm not sure what the correct solution is, perhaps just discarding ?.* from the $uri. Right now the documentation just isn't clear about the fact that query params should not be in $uri.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants