kaihlavi | d1a1fb7 | 2019-06-13 16:11:48 +0300 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation This resource is filling out json string templates and returning the json back |
| 3 | Library RequestsLibrary |
kaihlavi | dc39684 | 2019-06-26 15:09:37 +0300 | [diff] [blame^] | 4 | Library ONAPLibrary.TemplatingKeywords |
kaihlavi | d1a1fb7 | 2019-06-13 16:11:48 +0300 | [diff] [blame] | 5 | Library OperatingSystem |
| 6 | |
| 7 | *** Keywords *** |
| 8 | Fill JSON Template |
| 9 | [Documentation] Runs substitution on template to return a filled in json |
| 10 | [Arguments] ${json} ${arguments} |
| 11 | ${returned_string}= Template String ${json} ${arguments} |
| 12 | ${returned_json}= To Json ${returned_string} |
| 13 | [Return] ${returned_json} |
| 14 | |
| 15 | Fill JSON Template File |
| 16 | [Documentation] Runs substitution on template to return a filled in json |
| 17 | [Arguments] ${json_file} ${arguments} |
| 18 | ${json}= OperatingSystem.Get File ${json_file} |
| 19 | ${returned_json}= Fill JSON Template ${json} ${arguments} |
| 20 | [Return] ${returned_json} |