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

feat: add type error if path doesn't start with / #882

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

ad-world
Copy link
Contributor

@ad-world ad-world requested review from a team as code owners August 23, 2024 14:37
@@ -13,8 +13,10 @@ export const Method = t.keyof({

export type Method = t.TypeOf<typeof Method>;

export type PathString = `/${string}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm torn between whether this counts as a breaking change, or something more akin to "this was always intended and the previous behavior is a bug". I'm curious to hear what others think about this.

Copy link
Contributor Author

@ad-world ad-world Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would an endpoint even work if the path didn't didn't start with a /?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can test with superagent and express, but right now am assuming it is sort of undefined behavior and a leading / may be implicitly added

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose viewing that as undefined behavior is an argument against it being a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not opposed to marking this as a breaking change! I can add that to the commit msg if needed.

@bitgopatmcl bitgopatmcl requested review from a team August 23, 2024 15:36
@andrew-scott-fischer andrew-scott-fischer merged commit 64dc7af into master Aug 23, 2024
6 checks passed
Copy link

🎉 This PR is included in version @api-ts/[email protected] 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version @api-ts/[email protected] 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version @api-ts/[email protected] 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version @api-ts/[email protected] 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Copy link

🎉 This PR is included in version @api-ts/[email protected] 🎉

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 this pull request may close these issues.

3 participants