Skip to content

Commit

Permalink
changes done in all files
Browse files Browse the repository at this point in the history
-test scripts
-Rest client (added Auto_save)
-changes in save_json_to_file
  • Loading branch information
kunal-nitor committed Sep 19, 2024
1 parent 11b6f59 commit f594c86
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion API_Requests/Lib/File_Operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ def read_json_from_file(file_path,request_dir='API_Requests/Data/Request_Body'):
"""
try:
full_path = os.path.join(request_dir,file_path)

# Normalize the path for logging
full_path_normalized = full_path.replace(os.sep, '/')

with open(full_path, 'r') as file:
data = json.load(file)
logger.info(f"JSON data successfully read from {full_path}")
logger.info(f"JSON data successfully read from {full_path_normalized}")
return data
except json.JSONDecodeError as e:
logger.error(f"Failed to decode JSON: {e}")
Expand Down

0 comments on commit f594c86

Please sign in to comment.