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

update hook

Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-05-05 19:35:31 +09:00
parent 055a646047
commit 9a73269895
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
5 changed files with 66 additions and 31 deletions

View file

@ -85,8 +85,14 @@ class ReplaceQueryIdPlaceholder(RequestHookBase):
class SetResponsesHeader(RequestHookBase):
prexix: str
def __init__(self, prexix: str = ""):
super().__init__()
self.prexix = prexix if prexix == "" else "_" + prexix
def hook(self, path: str, value: dict):
component = self.load_component("response_header")
component = self.load_component("response_header" + self.prexix)
value["responses"]["200"]["headers"] = component["components"]["headers"]
return path, value