auth0,在securityDefinitions.auth0上获取Schema错误

时间:2017-05-25 08:48:39

标签: swagger auth0

使用auth0时,我在swagger编辑器上出现此错误

Schema error at securityDefinitions.auth0
is not exactly one from <#/definitions/basicAuthenticationSecurity>,<#/definitions/apiKeySecurity>,<#/definitions/oauth2ImplicitSecurity>,<#/definitions/oauth2PasswordSecurity>,<#/definitions/oauth2ApplicationSecurity>,<#/definitions/oauth2AccessCodeSecurity>
Jump to line 67

我的.yaml文件就像:

securityDefinitions:
  auth0:
    type: oauth2
    authorizationUrl: https://domain.auth0.com/authorize
    flow: implicit
    tokenName: id_token
    scopes:
      openid: Grant access to user
  apiKey:
    type: apiKey
    name: api-key
    in: query
  apiKey1:
    type: apiKey
    name: api-key
    in: header

我错过了什么?

1 个答案:

答案 0 :(得分:0)

删除tokenName - 它不是受支持的字段。

检查规范以查看securityDefinitions中允许的字段: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#securitySchemeObject