HttpApiEndpoint: static path and wildcard (/*) path with the same prefix are treated as duplicate routes
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
What version of Effect is running?
4.1.4
What steps can reproduce the bug?
Declare two GET endpoints in the same group, one with a static path and one with a wildcard under the same prefix:
import { HttpApi, HttpApiEndpoint, HttpApiGroup } from "effect/httpapi"
const Group = HttpApiGroup.make("test").add(
HttpApiEndpoint.get("test-static", "/test"),
HttpApiEndpoint.get("test-wildcard", "/test/*")
)
const Api = HttpApi.make("api").add(Group)
Then build and serve the API (e.g. via HttpApiBuilder.layer(Api) with handlers for both endpoints). The failure appears at runtime when the routes are registered.
What is the expected behavior?
Both endpoints register successfully. /test and /test/* are different route patterns, and many routers treat them as distinct:
GET /test→test-staticGET /test/anything→test-wildcard
What do you see instead?
error: Method 'GET' already declared for route '/test'
Additional information
- The two endpoints have different names and different path patterns, so this doesn't look like a genuine duplicate declaration.
- It looks like the router treats
/test/*as also matching/test(or normalizes the wildcard away), so the second registration collides with the first. - If that is intended behavior, it would help to have it documented, and ideally to have a supported way to register both a static route and a wildcard route under the same prefix.
- Ngôn ngữ chính
- TypeScript
- Star
- 16.7k
- Fork
- 808
- Merge trung bình
- 20 giờ 31 phút
- Pull request đã merge (30 ngày)
- 733
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Effect-TS/effect
-
ai-amazon-bedrock: a tool result that isn't a JSON object fails the next requestCó thể đã có người làm @effect-bot đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 10/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Investigate Deno CI timeouts in JSDoc diagnostic testsCó thể đã có người làm @haranishi đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
`HttpClient.withRateLimiter`: let `RateLimiterError` be handled as an `HttpClientError`Có thể đã có người làm @effect-bot đã nhận 2 ngày trước. Đang mởenhancement
Effect-TS/effect#10697 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Effect-TS/effect
Issue tương tự
-
type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
db-ux-design-system/core-web#8856 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footerCó thể đã có người làm @wittdennis đã nhận hôm nay. Đang mởpriority: p3 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
googleapis/release-please#2971 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày
-
🛠️ dette technique
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 61/100
betagouv/mon-entreprise#4752 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 5 ngày