Matching an array in the request body
collimarco opened this issue · comments
Marco Colli commented
I cannot match an array in the JSON request body.
gock.New("https://example.com").
Post("/api/v1/projects/PROJECT_ID/notifications").
MatchType("json").
JSON(map[string]interface{}{"body": "Hello user1", "uids": []string{"user1"}}).
Reply(201)
It seems that JSON matching works only with type map[string]string
but not with more complex objects (like array fields).
I always get: gock: cannot match any request
.
Any suggestions?
Thank you