jsonapi.org 使用页面查询字符串使用分页的正确方法

jsonapi.org correct way to use pagination using the page query string

documentation for jsonapi 分页中是这样说的:

For example, a page-based strategy might use query parameters such as page[number] and page[size]

我如何在查询字符串中表示它? http://localhost:4200/people?page[number]=1&page[size]=25,我认为使用映射 link 结构不是有效的查询字符串。根据文档仅保留 page 参数。

I don't think using a map link structure is a valid query string.

从技术上讲你是对的,这就是为什么规范中有这样的注释:

Note: The example query parameters above use unencoded [ and ] characters simply for readability. In practice, these characters must be percent-encoded, per the requirements in RFC 3986.

因此,page[size] 实际上是 page%5Bsize%5D,这是一个有效的查询参数名称。

Only the page parameter is reserved according to the documentation.

当规范文本说只保留页面时,实际上意味着保留任何 page[......] 样式的查询参数。 (我可以肯定地告诉你,作为规范的编辑之一。)但它应该更明确地说,所以我会为它打开一个问题。