【发布时间】:2019-07-09 21:44:14
【问题描述】:
所以我知道这是无效的
Contract dsl =
Contract.make {
description "should return correct expected response"
request {
method GET()
url value(consumer(regex('/v2/abc/user/[0-9]{9,18}')),producer(regex("/abc/v2/user/[0-9]{9,18}")))
}
}
response {
body([
id : $(consumer(regex('.*'))),
])
status 200
}
}
生产者和消费者之间的API网关将生产者url转换为消费者。 Spring Cloud 合约是否允许 API 网关更改 URL 以查看消费者期望的情况?
当我尝试这样做时,错误很明显
You can't have a regular expression for the request on the server side
【问题讨论】: