input_json = """
{
"a': 1,
"b": 2,
"c": 3
}
"""
prim = Prim.parse_raw(input_json )
print(prim.json)
'list' object has no attribute 'json'
json_data = json.dumps(books, ensure_ascii=False, default=str)
'str' object has no attribute 'json'
Передавать нужный тип данных.
Book ожидает dict не list(type=type_error)
with open('data.json') as json_file:
data = json.load(json_file)
the JSON object must be str, bytes or bytearray, not list (type=type_error)