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

fix: Create one endpoint per path, not per method #123

Merged
merged 9 commits into from
Oct 16, 2024

Conversation

andrii-balitskyi
Copy link
Contributor

@andrii-balitskyi andrii-balitskyi commented Oct 11, 2024

Closes #121

@andrii-balitskyi andrii-balitskyi requested a review from a team as a code owner October 11, 2024 11:45
Copy link

vercel bot commented Oct 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blueprint ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 14, 2024 4:44pm

@@ -909,7 +919,14 @@ export const getSemanticMethod = (methods: Method[]): Method => {
}

const priorityOrder: Method[] = ['PUT', 'PATCH', 'POST', 'GET', 'DELETE']
return methods.find((m) => priorityOrder.includes(m)) ?? 'POST'
Copy link
Contributor Author

@andrii-balitskyi andrii-balitskyi Oct 11, 2024

Choose a reason for hiding this comment

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

This seems to have been implemented incorrectly because the priority was defined by the passed methods, not by the priorityOrder.
However, now the tests are failing. Am I understanding this incorrectly?
If I'm right that there's a bug here, is the priorityOrder correct so that I could adjust the tests?

Copy link
Member

Choose a reason for hiding this comment

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

This does looks like a mistake 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@razor-x I change the priority method in this commit 8f9e78f to fix the tests, does it look right?

@andrii-balitskyi andrii-balitskyi marked this pull request as draft October 11, 2024 12:06
@andrii-balitskyi andrii-balitskyi changed the title Create one endpoint per path, not per method fix: Create one endpoint per path, not per method Oct 16, 2024
@andrii-balitskyi andrii-balitskyi merged commit fc79f4b into main Oct 16, 2024
21 checks passed
@andrii-balitskyi andrii-balitskyi deleted the one-endpoint-per-path branch October 16, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

There should be one endpoint per path, not per method
3 participants