{"id":5461,"library":"robotframework-jsonlibrary","title":"Robot Framework JSONLibrary","description":"robotframework-jsonlibrary is a Robot Framework test library designed for manipulating JSON objects within test automation scripts. It leverages JSONPath expressions for efficient querying, adding, updating, and deleting data within JSON structures. The current version is 0.5, with releases occurring sporadically, indicating active maintenance.","status":"active","version":"0.5","language":"en","source_language":"en","source_url":"https://github.com/robotframework-thailand/robotframework-jsonlibrary.git","tags":["Robot Framework","JSON","JSONPath","testing","automation","API testing"],"install":[{"cmd":"pip install -U robotframework-jsonlibrary","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core framework for the library.","package":"robotframework","optional":false},{"reason":"Underlying parser for JSONPath expressions.","package":"jsonpath-ng","optional":false},{"reason":"Used for JSON schema validation keywords.","package":"jsonschema","optional":true}],"imports":[{"note":"Imported in Robot Framework's *** Settings *** section.","symbol":"JSONLibrary","correct":"*** Settings ***\nLibrary    JSONLibrary"}],"quickstart":{"code":"resource.robot\n*** Settings ***\nLibrary    JSONLibrary\n\n*** Test Cases ***\nExample JSON Manipulation\n    ${json_obj}=    Create Dictionary    name=Alice    age=30    city=New York\n    Log    Initial JSON: ${json_obj}\n\n    # Add a new field\n    ${updated_json}=    Add Object To Json    ${json_obj}    $.email    alice@example.com\n    Log    JSON after adding email: ${updated_json}\n\n    # Get a value\n    ${name}=    Get Value From Json    ${updated_json}    $.name\n    Should Be Equal As Strings    ${name}    Alice\n    Log    Name retrieved: ${name}\n\n    # Update a value\n    ${final_json}=    Update Value To Json    ${updated_json}    $.age    31\n    Log    JSON after updating age: ${final_json}\n\n    # Verify update\n    ${updated_age}=    Get Value From Json    ${final_json}    $.age\n    Should Be Equal As Strings    ${updated_age}    31","lang":"robotframework","description":"This Robot Framework example demonstrates basic JSON manipulation. It creates a JSON object (as a Robot Framework dictionary), adds a new field using `Add Object To Json`, retrieves a value with `Get Value From Json`, and updates an existing field using `Update Value To Json`. The `Should Be Equal As Strings` keyword is used for assertions. This code is designed to be placed in a `.robot` file."},"warnings":[{"fix":"Upgrade to Python 3.x.","message":"Python 2 support was dropped starting with version 0.4. Users on Python 2 must either upgrade their Python environment or use an older version of the library (pre-0.4).","severity":"breaking","affected_versions":">=0.4"},{"fix":"Ensure test cases capture the return value of modifying keywords, e.g., `${json_obj}=    Add Object To Json    ${json_obj}    ...`","message":"Prior to version 0.5, some keywords that modified JSON objects (e.g., `Add Object To Json`) would modify the object in-place. As of version 0.5, these keywords now consistently return the modified JSON object, requiring users to capture the return value.","severity":"breaking","affected_versions":"<0.5"},{"fix":"Consult `jsonpath-ng` documentation and issue tracker for parsing-specific problems.","message":"This library acts as a bridge to the `jsonpath-ng` parser. Any issues encountered with JSONPath parsing behavior should be reported directly to the `jsonpath-ng` repository, not `robotframework-jsonlibrary`.","severity":"gotcha","affected_versions":"*"},{"fix":"Monitor `jsonpath-ng` and `ply` for security updates, or consider vendoring `ply` with security patches if a fix is not available upstream.","message":"The underlying `jsonpath-ng` library has a dependency `ply`, which has been flagged with high-severity vulnerabilities (e.g., 9.8). Users should be aware of this transitive dependency risk.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}