Skip to content

Deprecate To Json keyword in favor of response.json attribute #219

Closed

Description

@ppazos

I have seen tests supporting ${jsondata}= To Json ${resp.content}

But couldn't find a way to get data out of the jsondata

For instance, I want to check if a specific value is at a path in the json tree, how can that be achieved?

Activity

  1. trogdor259 commented on Feb 9, 2019

    @trogdor259

    ${jsondata["key"][0]["another_key"]}

  2. ppazos commented on Feb 10, 2019

    @ppazos
    Author

    thanks @trogdor259 is there any documentation about that API? for instance, can I do something like ${jsondata["key"].length} ? Or how to ask is an attribute exists in the JSON like ${jsondata["key"].exists} ?

  3. lucagiove commented on Mar 17, 2019

    @lucagiove
    Member

    you can directly get the dictionary with ${resp.json()}
    http://docs.python-requests.org/en/master/user/quickstart/#json-response-content

  4. lucagiove commented on Oct 16, 2019

    @lucagiove
    Member

    To be honest I don't see the point of using To Json keyword since the response already has .json attribute.

  5. changed the title [-]Get data from json[/-] [+]Deprecate To Json keyword in favor of response.json attribute[/+] on Oct 16, 2019
  6. added this to the 0.6 milestone on Oct 16, 2019
  7. modified the milestones: 0.6, 0.7 on Apr 17, 2020
  8. andreagubellini commented on Oct 9, 2020

    @andreagubellini
    Collaborator

    Hi, I've opened this PR related to this issue.

  9. modified the milestones: 0.7, 0.8 on Oct 9, 2020
  10. mayribeirofernandes commented on Jan 29, 2021

    @mayribeirofernandes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions