Skip to content

Ignore order of elements in list in JSON #208

Open
@Majestry

Description

@Majestry

Let's assume, we expect the next payload to be sent in POST request, that should be caught by smocker:
{ "tags": ["hello1", "hello2", "hello3"] }
If i create the new mock and specify the shown json as body with matcher ShouldEqualJSON, it will work only if we receive the exactly same list in the same order.

If, for example, received body is
{ "tags": ["hello2", "hello1", "hello3"] }
then Smocker will not match it with configured mock and will return 666.

I propose to ignore the order of entries inside the list, since logically this is still the same list in both cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions