You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Wiremock获取含点URL参数失败,Spring Boot+Wiremock-jre8求助

WireMock获取含点的URL查询参数值失败

我在使用Spring Boot搭配wiremock-jre8时,遇到了一个问题:无法从URL参数中获取名为product.productCharacteristic.value的带点参数值。

以下是我的Stub配置:

{
    "request": {
        "urlPath": "/exampleOfPath",
        "method": "GET",
        "queryParameters": {
            "product.productCharacteristic.name": {
                "equalTo": "MSISDN"
            },
            "product.productCharacteristic.value": {
                "matches": ".*"
            }
        }
    },
    "response": {
        "status": 200,
        "jsonBody": {
            "key": "the value should be here {{request.query['product.productCharacteristic.value']}}"
        },
        "transformers": [
            "response-template"
        ],
        "headers": {
            "Content-Type": "application/json"
        }
    }
}

我已经尝试了以下所有表达式,但都没能成功获取目标参数值:

  • {{request.query.['product.productCharacteristic.value']}}
  • {{request.query['product.productCharacteristic.value']}}
  • {{request.query['product%2EproductCharacteristic%2Evalue']}}
  • {{request.query.['product%2EproductCharacteristic%2Evalue']}}
  • {{request.query.product%2EproductCharacteristic%2Evalue}}
  • {{request.query.product.productCharacteristic.value}}
  • {{lookup request.query 'product.productCharacteristic.value'}}
  • {{lookup request.query 'product%2EproductCharacteristic%2Evalue'}}

内容的提问来源于stack exchange,提问作者Moustafa Elkady

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 21:06:06