Find stubs by matching on their metadata
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/find-by-metadata \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"matchesJsonPath": {
"expression": "$.outer",
"equalToJson": "{ \"inner\": 42 }"
}
}'
{
"meta": {
"total": 2
},
"mappings": [
{
"id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"uuid": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"request": {
"method": "GET",
"url": "/search?q=things",
"headers": {
"Accept": {
"equalTo": "application/json"
}
}
},
"response": {
"status": 200,
"jsonBody": [
"thing1",
"thing2"
],
"headers": {
"Content-Type": "application/json"
}
}
},
{
"request": {
"method": "POST",
"urlPath": "/some/things",
"bodyPatterns": [
{
"equalToXml": "<stuff />"
}
]
},
"response": {
"status": 201
}
}
]
}
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
The ID of the Mock API
5 - 10
"jjl8y"
Matched stub mappings
The response is of type object
.
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/find-by-metadata \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"matchesJsonPath": {
"expression": "$.outer",
"equalToJson": "{ \"inner\": 42 }"
}
}'
{
"meta": {
"total": 2
},
"mappings": [
{
"id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"uuid": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"request": {
"method": "GET",
"url": "/search?q=things",
"headers": {
"Accept": {
"equalTo": "application/json"
}
}
},
"response": {
"status": 200,
"jsonBody": [
"thing1",
"thing2"
],
"headers": {
"Content-Type": "application/json"
}
}
},
{
"request": {
"method": "POST",
"urlPath": "/some/things",
"bodyPatterns": [
{
"equalToXml": "<stuff />"
}
]
},
"response": {
"status": 201
}
}
]
}
Find stubs by matching on their metadata
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/find-by-metadata \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"matchesJsonPath": {
"expression": "$.outer",
"equalToJson": "{ \"inner\": 42 }"
}
}'
{
"meta": {
"total": 2
},
"mappings": [
{
"id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"uuid": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"request": {
"method": "GET",
"url": "/search?q=things",
"headers": {
"Accept": {
"equalTo": "application/json"
}
}
},
"response": {
"status": 200,
"jsonBody": [
"thing1",
"thing2"
],
"headers": {
"Content-Type": "application/json"
}
}
},
{
"request": {
"method": "POST",
"urlPath": "/some/things",
"bodyPatterns": [
{
"equalToXml": "<stuff />"
}
]
},
"response": {
"status": 201
}
}
]
}
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
The ID of the Mock API
5 - 10
"jjl8y"
Matched stub mappings
The response is of type object
.
curl --request POST \
--url https://wmc.wiremockapi.cloud/v1/mock-apis/{mockApiId}/mappings/find-by-metadata \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"matchesJsonPath": {
"expression": "$.outer",
"equalToJson": "{ \"inner\": 42 }"
}
}'
{
"meta": {
"total": 2
},
"mappings": [
{
"id": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"uuid": "76ada7b0-49ae-4229-91c4-396a36f18e09",
"request": {
"method": "GET",
"url": "/search?q=things",
"headers": {
"Accept": {
"equalTo": "application/json"
}
}
},
"response": {
"status": 200,
"jsonBody": [
"thing1",
"thing2"
],
"headers": {
"Content-Type": "application/json"
}
}
},
{
"request": {
"method": "POST",
"urlPath": "/some/things",
"bodyPatterns": [
{
"equalToXml": "<stuff />"
}
]
},
"response": {
"status": 201
}
}
]
}