如何使用 OpenApi 2.O 在 header 中将令牌和刷新令牌作为授权传递?

How to pass token and refresh token as Authorization in the header using OpenApi 2.O?

我是 OpenApi 的新手,我正在使用 Insomnia,我正在尝试通过 header但是 Header 名为 Accept、Content-Type 和 Authorization 的参数是不允许的,因此我必须为此目的使用安全方案,但是我应该使用哪种安全方案以及如何传递此结构(授权:{ header 中的“token”:“dehxsasn8478snsajsx”,“refreshToken”:“cddjnc5156”})让我发疯。这就是我正在尝试的..我知道这是错误的,但我被卡住了

securitySchemes:
    ApiKeyAuth:
        type: apiKey
        in: header
        name: Authorization
        content:
           application/json:
             schema:
               type: object
               properties:
                 token:
                   type: string
                   example: "ab"
                 refreshToken:
                   type: string
                   example: "djdjsn"

使用 apiKey 作为安全模式

securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization

并在路径中添加

security:
        - apiKey: []

并在header传球

{ "token": "dehxsasn8478snsajsx", "refreshToken": "cddjnc5156" }

作为字符串。