Open matleppa opened 6 years ago
API address (via proxy). The base URL for swagger is formed using API address. The request is sent to API address.
API: https://nightly.apinf.io/apis/aaa2-new-api
The API address
The Base URL is formed of the location, from where the documentation was loaded. Erroneous
The request is sent to address, from where the documentation was loaded, not to API address. Erronous
API: https://nightly.apinf.io/apis/aaa-new-api
The API is located on Nightly.
The documentation is linked from another server (here Staging). The Base URL for swagger is formed based on documentation location. The requests from swagger are sent to address, from where the documentation was linked, not to API address.
@matleppa it isn't obviously what doesn't work correctly in screens. Write expected/actual result for each one
And if you test it on nightly/staging/production then provide a link to API
The requests from swagger are sent to address, from where the documentation was linked, not to API address.
Actually, it works as expected. Why does it have to request to API address? I don't understand.
My understanding is, that the point of using swagger documentation is ability to test the API functionality: The swagger UI builds the request message, sends it and displays the response, either successful or unsuccessful.
If the request message is not sent to API address, how can user verify API functionality?
that the point of using swagger documentation is ability to test the API functionality
In the case then API is connected to Proxy.
@kyyberi What do you think?
What I'm saying is that Swagger should send the request to same API address, which is visible on API card, on tab Details, so it is either APIs own address or the proxy address. Nevertheless, the request should be sent to API, not to address of documentation.
This would be fixed simultaneously when the other documentation related changes are made in the Merged Next branch. Iceboxing for the time being.
Background
When a swagger document is added as a documentation on API card, there is automatically formed Base URL for swagger, which is used, when swagger generates call for methods.
API is connected to a proxy
The base URL for swagger is same as the proxy base path. OK functionality: This means, that when requests are sent using swagger document, they are correctly targeted to the API.
API is not connected to a proxy
The base URL for swagger is formed depending on the documentation address. Erronous functionality: In this case the requests sent with swagger are targeted to HTTP address, from where the documentation was loaded, not to API address.
Conclusion
The Base URL for swagger should always be same as the API address, so the method calls are sent to the API in question.