None of the provided servers is under the root origin

I am currently encountering an issue while attempting to integrate with an external API that necessitates specifying a port in its URL structure. The API I’m working with follows this format: https://[api_uri]:[port]. However, I’m facing a persistent error:

None of the provided servers is under the root origin https://[api_uri]

This error arises despite the fact that the API’s URL correctly includes the port number. Interestingly, when I apply the same operation to a different service that defaults to port 5000, everything functions as expected. This leads me to believe that the issue lies in specifying a non-standard port in the API connection.

For resolution, I need guidance on correctly incorporating the port number into the “servers” section of my OpenAPI Schema. This inclusion is crucial for the API to recognize and accept the specified port in the URL.

Could you please provide assistance or insights on how to properly format the OpenAPI Schema to accommodate this requirement?

Thank you for your attention to this matter.

It occurs due to the url field under servers. The url needs to be a https protocol and not http protocol. In your case you have defined the url as a http protocol.

In case you do not have a https protocol, you can get SSL certificate from Let’s Encrypt and then use it to allow https protocol to communicate.

Just to note, the SSL certificate is only issued to a domain name and not IP address. So here first you need to get a domain name, link it to the server, then get SSL certificate using Let’s Encrypt, and then replace the http url via https.

Hope this helps!