v1

latestOpenAPI 3.0.02026-07-14330119.9 KB
Stub Mappings

Create a new stub mapping

post/__admin/mappings

Request body

idstring

This stub mapping's unique identifier

metadataobject

Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.

namestring

The stub mapping's name

newScenarioStatestring

The new state for the scenario to be updated to after this stub is served.

persistentboolean

Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.

postServeActionsobject

A map of the names of post serve action extensions to trigger and their parameters.

priorityinteger

This stub mapping's priority relative to others. 1 is highest.

requiredScenarioStatestring

The required state of the scenario in order for this stub to be matched.

scenarioNamestring

The name of the scenario that this stub mapping is part of

uuidstring

Alias for the id

Example request

{
  "request": {
    "bodyPatterns": [
      {
        "equalToJson": "{ \"numbers\": [1, 2, 3] }"
      }
    ],
    "headers": {
      "Content-Type": {
        "equalTo": "application/json"
      }
    },
    "method": "POST",
    "url": "/some/thing"
  }
}

Response

The stub mapping

idstring

This stub mapping's unique identifier

metadataobject

Arbitrary metadata to be used for e.g. tagging, documentation. Can also be used to find and remove stubs.

namestring

The stub mapping's name

newScenarioStatestring

The new state for the scenario to be updated to after this stub is served.

persistentboolean

Indicates that the stub mapping should be persisted immediately on create/update/delete and survive resets to default.

postServeActionsobject

A map of the names of post serve action extensions to trigger and their parameters.

priorityinteger

This stub mapping's priority relative to others. 1 is highest.

requiredScenarioStatestring

The required state of the scenario in order for this stub to be matched.

scenarioNamestring

The name of the scenario that this stub mapping is part of

uuidstring

Alias for the id

Example response

{
  "request": {
    "bodyPatterns": [
      {
        "equalToJson": "{ \"numbers\": [1, 2, 3] }"
      }
    ],
    "headers": {
      "Content-Type": {
        "equalTo": "application/json"
      }
    },
    "method": "POST",
    "url": "/some/thing"
  }
}