From 3de1deeb8b1863d8eb6ddd8b32d132642350f40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Sat, 2 Nov 2024 04:43:38 +0900 Subject: [PATCH] fix create tweet schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/compatible/openapi-3.0.yaml | 2 -- dist/compatible_discriminator/openapi-3.0.yaml | 2 -- dist/docs/openapi-3.0.yaml | 2 -- tools/hooks.py | 3 ++- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/dist/compatible/openapi-3.0.yaml b/dist/compatible/openapi-3.0.yaml index 6f43414..e5b99a8 100644 --- a/dist/compatible/openapi-3.0.yaml +++ b/dist/compatible/openapi-3.0.yaml @@ -4431,7 +4431,6 @@ paths: example: false type: boolean required: - - media_entities - possibly_sensitive type: object reply: @@ -4461,7 +4460,6 @@ paths: - media - semantic_annotation_ids - dark_request - - disallowed_reply_options type: object required: - queryId diff --git a/dist/compatible_discriminator/openapi-3.0.yaml b/dist/compatible_discriminator/openapi-3.0.yaml index 445f2d3..1ed7851 100644 --- a/dist/compatible_discriminator/openapi-3.0.yaml +++ b/dist/compatible_discriminator/openapi-3.0.yaml @@ -4425,7 +4425,6 @@ paths: example: false type: boolean required: - - media_entities - possibly_sensitive type: object reply: @@ -4455,7 +4454,6 @@ paths: - media - semantic_annotation_ids - dark_request - - disallowed_reply_options type: object required: - queryId diff --git a/dist/docs/openapi-3.0.yaml b/dist/docs/openapi-3.0.yaml index 17d1270..2d810a3 100644 --- a/dist/docs/openapi-3.0.yaml +++ b/dist/docs/openapi-3.0.yaml @@ -4537,7 +4537,6 @@ paths: example: false type: boolean required: - - media_entities - possibly_sensitive type: object reply: @@ -4567,7 +4566,6 @@ paths: - media - semantic_annotation_ids - dark_request - - disallowed_reply_options type: object required: - queryId diff --git a/tools/hooks.py b/tools/hooks.py index ae05cc7..8f25df6 100644 --- a/tools/hooks.py +++ b/tools/hooks.py @@ -18,7 +18,8 @@ class HookBase: return x[:-1] if x.endswith("?") else x if isinstance(obj, dict): - req = {k: v for k, v in obj.items() if not k.endswith("?")} + ignore_req = [k[:-1] for k in obj.keys() if k.endswith("?")] + req = [k for k in obj.keys() if fn(k) not in ignore_req] properties = {fn(k): mine(v) for k, v in obj.items()} value = { "type": "object",