Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a new assertion ShouldJsonContain for arrays #746

Closed
floriancazals opened this issue Nov 17, 2023 · 1 comment
Closed

Create a new assertion ShouldJsonContain for arrays #746

floriancazals opened this issue Nov 17, 2023 · 1 comment

Comments

@floriancazals
Copy link
Collaborator

I have the following case, an array baz containing two elements. Each of the element is an object with the attribute attr
For example:

{
        "baz": [
                {
                        "attr": "foo"
                },
                {
                        "attr": "bar"
                }
        ]
}

I would like to make an assertion like this one

        assertions:
        - result.bodyjson.baz.attr ShouldJsonContain foo

Avoiding to have to specify the index of the array which.

Indeed the attrubute foo may be on index 1 instead of index 0 in my case.

floriancazals pushed a commit that referenced this issue Nov 20, 2023
…egations (#746)

Signed-off-by: florian.cazals <florian.cazals@ovhcloud.com>
floriancazals pushed a commit that referenced this issue Nov 20, 2023
…egations (#746)

Signed-off-by: florian.cazals <florian.cazals@ovhcloud.com>
floriancazals pushed a commit that referenced this issue Nov 20, 2023
…egations (#746)

Signed-off-by: florian.cazals <florian.cazals@ovhcloud.com>
floriancazals pushed a commit that referenced this issue Nov 20, 2023
…egations (#746)

Signed-off-by: florian.cazals <florian.cazals@ovhcloud.com>
yesnault pushed a commit that referenced this issue Nov 22, 2023
…egations (#746)

Signed-off-by: florian.cazals <florian.cazals@ovhcloud.com>
yesnault pushed a commit that referenced this issue Nov 23, 2023
…egations (#746) (#747)

Signed-off-by: florian.cazals <florian.cazals@ovhcloud.com>
@yesnault
Copy link
Member

yesnault commented Dec 4, 2023

done

@yesnault yesnault closed this as completed Dec 4, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants