Forum Discussion

nmrao's avatar
nmrao
Champion Level 3
6 years ago

Unable to load swagger definition in Swagger Editor

Trying to load a local swagger definition 2.0 file in public swagger editor

 

However, does not respond when user selects the file and click on open file. Using chrome brower on ubuntu which was working some time ago.

  • nmrao's avatar
    nmrao
    6 years ago
    @HKosava,

    Installed docker image of Swagger Editor locally and able to proceed.
    Thank you once again for your time.
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi Rao,

     

    Sorry to hear you are having issues. Does the issue happen with a specific file or with any file (e.g. https://petstore.swagger.io/v2/swagger.yaml)? If this happens with a specific file, could you please attach it here or PM it to me?

     

    Also, which versions of Chrome and Ubuntu do you use?

     

    • nmrao's avatar
      nmrao
      Champion Level 3

      Have't tested others.

       

      Since that is public url, I believe most of the world might be accessing it and might have reported by some one.

       

      Have you tried any file or url and it worked on the same site (editor.swagger.io)?

  • nmrao's avatar
    nmrao
    Champion Level 3
    Thank you for looking into it and your time.
    • HKosova's avatar
      HKosova
      SmartBear Alumni (Retired)

      The issue might be Ubuntu-specific - which versions of Ubuntu and Chrome do you use? Could you please check if there are any errors on the Console tab in Chrome Developer Tools?

       

      I'm asking because file import works fine for me, but I'm using Chrome on Windows 7.


      I can only think of 2 cases where "Import URL" (not "Import File") may not work:

      1. Importing an HTTP (non-secure) URL into the HTTPS (secure) version of the editor. Browsers block HTTPS-to-HTTP requests for security reasons.
      2. The server that hosts the OpenAPI file does not support CORS, so the browser blocks cross-domain request from editor.swagger.io to that server.

      Both cases are caused by browser security restrictions, and the workaround is to save the file locally, and use the "File > Import File" instead of "File > Import URL".

      • nmrao's avatar
        nmrao
        Champion Level 3
        Thank you. I will check and get back.