-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Base path is lost when replacing path params #337
Comments
🎉 This issue has been resolved in version @api-ts/express-wrapper@1.0.12 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version @api-ts/superagent-wrapper@1.1.7 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version @api-ts/typed-express-router@1.0.9 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
Thanks! |
🎉 This issue has been resolved in version @api-ts/io-ts-http@2.1.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version @api-ts/response@2.0.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version @api-ts/openapi-generator@1.0.6 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
When path params get replaces, we loose any base path that was set in the base url.
https://github.com/BitGo/api-ts/blob/master/packages/superagent-wrapper/src/request.ts#L79-L90
For example, if the base is
http://localhost/foo
and the route path is/bar
The url pathname contains
/foo
at the beginning and after replacing the params in/foo
the/bar
part is lost.That means that if all our endpoints have a common base param we can pass it in the base URL and we need to add it to every route.
Could we just concatenate the result of
substitutePathParams
tourl.pathname
instead of replacing it?The text was updated successfully, but these errors were encountered: