Import from Swagger

Hello.
Please help me. I have a strange problem when I try to import endpoints from Swagger. If my project is started on my local system I can import collection from 127.0.0.1 well. When my project is worked on test server in our vpn network I can’t import collection by the link - I always get error “Something went wrong with the server” but when I’m openning link and copy JSON and past it to Postman my collection is imported fine.
I create video with this process https://youtu.be/hTt5fUBVyp4
I don’t have any idea about reasons this behavior.

Hi @benzol45 !

Thanks for reaching out and thank you for the detailed video to help troubleshoot this :slight_smile:

Based on what you’ve shared, here are a few possible solutions:

  1. Access Restrictions: It’s possible that your test server behind the VPN has some kind of access control, firewall, or CORS restrictions that prevent direct access from Postman’s import functionality. This would explain why manually copying the JSON works (as your browser has access to the server) but direct import doesn’t.
  2. DNS Resolution: If the test server uses a domain name (instead of an IP address) specific to your internal network, make sure that the domain is resolvable from the machine you are using. Sometimes internal domain names can’t be resolved outside the VPN.
  3. SSL/TLS Issues: If your test server uses HTTPS, ensure that the SSL/TLS certificate is valid and recognized. Postman might refuse connections to servers with untrusted certificates. This can be a common issue with internal test servers that use self-signed certificates.

Potential Solutions:

  1. Allowlist Postman: If there’s a firewall or access control mechanism, you may need to allowlist Postman to ensure it can reach the Swagger endpoint.
  2. SSL/TLS Settings: If it’s an SSL issue, you can try turning off SSL certificate verification in Postman. Go to Settings → General → and turn SSL certificate verification to OFF. But remember to turn it back on later; it’s generally a good practice to have it enabled.
  3. Manual Import: As you mentioned, copying the JSON and importing it manually works. While not ideal, it’s a valid workaround if the direct import continues to be problematic.
  4. Check Postman Console: Open the Postman console (View → Show Postman Console) before trying the import. It might show more detailed error messages that can help diagnose the problem.
  5. Network Proxy: If you have a network proxy configured for your VPN, you might need to adjust Postman’s proxy settings (Settings → Proxy).

If after trying these solutions you still face issues, it would be beneficial to reach out to your IT or network team. They might have more insights into potential network restrictions.

Hope this helps! Let me know if you need further help :slight_smile:

I think I have the same issue (Is it possible to create a collection from an OpenAPI document OAS 2.0 or OAS 3.0?)… I didn’t realize it immediately because I don’t see any error message as I mentioned but now I can see that I can import an OAS document generated from localhost but not one published on a public server

1 Like

Thanks. I also saw this that I can import locally quite by accident. I’ll subscribe to your topic, maybe we can get sollution.

Thanks a lot.

I tried to solve it:

  1. We don’t have any controls or firewall. I tried to use “curl {my_address}” and get correctly JSON without browser
  2. I used directly IP
  3. We don’t use HTTPS, only HTTP

And I tried to follow your sollutions:
disable SSL verification - didn’t have any results
console was absolutelly clean, maybe I must enable logging in any way ?

If you have any ideas I’m ready to try them and send results.
Thanks for you help.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.