# -*-coding:utf-8 -*- #
# ---------------------------------------------------------------------------
# ProjectName:   test67
# FileName:      read_json.py
# Author:       lao_zhao
# Datetime:     2025/6/13 14:34
# Description:
# 
# ---------------------------------------------------------------------------
import json

from APIAutoTest_v3 import log_decorator


@log_decorator
def read_json(file_path):
    """读取json文件，将json文件的内容序列化为python对象再返回"""
    if isinstance(file_path, str) and file_path.endswith(".json"):
        with open(file_path, mode="r", encoding="utf-8") as f:
            return json.load(f)
    else:
        raise FileExistsError("传入json文件的路径错误")



if __name__ == '__main__':
    print(read_json.__doc__)