Skip to content

Commit be32bb3

Browse files
author
Laurent PINSON
committed
Release 0.4
1 parent 7335437 commit be32bb3

File tree

5 files changed

+1263
-329
lines changed

5 files changed

+1263
-329
lines changed

JSONLibrary/JSONLibraryKeywords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def convert_string_to_json(self, json_string):
179179
return json.loads(json_string)
180180

181181
@keyword("Dump JSON To File")
182-
def dump_json_to_file(self, dest_file, json_object):
182+
def dump_json_to_file(self, dest_file, json_object, encoding=None):
183183
"""Dump JSON to file
184184
185185
Arguments:
@@ -192,7 +192,7 @@ def dump_json_to_file(self, dest_file, json_object):
192192
| Dump JSON To File | ${OUTPUTID)${/}output.json | ${json} |
193193
"""
194194
json_str = self.convert_json_to_string(json_object)
195-
with open(dest_file, "w") as json_file:
195+
with open(dest_file, "w",encoding=encoding) as json_file:
196196
json_file.write(json_str)
197197
return str(dest_file)
198198

JSONLibrary/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
VERSION = "0.3.1"
4+
VERSION = "0.4"

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ JSONPath is an expression which can help to access to your JSON document. The JS
1818

1919
This library can help you to add, get, update and delete your JSON object. So it's very useful in case that you have a very large JSON object.
2020

21+
Please note this library is a bridge between the Robot Framework and the parser jsonpath-ng. Hence, issues related to parsing should be raised on https://github.com/h2non/jsonpath-ng
22+
2123
# Usage
2224
Install robotframework-jsonlibrary via ``pip`` command
2325
```bash
@@ -51,6 +53,14 @@ For an example of JSONPath expressions. Go to this link:
5153

5254
https://goessner.net/articles/JsonPath/index.html#e3
5355

56+
Parser: jsonpath-ng:
57+
58+
https://github.com/h2non/jsonpath-ng
59+
60+
This github:
61+
62+
https://github.com/robotframework-thailand/robotframework-jsonlibrary
63+
5464
#Help & Issues
5565
Mention me on Twitter [@nottyo](https://twitter.com/nottyo)
5666

0 commit comments

Comments
 (0)