lib/json: add hook to customize the deserialization of plain JSON objects