Validation failed in case map is expected in request

Issue #170 duplicate
Former user created an issue

Hello, I am getting validation error if a provider server expects a map of string and object in request, defined as:

private Map<String, Object> termFieldMap;

Which in swagger spec can be seen as:

"myMap": {
          "type": "object"
 } 

And when my consumer sends following in request

"myMap":{"myKey":true}

I get error:

com.atlassian.oai.validator.pact.ValidatedPactProviderRule$PactValidationError: Validation failed.
[ERROR] [Path '/myMap'] Object instance has properties which are not allowed by the schema: ["myKey"]

    at com.atlassian.oai.validator.pact.ValidatedPactProviderRule.validatePactDef(ValidatedPactProviderRule.java:98)
    at com.atlassian.oai.validator.pact.ValidatedPactProviderRule.access$000(ValidatedPactProviderRule.java:27)

Can you please help what could be happening. Thanks a lot.

Comments (2)

  1. Log in to comment