blob: a1cc7e35dc77ff67b3787cef41396ebcd934c82b [file] [log] [blame]
ma987de38164b2017-09-28 16:33:03 -05001*** Settings ***
2Documentation This resource is filling out json string templates and returning the json back
3Library RequestsLibrary
4Library eteutils/StringTemplater.py
5Library OperatingSystem
6Resource global_properties.robot
7
8*** Keywords ***
9Fill JSON Template
10 [Documentation] Runs substitution on template to return a filled in json
11 [Arguments] ${json} ${arguments}
12 ${returned_string}= Template String ${json} ${arguments}
13 ${returned_json}= To Json ${returned_string}
14 [Return] ${returned_json}
15
16Fill JSON Template File
17 [Documentation] Runs substitution on template to return a filled in json
18 [Arguments] ${json_file} ${arguments}
19 ${json}= OperatingSystem.Get File ${json_file}
20 ${returned_json}= Fill JSON Template ${json} ${arguments}
21 [Return] ${returned_json}