I have list of Block object.
`class Block:
def __init__(self, index, previous_hash, transactions, proof=101, time = datetime.now()):
self.index = index
self.time = time
self.transactions = transactions
self.proof = proof
self.previous_hash = previous_hash`
I have created a Get method that return a list of Block objects converted to dictionary.
@app.route('/chain', methods=['GET'])
def full_chain():
response = {
'chain': [block.to_dict() for block in blockchain.chain],
'length': len(blockchain.chain),
}
return jsonify(response), 200
How can I modify the code to be able to directly get an array of objects instead of an array of dictionaries?