Skip to content

An OpenAPI spec describes operations. It never says “these five operations are about the same pet”. Rapi Mock works that out, and tells you how sure it is.

These three paths:

GET /pets returns a list of Pet
POST /pets takes a Pet
GET /pets/{petId} returns a Pet

share a schema and a path shape, so they become one resource, Pet. From that the mock derives:

  • The key: the path parameter matched to a field, {petId} to id.
  • What each operation does: list, create, read, update, patch or delete.
  • Links: a field such as ownerId points at the Owner resource, so seeded pets belong to seeded owners.
  • Parents: a comment created at /articles/{slug}/comments belongs to that article.

Where the records sit in a response is read from its structure: a bare array, a data property, a page object’s values, or a property named after the resource.

Every operation gets one:

Label Meaning
Stateful Reads and changes stored records. The spec says clearly which resource the operation works on, so what you create shows up in later calls.
Needs review Reads and changes stored records too, but the spec left a gap and the mock filled it with a best guess, such as which field is the key. The Mock UI and rapidoc lint --stateful show each guess; correct a wrong one in mock.config.yaml.
Static Keeps no data. No resource fits the operation, so it returns the spec’s example, or generated data, the same on every call. Nothing you send is stored. A login, a search, a file upload.

The mock is cautious on purpose. When it isn’t sure an operation belongs to a resource, it leaves it static; it does not guess.

  • The start-up line counts the operations in each group.
  • The Mock UI shows every operation with its label and reason.
  • rapidoc lint --stateful reports the assumptions at their place in the spec.

State the fact in mock.config.yaml: a resource’s key, or what an operation does. Not every API shows its data model in a way the mock can read; see API styles.