<@U4XJL1CTH> Done <https://github.com/spring-cloud...
# spring
s
+1 valuable feedback
Copy code
package contracts

import org.springframework.cloud.contract.spec.contract

contract {
    request { // (1)
        method("PUT") // (2)
        url("/fraudcheck") // (3)
        body(mapOf( // (4)
                "clientId" to dyn(consumer = regex("[0-9]{10}"), producer = "8532032713"),
                "loanAmount" to 99999
        ))
        headers {// (5)
            contentType("application/vnd.fraud.v1+json")
        }
    }
    response { // (6)
        status(200) // (7)
        body(mapOf( // (8)
                "fraudCheckStatus" to "FRAUD",
                "rejectionReason" to "Amount too high"
        ))
        headers { // (9)
            contentType("application/vnd.fraud.v1+json")
        }
    }
}
looks better
s
👍
s
I also added support for varargs without mapOf() nicer IMHO
s
Indeed very nice
Not sure about
dyn
but I don't know too much the logic behind to propose a better name