Skip to content
This repository has been archived by the owner on May 15, 2023. It is now read-only.

Multiple apiKey security parameters #122

Open
jamesabc opened this issue Oct 5, 2016 · 1 comment
Open

Multiple apiKey security parameters #122

jamesabc opened this issue Oct 5, 2016 · 1 comment

Comments

@jamesabc
Copy link

jamesabc commented Oct 5, 2016

I have the following valid swagger.yaml:

paths:
  /assets:
    get:
      tags:
        - Assets
      summary: Returns base paths for asset files
      security:
        - ClientVersion: []
        - ClientApiKey: []
        - ApiVersion: []
      responses:
        '200':
          description: Assets Paths
          schema:
            $ref: '#/definitions/AssetsResponse'

Almost every request to my API uses the same 3 headers, so I found it reduced boilerplate a lot to specify them in securityDefinitions.

It may not be the best way, as I am new to swagger, so I am open to advice if you know of a better way to achieve this, but at the same time, given that this is syntactically valid in swagger, it is a problem that only the first item in the security list is sent to the template as data.headerApiKey (line 115 of index.js), and the rest are ignored.

@Remco75
Copy link
Contributor

Remco75 commented Oct 6, 2016

well, I don't think it is a very nice way to send headers (they are not all security headers), but you already said that yourself :-)
That being said: I can imagine more that one security header needed, so looping over the security array seems ok. But we will need to think about naming, and rendering them in the templates.

That would make only feasible after we do #117

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants