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:
parent
055a646047
commit
9a73269895
5 changed files with 66 additions and 31 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue