在OpenAPI 3.0.0文档中,没有针对授权代码的流类型的示例代码。
这里唯一的代码仅用于隐式类型。
petstore_auth:
type: oauth2
flows:
implicit:
authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog'
scopes:
'write:pets': modify pets in your account
'read:pets': read your pets
如果有人知道这个概念,请提供 YAML 或 JSON 的示例。
答案 0 :(得分:2)
存在对authorizationCode流程的支持-我从规范http://spec.openapis.org/oas/v3.0.2.html#oauth-flows-object中读取了此代码,看起来您可以像这样用implicit
替换authorizationCode
:
flows:
authorizationCode:
authorizationUrl: https://example.com/api/oauth/dialog
tokenUrl: https://example.com/api/oauth/token
scopes:
write:pets: modify pets in your account
read:pets: read your pets