List responses and pagination

Different APIs wrap their lists differently. Understudy serves the right shape with real pagination, configured per resource, without hardcoding any vendor's field names.

List endpoints are where mocks usually fall apart. Every API wraps a list its own way:

  • a bare array,
  • { data, has_more },
  • { page, pageSize, totalPages, items },
  • { Total, Page, OrderList },

and many more. Understudy serves the shape your contract describes, with real paging underneath.

Imported specs: faithful to the schema

For an imported contract, the runtime shapes each list response to the schema you declared. It works out where the records go, then fills the surrounding fields by their usual names. Bare arrays, envelopes with items or results or data, and named lists all work, and the paging is real: ask for page two and you get page two.

No vendor names baked in

None of this is hardcoded to a particular API. The conventions are recognised by their shape and role, not by a fixed list of field names, so your contract's own wording is what gets used. You can also adjust the list behaviour per resource in the editor, with no code.