过滤器:[?] 不能应用于原语处理 Spring Cloud Contract DSL

Filter: [?] can not be applied to primitives processing Spring Cloud Contract DSL

我有一个 Spring Cloud Contract DSL,如下所示:

    package contracts.someconsumer.messaging

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

    Contract.make {
        label 'my_label'
        // input to the contract
        input {
            // the contract will be triggered by a method
            triggeredBy('someMethodThatSendsMessage()')
        }

        // output message of the contract
        outputMessage {
            // destination to which the output message will be sent
            sentTo 'Consumer.contractTest.VirtualTopic.some_destination'

            // the body of the output message
            body([
                id: value(consumer('11111111-2222-3333-4444-555555555555'),producer(regex(uuid()))),
                correlationId: value(producer(regex(uuid()))), 
                service: 'MY_SERVICE',
                payload:  
                [
                    email: 'test@example.com'
                ]
            ])
        }
    }

没有 "payload" 部分一切正常。对于有效载荷,我遇到了这个异常:

com.jayway.jsonpath.InvalidPathException: Filter: [?] can not be applied to primitives. Current context is: {"email":"test@example.com","legalName":"ACME Inc"} at com.jayway.jsonpath.internal.path.PredicatePathToken.evaluate(PredicatePathToken.java:66) ~[json-path-2.2.0.jar:2.2.0] at com.jayway.jsonpath.internal.path.PathToken.handleObjectProperty(PathToken.java:81) ~[json-path-2.2.0.jar:2.2.0] at com.jayway.jsonpath.internal.path.PropertyPathToken.evaluate(PropertyPathToken.java:79) ~[json-path-2.2.0.jar:2.2.0] at com.jayway.jsonpath.internal.path.RootPathToken.evaluate(RootPathToken.java:62) ~[json-path-2.2.0.jar:2.2.0]

生成测试的相关行:

        assertThatJson(parsedJson).field("['payload']").field("['email']").isEqualTo("test@example.com");

更多信息,这是序列化消息的样子:

2017-09-21 08:32:03.721 INFO 10716 --- [ main] c.v.sccdemo.producer.InviteServiceImpl : Event: {"id":"e63de44e-6e1a-4c4e-b98b-3c49a49efc9c","destination":"VirtualTopic.some_destination","correlationId":"8efb9740-5651-4068-8a6e-574ae7759552","service":"MY_SERVICE","payload":"{\"email\":\"test@example.com\",\"legalName\":\"ACME Inc\"}","timestamp":1505997123576,"version":"v1"}

我在 DSL 中做错了什么吗? body 的 'payload' 部分表达正确吗?

有效载荷看起来不对...请注意,它将有效载荷视为 String 值而不是 Map。我想这足以将有效负载更改为正确的有效负载,一切应该会再次正常工作!