HttpApiEndpoint: static path and wildcard (/*) path with the same prefix are treated as duplicate routes
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- TypeScript
- 星标
- 16.7k
- 派生
- 808
- 平均合并
- 20 小时 31 分钟
- 30 天内合并 PR
- 733
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Effect-TS/effect 的其他 Issue
-
ai-amazon-bedrock: a tool result that isn't a JSON object fails the next request可能已有人在做 @effect-bot 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 10/100
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
维护者通常 1 天内回复
-
Investigate Deno CI timeouts in JSDoc diagnostic tests可能已有人在做 @haranishi 今天认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
-
`HttpClient.withRateLimiter`: let `RateLimiterError` be handled as an `HttpClientError`可能已有人在做 @effect-bot 于 2 天前认领。 未关闭enhancement
Effect-TS/effect#10697 · 已指派 1 人 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
solidjs/solid-docs#1716 ·
维护者通常 1 天内回复
-
bug needs-triage
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Progress indicated by console logs is off by one可能已有人在做 @marceliwac 今天认领。 未关闭bug needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
aws-samples/aws-cdk-examples#1336 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
melgarafael/DeskcommCRM#4999 · 1 条评论 ·
维护者通常 1 天内回复
-
type: bug
难度 2/5 1-3 小时 新手友好度 78/100
nrwl/nx#37955 · 1 个 reaction ·
维护者通常 2 天内回复