CORS error while importing collection from swagger (worked a couple of weeks ago)

Hello,
I have some projects that generate a swagger webpage and an openapi url that allows for import.
Until a couple of weeks ago, I was able to use the link with the import feature of postman to create a collection.

Today I tried the same thing but the only thing I get is the error toast at the bottom with Error while fetching data from link, nothing on the postman console, and from the devtools I see this error: Access to fetch at 'http://localhost:8080/[PROJECT NAME]/v3/api-docs' from origin 'https://desktop.postman.com' has been blocked by CORS policy: Request had no target IP address space, yet the resource is in address space local.

Since it started happening on all my projects and most of them had no change since september, I assume that something changed on postman?

Things I already tried:

  • Changing project (It’s not a problem related to a specific project)
  • Call the url directly from postman (it works)
  • Change machine (same problem reported also by teammates)

This is not a blocking problem since I can just copy the content from the url and paste it directly in the import but it was a useful feature…

Postman for Windows

Version11.27.4

UI version
11.27.4-ui-250109-2337

Desktop platform version
11.27.3

Architecture
x64

OS platform
win32 10.0.26100

2 Likes

I’m hitting the same issue. It was working fine just about a month ago.

What’s going on?

1 Like

Just encountered the same today. For something that has been working.

There is a workaround.

  1. Click on the link on the swagger docs page e.g. http://localhost:8000/api/docs/?format=openapi
  2. Copy the whole page content
  3. Click on “import” in Postman
  4. Instead of pasting the URL, paste the whole content

If you know where the autogenerated JSON file is you could also directly import the file in postman without the need for the web UI. This is STILL a workaround though…