[TOC]
## 接口说明
> 更新一个已存在的 stub mapping 。
## 接口定义
~~~[api]
put:/mappings/{stubMappingId}
*string:stubMappingId=03ba2797-e4f3-46f8-a680-fee52ac7ce1e#URI 参数:StubMapping 的 UUID
<<<
success(request)
{
"name": "wiremock create a stub example",
"priority": 5,
"persistent": true,
"request": {
"method": "POST",
"urlPath": "/thing/100",
"headers": {
"Accept": {
"contains": "json"
}
},
"cookies": {
"X-Auth-Token": {
"equalTo": "123usidsldie98le"
}
}
},
"response": {
"status": 200,
"body": "{\n \"test\":\"liyun\",\n \"node\":{\n \"subnode\":\"subnodevalue\"\n }\n}",
"headers": {
"Content-Type": "application/json"
},
"delayDistribution": {
"type": "uniform",
"lower": 100,
"upper": 300
},
"transformers": ["response-template"]
},
"scenarioName": "订单",
"requiredScenarioState": "Started",
"newScenarioState": "second"
}
<<<
success(response)
{
"id" : "03ba2797-e4f3-46f8-a680-fee52ac7ce1e",
"name" : "wiremock create a stub example",
"request" : {
"urlPath" : "/thing/100",
"method" : "POST",
"headers" : {
"Accept" : {
"contains" : "json"
}
},
"cookies" : {
"X-Auth-Token" : {
"equalTo" : "123usidsldie98le"
}
}
},
"response" : {
"status" : 200,
"body" : "{\n \"test\":\"liyun\",\n \"node\":{\n \"subnode\":\"subnodevalue\"\n }\n}",
"headers" : {
"Content-Type" : "application/json"
},
"delayDistribution" : {
"type" : "uniform",
"lower" : 100,
"upper" : 300
},
"transformers" : [ "response-template" ]
},
"uuid" : "03ba2797-e4f3-46f8-a680-fee52ac7ce1e",
"persistent" : true,
"priority" : 5,
"scenarioName" : "订单",
"requiredScenarioState" : "Started",
"newScenarioState" : "second"
}
~~~
## [JSON Schema](https://jsonschema.net/)
### Request JSON Schema
同 [Stub Mapping](StubMapping.md) 。
### Response JSON Schema
同 [Stub Mapping](StubMapping.md) 。
- Admin API
- Stub Mapping API
- /mappings
- GET
- POST
- DELETE
- /mappings/reset
- /mappings/{stubMappingId}
- GET
- PUT
- DELETE
- /mocklab/mappings/normal
- /mocklab/mappings/notify
- Record API
- /recordings/start
- /recordings/stop
- /recordings/status
- /recordings/snapshot
- Settings API
- /mocklab/settings
- JSON Schema
- Stub Mapping
- Stub Mappings
- Stub Mappings meta
- 官方 API 文档
- 文章模板
- API 文章模板