我们正在使用https://github.com/googleapis/google-api-python-client连接到同时处理发现的Gmail。今天,我们注意到其中一台服务器未通过API,并发现发现缓存(缓存在google-api-python-client-discovery-doc.cache中)是无效的,并且不是JSON可解析的。
似乎发现模式构建不正确或在传输过程中丢失了一些东西(后者如何发生,我不知道) 我在此处添加了部分JSON,您可以在此处的第7行看到无效的JSON。
"quotaUser": {
"type": "string","description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user,but should not exceed 40 characters.","location": "query"
},"upload_protocol": {
"description": "Upload protocol for media (e.g. \"raw\",\"eapis.com/auth/gmail.settings.sharing": {
"description": "Manage your sensitive mail settings,including who can manage your mail"
},"https://www.googleapis.com/auth/gmail.modify": {
"description": "View and modify but not delete your email"
},"https://www.googleapis.com/auth/gmail.metadata": {
"description": "View your email message metadata such as labels and headers,but not the email body"
},"https://www.googleapis.com/auth/gmail.labels": {
"description": "Manage mailbox labels"
},"https://www.googleapis.com/auth/gmail.addons.current.message.metadata": {
"description": "View your email message metadata when the add-on is running"
},"https://www.googleapis.com/auth/gmail.insert": {
"description": "Insert mail into your mailbox"
}
}
}
我在此处附上了完整的发现文档,其中包含有效的一个和无效的一个:https://drive.google.com/drive/folders/12LWm_EKNeWenJWUeIJA8BRDrXjz27OYO?usp=sharing
请注意,当此缓存无效时,它可以正常工作并且API也可以。发生这种情况时,格式略有不同,那么Gmail是否可能正在尝试某些内容而偶尔发生这种情况?