mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 07:30:37 +01:00
fix error schema
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
162ad96a13
commit
28e49c7ddb
9 changed files with 90 additions and 199 deletions
|
|
@ -211,6 +211,15 @@ if __name__ == "__main__":
|
|||
task_callback(file, thread=False)
|
||||
logger.info(f"Match rate: {rate}")
|
||||
|
||||
for file in glob.glob("other/**/*.json", recursive=True):
|
||||
with open(file, "r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
try:
|
||||
_ = pt.Errors.from_dict(data)
|
||||
except Exception as e:
|
||||
error_dump(e)
|
||||
|
||||
api_conf = pt.Configuration(
|
||||
api_key={
|
||||
"ClientLanguage": "en",
|
||||
|
|
@ -345,6 +354,13 @@ if __name__ == "__main__":
|
|||
res = pt.TweetApi(api_client).get_tweet_detail_with_http_info(**kwargs)
|
||||
data = res.data.to_dict()
|
||||
|
||||
save_cache(
|
||||
{
|
||||
"raw": res.raw_data.decode("utf-8"),
|
||||
"type": res.data.__class__.__name__,
|
||||
}
|
||||
)
|
||||
|
||||
rate = match_rate(
|
||||
data,
|
||||
json.loads(res.raw_data),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue