Closed topsycreed closed 2 years ago
I am not able to replicate this issue with Pact-JVM. See example tests: Consumer and Provider
I did notice that the pact file generated from that consumer test (see pact) has the slash escaped $.data[*].relationships['user/shippingAddress'].data.id
, while the error you provided has $.data[0].relationships.user/shippingAddress.data.id
which is not valid.
How have you generated the Pact file that was used in your test?
Hey @rholshausen thanks for your support! We were able to fix the issue from Consumer side as you mentioned.
Hey!
Steps to reproduce: Sent a get request to endpoint:
Method:GET Path:/shipping/v1 Headers: { "Accept": "application/json", "site": "US", "Content-Type": "application/json" }
That returning response body with '/' symbols, for example:{ "data": [ { "relationships": { "user/shippingAddress": { "data": { "id": "123", "type": "user/shipping-address" } } } } ] }
Actual: At Pact you will see exception:
Request to provider failed with an exception: "/" is not allowed in an identifier in path expression "$.data[0].relationships.user/shippingAddress.data.id" at index 28 (au.com.dius.pact.core.model.InvalidPathExpression)
Expected: Test should be passed successfully, since it's already implemented on service end to return such response and consumers expected that.