Forum Discussion

Kalle's avatar
Kalle
New Contributor
2 months ago

How to set Schemes default value to HTTPS

In the browser console I receive this when trying to identify my Swagger UI version:

JSON.stringify(versions)
'{"swaggerUI":{"version":"5.17.14","gitRevision":"g8aa52920","gitDirty":true,"buildTimestamp":"Tue, 28 May 2024 05:23:41 GMT"}}'

Looking in the UI it looks like a 3.x version

My question is as follows:

In the Swagger UI there is a field named Schemes. This field has the values HTTP and HTTPS but always defaults to HTTP and we manually have to set it to HTTPS before starting to use the tool.

How do I for the field Schemes permanently set the default value to be HTTPS?

We have a load balancer between the computer clients and the web server. The load balancer has the certificate and perform https offloading. The communication between the load balancer and the web servers is done with http.

Example how I want it to be can be seen at this web page https://petstore.swagger.io

Where you can see the field Schemes is set to HTTPS as default when accessing the page.

I've searched this forum and other sources trying to find the answer to this question without any luck. Any idea is much appreciated.

  • jonathanjone's avatar
    jonathanjone
    Occasional Contributor

    hey buddy,

    To set the default scheme value to HTTPS, especially when dealing with complex environments like AI PC systems, you can use SmartBear products like ReadyAPI or TestComplete to streamline and automate the process.

    If you're using ReadyAPI for your API testing, you can configure the base URL in the test configuration settings to always default to HTTPS. This ensures that every API call uses HTTPS as the default scheme, enhancing security—something crucial for applications running on AI PC, where sensitive data is often involved.

    Here’s how you can do it in ReadyAPI:

    1. Navigate to Project Settings.
    2. In the Default Base URL field, enter your HTTPS URL (e.g., https://example.com).
    3. This will ensure that all API requests within this project will default to HTTPS unless explicitly overridden in individual requests.

    For TestComplete, if you’re automating web testing for applications running on AI PCs, you can also set the base URL to always point to the HTTPS version of your application by scripting it or adjusting the settings in the project configuration.

    By using SmartBear's suite of tools, you're not only setting a secure default but also ensuring your AI-driven workflows and processes on PCs are thoroughly tested and safeguarded against vulnerabilities.

    • Kalle's avatar
      Kalle
      New Contributor

      Thanks for the reply. As written in my question I never mention that I use ReadyAPI, but that the question is regarding Swagger UI. If you have the answer for that product it would be much appreciated.