1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 15:40:26 +01:00

fix error schema

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2024-09-29 18:08:58 +09:00
parent 162ad96a13
commit 28e49c7ddb
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
9 changed files with 90 additions and 199 deletions

View file

@ -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),