Insomnia: Openapi3 spec with empty item in security schema fails to import

Created on 13 May 2020  ·  4Comments  ·  Source: Kong/insomnia

Describe the bug
I can't import a Json OpenApi file.

To Reproduce
Hello,

I have an OpenApi Json file that generate an error when I try to import it in Insomnia Designer.
This file can be opened in Swgger Editor and this editor does not report any problem.
Here is the error message I have when I try to import the json file :
`
Import Failed
TypeError:
result.summary[_models_WEBPACK_IMPORTED_MODULE_11__.workspace.type]

Import failed
Cannot read property 'type' of undefined
`

For confidentiality reasons I cannot publish this JSON file here but I can send it to you by email.
Expected behavior
The file should be imported.

Desktop (please complete the following information):

  • Windows 10 Professional Version 10.0.18363 Number 18363
  • Installation via your website
  • App Version [e.g. v7.0.3]
accepted bug packaginsomnia-importers

All 4 comments

Hi @hervehobbes! If you toggle devtools, do you see any errors in the console?

That is unfortunately a fairly generic error (it's on the radar to improve the error output) - to help diagnose, could you please flick an email through to [email protected] with that specification and I or someone from the team will take a look. ☺️

Hello,

Thank you very much for your answer.
Here is the error message I have from the console:

[ErrorModal] Cannot read property 'type' of undefined

And:

[ga] Event Modals, Show, ErrorModal

Ok for the email, it is going to be send now.

Bye

To summarize, the following case is not handled by the openapi3 importer. I'll update the issue title to reflect this. 😄 The following is a snippet from a fixture test within the codebase.

openapi: '3.0.2'
info:
  title: Endpoint Security
  version: '1.2'
servers:
  - url: https://api.server.test/v1

components:
  securitySchemes:
    Basic:
      type: http
      scheme: basic

paths:
  /none/basic:
    get:
      security:
        - {}        # causes failure
        - Basic: []
      responses:
        '200':
          description: OK

Hello,

Thank you for your help ans answer.
I have a route that can be used with and without authentication, that's why
it is written like that.

Thanks again and bye,
Hervé

Le jeu. 14 mai 2020 à 01:58, Opender Singh notifications@github.com a
écrit :

To summarize, the following case is not handled by the openapi3 importer.
I'll update the issue title to reflect this. 😄

openapi: '3.0.2'
info:

title: Endpoint Security

version: '1.2'
servers:

components:

securitySchemes:

Basic:

  type: http

  scheme: basic

paths:

/none/basic:

get:

  security:

    - {}      # causes failure

    - Basic: []

  responses:

    '200':

      description: OK


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Kong/insomnia/issues/2167#issuecomment-628307081, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AAA4VM6DW7M462U6JL7LKGTRRMX3LANCNFSM4M7PHM6A
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oliverjanik picture oliverjanik  ·  3Comments

dextermb picture dextermb  ·  3Comments

chrisvis picture chrisvis  ·  4Comments

claratorres picture claratorres  ·  3Comments

shadeglare picture shadeglare  ·  3Comments