Skip to content

Map contract with List as value #1871

@phipu80

Description

@phipu80

Hi,
I have an api that returns something like:
Map<string, List<RandomObject>>

I try to create a pact file for PactSpecVersion.V3.

With pact-jvm 3.6.13 the mock
newJsonBody(root -> root.minArrayLike('Item1', 1, obj -> ....
works fine. This generates:
"matchingRules": { "body": { "$.Item1": { "matchers": [ { "match": "type", "min": 1 } ], "combine": "AND" }
But when I do the same with 4.6.11 then I get:
"matchingRules": { "body": { "$[Item1]": { "combine": "AND", "matchers": [ { "match": "type", "min": 1 } ] }

The producer-test throws an exception when there are brackets around Item1,

Do you have an idea what I'm doing wrong? Is there another api for my needs?
Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions