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
Both swagger definition and express already configured to use the /api basePath, but the swagger middleware bypass it by calling next() because the api.getPath return undefined in swagger-node-runner/lib/connect_middleware.js
Now in the api.getPath, the pathOrReq.url here is returning only the sub path. In this case the pathOrReq.url = '/resource' instead of '/api/resource'. Therefore the regexp and isArray return false.
I suggest we use pathOrReq.originalUrl instead of pathOrReq.url since originalUrl is the full path url.
The text was updated successfully, but these errors were encountered:
swagger-node needs to be updated to call api.getPath appropriately so that the url property of the object passed to the API has the proper value. Sway will never have code in it that is server framework aware and as people write integrations that use Sway, it is their responsibility to make a Sway API call that will work.
I have this URL format:
domain.com/api/resource
The baseUrl defined in swagger.yaml is
/api
The express configured so that the /api is just a sub-app:
The
SwaggerMiddleware
is then added into apiApp.Both swagger definition and express already configured to use the
/api
basePath, but the swagger middleware bypass it by callingnext()
because theapi.getPath
return undefined inswagger-node-runner/lib/connect_middleware.js
Now in the
api.getPath
, the pathOrReq.url here is returning only the sub path. In this case thepathOrReq.url = '/resource'
instead of'/api/resource'
. Therefore theregexp
andisArray
return false.I suggest we use
pathOrReq.originalUrl
instead ofpathOrReq.url
sinceoriginalUrl
is the full path url.The text was updated successfully, but these errors were encountered: