You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GET request receiving JSON data as string and tool fails to parse this data.
Traceback (most recent call last):
File "rf_client.py", line 780, in
main()
File "rf_client.py", line 774, in main
rfs_test.run(sut)
File "/usr/bin/rfs_test/init.py", line 39, in run
TEST_protocol_details.run(sut, log)
File "/usr/bin/rfs_test/TEST_protocol_details.py", line 5091, in run
assertion_status = Assertion_6_5_8(self, log)
File "/usr/bin/rfs_test/TEST_protocol_details.py", line 4495, in Assertion_6_5_8
resource = json_payload['@odata.context']
TypeError: string indices must be integers, not str
The text was updated successfully, but these errors were encountered:
I can add some additional checking to be sure the response has been parsed into a JSON object (dict) and thereby avoid the TypeError and early program termination.
The question is why didn't the response get parsed into JSON? From code inspection, the most likely reason would be that the response from the service did not include a Content-Type header with a value that included "application/json".
GET request receiving JSON data as string and tool fails to parse this data.
Traceback (most recent call last):
File "rf_client.py", line 780, in
main()
File "rf_client.py", line 774, in main
rfs_test.run(sut)
File "/usr/bin/rfs_test/init.py", line 39, in run
TEST_protocol_details.run(sut, log)
File "/usr/bin/rfs_test/TEST_protocol_details.py", line 5091, in run
assertion_status = Assertion_6_5_8(self, log)
File "/usr/bin/rfs_test/TEST_protocol_details.py", line 4495, in Assertion_6_5_8
resource = json_payload['@odata.context']
TypeError: string indices must be integers, not str
The text was updated successfully, but these errors were encountered: