You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't really know how to explain this issue. If an OpenAPI document has a server set to "/" then gorillamux router CANNOT find a route for a request. If an OpenAPI document has a server set to a single variable and that variable's default value is "/" then the gorillamux router CAN find a route for a request. It seems to me that these two server values should be the same when it comes to finding routes.
I figured out the issue. There is a bug in the way routers/gorillamux/router.go handles a openapi3.Server that contains a single variable and nothing more.
Here are the two test cases:
{server} <--- this is the case that was failing
http://{server}
The purpose of the makeServers function is to evaluate a openapi3.Server, process its variables, if any, then build an instance of srv with the processed data. Previously these two cases used different code to build the srv instance. The fix was to make both these cases use the same code for building the srv instance.
slessard
changed the title
inconsistent handling of server values in gorillamux routing
inconsistent processing of server variables in gorillamux router
Dec 16, 2022
I don't really know how to explain this issue. If an OpenAPI document has a server set to "/" then gorillamux router CANNOT find a route for a request. If an OpenAPI document has a server set to a single variable and that variable's default value is "/" then the gorillamux router CAN find a route for a request. It seems to me that these two server values should be the same when it comes to finding routes.
This issue is demonstrated in PR #705
Can you help me understand why these two test cases do not work the same?
The text was updated successfully, but these errors were encountered: