Re: Hydra collection discovery parameters

Hello Antoine.

See 5.7 Client initiated pagination:
https://www.hydra-cg.com/spec/latest/core/#client-initiated-pagination

The Hydra spec suggests using offset/limit keyword arguments in URLs.

I'll give my personal opinion on your other questions.

> Should we use the [IriTemplate Operation](
https://www.hydra-cg.com/spec/latest/core/#iri-template-operations) on the
documentation directly so that we already use this query parameter?

Yes. They should be provided as part of the Hypermedia controls for that
resource. In 5.7 the spec suggests using template variables.

> I'm also wondering how the client should know what value, or type of
value the defaults should be, especially while discovering URIs.

One way to do this in HTTP could be via temporary redirects. For example, a
GET request to a Collection resource would return a 301, 302, or a 303
response to the PartialCollectionView with the defaults present as keyword
arguments in the URL.

    GET http://api.example.com/an-issue/comments

    302 Found
    Location: http://api.example.com/an-issue/comments?offset=0&limit=50

The downside is that it is more inefficient.

Rigel.

Received on Saturday, 5 July 2025 11:07:25 UTC