asyrjasalo / RESTinstance

Robot Framework library for RESTful JSON APIs
https://pypi.org/project/RESTinstance
GNU Lesser General Public License v3.0
205 stars 84 forks source link

Object keyword not finding JSON path. #59

Closed technigirl closed 3 years ago

technigirl commented 5 years ago

Hello, I am trying to write a test step as follows: Object $.request.body.data.attributes.participants required=["phone_number","name","email"] I have also tried: Object $.data.attributes.participants required=[“phone_number”,”name”,”email”]

The body data from Output is:

{
    "request": {
        "body": {
            "data": {
                "attributes": {
                    "participants": [
                        {
                            "phone_number": "5554447777",
                            "name": "QA Tester",
                            "email": "liveoakqa+tester@outlook.com"
                        }
                    ],
                    "name": "Manual Test Room"
                },
                "type": "room"
            }
        },
        ....

I cannot understand why it is not finding the JSON path. The error is:

JSONPath query '$.request.body.data.attributes.participants' did not match anything.

This doesn't seem to be correct, as the path is clearly present. Can you take a look and let me know if I am missing something, or if this is a bug?

goehlemichael commented 5 years ago

I think it should be:

Array $.participants required=[“phone_number”,”name”,”email”]

asimell commented 3 years ago

Hi @technigirl ,

Is this still an issue?

I believe this library uses $ as a shorthand to response.body (even though it should be root). Can you try the same with just request body ...?

asimell commented 3 years ago

Closing issue due to lack of new information. Please reopen if still an issue.