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: dynamically detect namespace #83

Merged
merged 10 commits into from
Sep 11, 2024
Merged

feat: dynamically detect namespace #83

merged 10 commits into from
Sep 11, 2024

Conversation

mikewuu
Copy link
Contributor

@mikewuu mikewuu commented Sep 10, 2024

closes #18

Previously namespace was just parts[1], which isn't technically correct. This PR tries to determine the namespace of a route path by examining all the routes, and seeing if there are endpoints at a given path.

  • Keeps /acs namespace as expected
  • Removes namespace from /foos correctly
  • Verified that nested namespaces work in 5067c79, but reverted to avoid polluting test fixtures.

@mikewuu mikewuu requested a review from a team as a code owner September 10, 2024 14:03
Copy link

vercel bot commented Sep 10, 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 Sep 11, 2024 1:19pm

@razor-x
Copy link
Member

razor-x commented Sep 10, 2024

avoid polluting test fixtures.

@mikewuu What does this mean? Let's add at least one namespace to the test fixture, e.g., /air/planes/get or whatever you like.

@mikewuu
Copy link
Contributor Author

mikewuu commented Sep 10, 2024

Just that it isn't required for the other stuff so it ends up generating too much.

But sure, will add some fixtures for this case 👍

@mikewuu mikewuu force-pushed the namespace-detection branch from b8ff2d9 to 7cc9bc7 Compare September 11, 2024 13:19
@mikewuu mikewuu merged commit 08692e3 into main Sep 11, 2024
19 checks passed
@mikewuu mikewuu deleted the namespace-detection branch September 11, 2024 13:21
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.

Add namespace detection for routes containing no endpoints
3 participants