Skip to content

[apiKey] auth by two apikey together(AND Operation) #2586

@wang-sy

Description

@wang-sy

I want to use two filed together, like :

  • X-Api-Key: apiKey.
  • X-Real-IP: clientIP.

So I write:

apiKeyAuth:
  name: X-Api-Key
  type: apiKey
  in: header
apiKeyAuthClientIP:
  name: X-Real-IP
  type: apiKey
  in: header

security:
  - apiKeyAuth: []
    apiKeyAuthClientIP: []

but the generated function is :

APIKeyAuthAuth func(string) (*identity.LoginRes, error)
APIKeyAuthClientIP func(string) (*identity.LoginRes, error)

I expect to get code Like this :

func APIKeyAuth(apiKey, clientIP string) (*identity.LoginRes, error) {}

what can I do ? I use swagger 2.0, openAPI 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions