Insomnia: [Improvement] OpenAPI/Swagger import does not import securityDefinitions

Created on 3 Oct 2019  ยท  4Comments  ยท  Source: Kong/insomnia

  • Insomnia Version: 7.0.0

Details

In Swagger/OpenAPI you can defined how users should authenticate against your API. You may add multiple of those messures, but with insomnia none are added. Below there are examples for v2 and v3 which work like expeced with the Swagger Preview for VS but not with insomnia.

The v2.0 example addes two messures with both beeing mandatory, while the v3.0 example addes two which would be fine if one of them is provided.

V2.0 example:

swagger: "2.0"
info:
  title: API Title
  version: "1.0"
host: test.invalid
basePath: /
schemes:
  - https
paths:
  /test:
    get:
      responses:
        "200":
          description: OK

security:
  - API-Key: []
    basic: []

securityDefinitions:
  API-Key:
    type: apiKey
    name: x-rest-key
    in: header
  basic:
    type: basic

v3.0 Example:

openapi: '3.0.2'
info:
  title: API Title
  version: '1.0'
servers:
  - url: https://api.server.test/v1

components:
  securitySchemes:
    API-Key:
      type: apiKey
      name: x-api_key
      in: header
    basic:
      type: http
      scheme: basic

security:
  - basic: []
  - API-Key: []

paths:
  /test:
    get:
      responses:
        '200':
          description: OK
accepted good first issue

All 4 comments

๐Ÿ‘‹ Thanks for opening your first issue! If you're reporting a ๐Ÿž bug, please make sure
you include steps to reproduce it. If you're requesting a feature ๐ŸŽ, please provide real
use cases that would benefit. ๐Ÿ‘ช

To help make this a smooth process, please be sure you have first read the
contributing guidelines.

I changed this from "bug" to "improvement" since it was never implemented in the first place. This seems like a good thing to support ๐Ÿ‘

Is this issue closed by #1725 and #1724?

Ya I think we can close this for now. Not all security types were implemented but we should create separate issues for new ones going forward

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tmaiaroto picture tmaiaroto  ยท  4Comments

wimdecorte picture wimdecorte  ยท  3Comments

shadeglare picture shadeglare  ยท  3Comments

Natfan picture Natfan  ยท  3Comments

isobit picture isobit  ยท  4Comments