2017-08-30 86 views

回答

0
type: http 
scheme: basic 

是OpenAPI 3.0語法(您鏈接到的規範是OpenAPI 3.0)。

但是,你正在使用的OpenAPI 2.0,所以你需要使用:

securityDefinitions: 
    BasicAuth: 
    type: basic 

security: 
    - BasicAuth: [] 

這裏是OpenAPI的2.0規格:
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#securitySchemeObject

下面是2.0的基本身份驗證指南:
https://swagger.io/docs/specification/2-0/authentication/basic-authentication/

相關問題