Skip to content
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

Closed
nicob21 opened this issue Dec 5, 2022 · 7 comments · Fixed by #380
Closed

Base path is lost when replacing path params #337

nicob21 opened this issue Dec 5, 2022 · 7 comments · Fixed by #380
Labels

Comments

@nicob21
Copy link

nicob21 commented Dec 5, 2022

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 to url.pathname instead of replacing it?

@github-actions
Copy link

🎉 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 📦🚀

@github-actions
Copy link

🎉 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 📦🚀

@github-actions
Copy link

🎉 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 📦🚀

@adrian-gierakowski
Copy link

Thanks!

@github-actions
Copy link

🎉 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 📦🚀

@github-actions
Copy link

🎉 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 📦🚀

@github-actions
Copy link

🎉 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 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants