From 06feabb6782acb8641bda82108754e9feb568a7a Mon Sep 17 00:00:00 2001 From: yupix Date: Sat, 3 Feb 2024 00:48:22 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E3=82=B5=E3=83=9D=E3=83=BC=E3=83=88?= =?UTF-8?q?=E3=81=97=E3=81=A6=E3=81=AA=E3=81=84=E3=82=82=E3=81=AE=E3=81=8C?= =?UTF-8?q?needToWork=E3=81=AB=E3=81=AA=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compiler/update_api_status.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/update_api_status.py b/compiler/update_api_status.py index 957c5ec..9f58209 100644 --- a/compiler/update_api_status.py +++ b/compiler/update_api_status.py @@ -66,9 +66,10 @@ for path in api['paths']: # 既存のデータから削除することで残りはremovedにする del _endpoints["endpoints"]['support'][path] - # ハッシュが変更されている場合はneedToWorkにする、ハッシュの設定前にやらないとハッシュが変更されてるか分からない - if current_request_body_hash != old_data['request_body_hash'] or current_response_body_hash != old_data['response_body_hash']: - endpoints["endpoints"]['support'][path]['status'] = "needToWork" + if endpoints["endpoints"]['support'][path]['status'] == "supported": + # ハッシュが変更されている場合はneedToWorkにする、ハッシュの設定前にやらないとハッシュが変更されてるか分からない + if current_request_body_hash != old_data['request_body_hash'] or current_response_body_hash != old_data['response_body_hash']: + endpoints["endpoints"]['support'][path]['status'] = "needToWork" # ハッシュが変更されているかどうかを確認する if current_request_body_hash != old_data['request_body_hash']: @@ -111,7 +112,7 @@ for schema in api['components']['schemas']: } else: current_hash = get_sha256_hash(api['components']['schemas'][schema]) - if current_hash != old_data['hash']: + if current_hash != old_data['hash'] and endpoints['schemas'][schema]['status'] == "supported": print(f"{COLORS.green}[CHANGED: SCHEMA] changed schema hash {COLORS.reset} {schema} {COLORS.reset}") endpoints['schemas'][schema]['hash'] = current_hash endpoints['schemas'][schema]['status'] = "needToWork"