Swagger 如何为每个请求添加sessionToken查询参数?
要使用API,用户需要进行身份验证,将SESSIONID cookie添加到浏览器中,该cookie将用于请求+sessionToken查询参数 我如何告诉Swagger每个请求都需要一个sessionToken查询参数?我可以添加一个全局查询参数吗Swagger 如何为每个请求添加sessionToken查询参数?,swagger,openapi,Swagger,Openapi,要使用API,用户需要进行身份验证,将SESSIONID cookie添加到浏览器中,该cookie将用于请求+sessionToken查询参数 我如何告诉Swagger每个请求都需要一个sessionToken查询参数?我可以添加一个全局查询参数吗 openapi: 3.0.0 # 1) Define the key name and location components: securitySchemes: ApiKeyAuth: # arbitrary nam
openapi: 3.0.0
# 1) Define the key name and location
components:
securitySchemes:
ApiKeyAuth: # arbitrary name for the security scheme
type: apiKey
in: query # can be "header", "query" or "cookie"
name: sessionToken # name of the header, query parameter or cookie
# 2) Apply the API key globally to all operations
security:
- ApiKeyAuth: [] # use the same name as under securitySchemes
可能重复的是,它是重复的。我没有看到你对另一个问题的回答