Skip to content

use JSON() as post body matcher, does the order of fields in the body affect matching result #109

@CodeplayerGm

Description

@CodeplayerGm

sample:
gock.New("https://gitlab.com").
Post("/oauth/token").
Persist().
//JSON(map[string]interface{}{
// "client_id": "12345",
// "client_secret": "12345",
// "code": "mock_code",
// "grant_type": "authorization_code"
//}).
Reply(200).
SetHeader("Content-type", "application/json; charset=utf-8").
BodyString(accessTokenBody)

what if the real request body has different order
{
"client_id": "12345",
"code": "mock_code",
"client_secret": "12345",
"grant_type": "authorization_code"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions