mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 23:50:26 +01:00
remove postParamHook
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
ec26f879cb
commit
7566179798
1 changed files with 7 additions and 10 deletions
|
|
@ -8,26 +8,19 @@ class Config:
|
|||
def hooks_generator(self, queryParameterJson=True):
|
||||
# https://stackoverflow.com/questions/34820064/defining-an-api-with-swagger-get-call-that-uses-json-in-parameters/45223964
|
||||
if queryParameterJson:
|
||||
# ["parameters"][0]["content"]["application/json"]["schema"]
|
||||
getParamHook = AddParametersOnContent(
|
||||
split=-1,
|
||||
contentType="application/json",
|
||||
ignoreKeys=["queryId"],
|
||||
)
|
||||
postParamHook = AddParametersOnParameters(
|
||||
split=-1,
|
||||
schemaType=None,
|
||||
)
|
||||
else:
|
||||
# ["parameters"][0]["schema"]
|
||||
getParamHook = AddParametersOnParameters(
|
||||
split=-1,
|
||||
schemaType="string",
|
||||
ignoreKeys=["queryId"],
|
||||
)
|
||||
postParamHook = AddParametersOnBody(
|
||||
split=-1,
|
||||
schemaType=None,
|
||||
contentType="application/json",
|
||||
)
|
||||
|
||||
return {
|
||||
"openapi": [AddSecuritySchemesOnSecuritySchemes()],
|
||||
|
|
@ -45,7 +38,11 @@ class Config:
|
|||
key: [
|
||||
SetResponsesHeader(suffix=None),
|
||||
AddPathQueryIdOnParameters(split=-1),
|
||||
postParamHook,
|
||||
AddParametersOnBody(
|
||||
split=-1,
|
||||
schemaType=None,
|
||||
contentType="application/json",
|
||||
),
|
||||
]
|
||||
for key in ["post"]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue