[GH-ISSUE #4557] [bug]: "Error while importing: format not recognized" when import OpenApi json from URL #1675

Open
opened 2026-03-16 21:21:30 +03:00 by kerem · 3 comments
Owner

Originally created by @VTrngNghia on GitHub (Nov 25, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4557

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

  1. This is not a duplicate of Issue 3796. That issue is about json file, this is about URL.
  2. Workaround: If I download the URL into a JSON file, then HoppScotch imports just fine. It only fails when importing from URL.

My local service generates OpenAPI docs on a local-deployed URL: http://localhost:8183/elastic-searcher/api-docs
Here's what it looks like

{
  "openapi": "3.0.1",
  "info": {
    "title": "Elastic Searcher",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "http://localhost:8183/elastic-searcher",
      "description": "Generated server url"
    }
  ],
...
}

Steps to reproduce

  1. Click on Import/Export
  2. Click on Import from OpenAPI
  3. Click on Import from URL
  4. Use the URL http://localhost:8183/elastic-searcher/api-docs

Environment

Release

Version

Cloud

Originally created by @VTrngNghia on GitHub (Nov 25, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4557 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior 1. This is not a duplicate of [Issue 3796](https://github.com/hoppscotch/hoppscotch/issues/3796). That issue is about json file, this is about URL. 2. Workaround: If I download the URL into a JSON file, then HoppScotch imports just fine. It only fails when importing from URL. My local service generates OpenAPI docs on a local-deployed URL: `http://localhost:8183/elastic-searcher/api-docs` Here's what it looks like ``` { "openapi": "3.0.1", "info": { "title": "Elastic Searcher", "version": "1.0" }, "servers": [ { "url": "http://localhost:8183/elastic-searcher", "description": "Generated server url" } ], ... } ``` ### Steps to reproduce 1. Click on `Import/Export` 2. Click on `Import from OpenAPI` 3. Click on `Import from URL` 4. Use the URL `http://localhost:8183/elastic-searcher/api-docs` ### Environment Release ### Version Cloud
Author
Owner

@liyasthomas commented on GitHub (Dec 2, 2024):

We're looking into the issue and will provide updates soon. Thanks for your patience and understanding.

<!-- gh-comment-id:2511913772 --> @liyasthomas commented on GitHub (Dec 2, 2024): We're looking into the issue and will provide updates soon. Thanks for your patience and understanding.
Author
Owner

@EmperorArthur commented on GitHub (Feb 24, 2025):

I experienced this same issue. Here are my findings:

  1. Despite the error message, Chrome's console windows shows the request failing because of CORS.
  • Please update the error message for this case.
  1. This is despite having the website in the browser extension's origins list.
<!-- gh-comment-id:2679092413 --> @EmperorArthur commented on GitHub (Feb 24, 2025): I experienced this same issue. Here are my findings: 1. Despite the error message, Chrome's console windows shows the request failing because of CORS. * Please update the error message for this case. 2. This is despite having the website in the browser extension's origins list.
Author
Owner

@yevheniidehtiar commented on GitHub (Mar 19, 2025):

Had the same issue. In my case it was resource that only available behind proxy.
If it has issue by importing from URL - first try to download openapi.json and import it as file.

But I would agree error description is indeed wrong and gives false positive thoughts about the root cause.
Would be nice to explicit error message for cases, when remote url response is not 200 and content-type not application/json or any similar solution.

<!-- gh-comment-id:2736012305 --> @yevheniidehtiar commented on GitHub (Mar 19, 2025): Had the same issue. In my case it was resource that only available behind proxy. If it has issue by importing from URL - first try to download openapi.json and import it as file. But I would agree error description is indeed wrong and gives false positive thoughts about the root cause. Would be nice to explicit error message for cases, when remote url response is not 200 and content-type not application/json or any similar solution.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1675
No description provided.