2017-09-27 59 views
0

this document,我可以使用:扬鞭编辑和会话cookie

components: 
    securitySchemes: 
    cookieAuth: 
     type: apiKey 
     in: cookie 
     name: JSESSIONID 

要定义session cookie。但是,如果你去the editorin: "header"线577改变为in: "cookie",编辑与指责:

架构错误在securityDefinitions['api_key'].in应等于允许值ALLOWEDVALUES的 之一:headerquery

如何定义基于会话cookie的认证?

回答

1

Cookie身份验证是OpenAPI 3.0功能,OpenAPI 2.0不支持。您的规格是OpenAPI 2.0,如securityDefinitions所示。你不能混用2.0和3.0语法。您需要重写或将您的规范转换为OpenAPI 3.0格式。

也就是说,Swagger Editor和Swagger UI目前不支持OpenAPI 3.0规范的授权功能。检查OAS 3.0 Support Backlog的更新。