W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
在合同定義的頂級(jí)閉合中可以調(diào)用以下方法。request
和response
是必需的。priority
是可選的。
Groovy DSL。
org.springframework.cloud.contract.spec.Contract.make { // Definition of HTTP request part of the contract // (this can be a valid request or invalid depending // on type of contract being specified). request { method GET() url "/foo" //... } // Definition of HTTP response part of the contract // (a service implementing this contract should respond // with following response after receiving request // specified in "request" part above). response { status 200 //... } // Contract priority, which can be used for overriding // contracts (1 is highest). Priority is optional. priority 1 }
YAML。
priority: 8 request: ... response: ...
如果要使合同具有較高的優(yōu)先級(jí),則需要將較低的數(shù)字傳遞給priority
標(biāo)簽/方法。例如,值5
的priority
的優(yōu)先級(jí)高于值10
的priority
。更高比priority
與{值4141 /}優(yōu)先級(jí)。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: