Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All-digit keys of a response body have the wrong path in the matching rules of the generated pact file #1851

Open
mrickly opened this issue Jan 10, 2025 · 0 comments

Comments

@mrickly
Copy link

mrickly commented Jan 10, 2025

Tested with au.com.dius.pact.core:model:4.6.11

Change leading to the problem (it seems): 2dd6271#diff-80e566076d12e545a06e091b743fc936113a142ad0ab0572c6053c136c8a4703R211

Java Code:

    private DslPart createOzoDatenResponsePayload(final String vrsvereinbarungsnummer) {
        return newJsonBody(mapEntry -> mapEntry.object(vrsvereinbarungsnummer, wrapperDto -> {
            wrapperDto.eachLike(OzoDatenAdapterDto.Fields.VRS_GEGENSTAENDE, vrsGegenstaende -> {
                vrsGegenstaende.stringType("@class", "EventDto");
            });
        })).build();
    }

Result:

        "matchingRules": {
          "body": {
            "$[660202434058].vrsGegenstaende": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "type"
                }
              ]
            },
            "$[660202434058].vrsGegenstaende[*].@class": {
              "combine": "AND",
              "matchers": [
                {
                  "match": "type"
                }
              ]
            }
          }
@mrickly mrickly changed the title All digit keys of a response body have the wrong path in the matching rules of the generated pact file All-digit keys of a response body have the wrong path in the matching rules of the generated pact file Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant