title: compare json data in Robot framework
body: <p>I have a compare json data in Robot framework issue.
  If I have three json as below:</p>
  <p>json_A:</p>
  <pre><code>{
   &quot;name&quot;:&quot;XXX&quot;,
   &quot;Type&quot;: {
     &quot;SubType&quot;: {
       &quot;Properties&quot;: [ 
         &quot;Status&quot;,
         &quot;Model&quot;,
         &quot;State&quot;,
         &quot;Tag&quot;,
         &quot;Number&quot;],
                }
            }
  }
  </code></pre>
  <p>json_B:</p>
  <pre><code>{
   &quot;Status&quot;: OK,
   &quot;Model&quot;: YYY,
   &quot;Number&quot;: 0000,
   &quot;Task&quot;: XYZ
  }
  </code></pre>
  <p>json_C:</p>
  <pre><code>{
   &quot;Status&quot;: OK,
   &quot;Model&quot;: YYY,
   &quot;Number&quot;: 0000
   &quot;State&quot;: ON
   &quot;Tag&quot;: 1234
  }
  </code></pre>
  <p>Here are I want to do:</p>
  <pre><code>       result_A = compare Properties of json_A and Object of json_B and collect SAME object
         
             if &quot;ALL&quot; object of the result_A exist in json_C 
  
                 is true and print all object key and value
         
             else
   
                 break
  </code></pre>
  <p>So the result will be true and it will display</p>
  <p>{</p>
  <p>&quot;Status&quot;: OK,</p>
  <p>&quot;Model&quot;: YYY,</p>
  <p>&quot;Number&quot;: 0000</p>
  <p>}</p>
  <p>I know it might be complicated, but could robot framework has related keyword to do that?
  Thanks!!</p>
  <p>Also attach my work for now:</p>
  <pre><code>*** Settings ***
  
  Library    JsonValidator
  
  *** Keywords ***
  
  Get_Response_1
  [Arguments]    ${ip}=${ip}
  ...    ${username}=${USERNAME}
  ...    ${password}=${PASSWORD}        
  
  ${auth} =    Create List    ${username}    ${password}
      Create Session    alias=test_session    url=http://${ip}:8080/redfish/v1
  ...    auth=${auth}    verify=${False}
  
  ${response} =    GET On Session    test_session
  ...    url=https://${ip}:8080/redfish/v1/XXXXXX/YYYYY/ZZZZZ
  
  Status Should Be    200    ${response}
  Should Be Equal As Strings  OK  ${response.reason}
  
  [Return]     ${response}
  
  Get_Response_2
  [Arguments]    ${ip}=${ip}
  ...    ${username}=${USERNAME}
  ...    ${password}=${PASSWORD}        
  
  ${auth} =    Create List    ${username}    ${password}
      Create Session    alias=test_session    url=http://${ip}:8080/redfish/v1
  ...    auth=${auth}    verify=${False}
  
  ${response} =    GET On Session    test_session
  ...    url=https://${ip}:8080/redfish/v1/AAAA/BBBB/CCCC
  
  Status Should Be    200    ${response}
  Should Be Equal As Strings  OK  ${response.reason}
  
  [Return]     ${response}
  
  Get_JSON_File_Data
  
      [Documentation]  Get_JSON_File_Data
  
      ${json}=    Get File    D:\\xxx\yyy\zzz\\json_A.json        
      ${Properties}=    get json value    ${json}   /Type/SubType/Properties
  
      [Return]     ${Properties}
  
  Get_Properties_List
  
      [Documentation]  Get_Properties_List
  
      [Arguments]     ${GET_RESPONSE_DATA}
  
      ${reponse_content}=    Parse Json    ${GET_RESPONSE_DATA.content}
      log    ${reponse_content}
      FOR  ${properties}    IN    @{reponse_content}
      ${elements}=    get elements    ${reponse_content}    ${properties}
      ${properties_list}=    create dictionary    ${properties}    ${elements}
      Log    ${elements}
      Log    ${properties}
      Log    ${properties_list}
      END
  
      [Return]     ${properties_list}
  
  *** Test Cases ***
  
      ${Properties}=    Get_JSON_File_Data
      log    ${Properties}
  
  
      ${GET_JSON_RESPONSE_1}=    GET_Response_1
      log    ${GET_JSON_RESPONSE_1.content}
  
      ${properties_list}=    Get_Properties_List    ${GET_JSON_RESPONSE_1}
      Log    ${properties_list}
  
      ${GET_JSON_RESPONSE_2}=    GET_Response_2
      Log    ${GET_JSON_RESPONSE_2.content}
  
      ${properties_list}=    Get_Properties_List   ${GET_JSON_RESPONSE_2}
  </code></pre>