HttpApiEndpoint: static path and wildcard (/*) path with the same prefix are treated as duplicate routes
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 16.7k
- Fork
- 808
- Merge medio
- 20h 31m
- PR unite (30g)
- 733
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Effect-TS/effect
-
ai-amazon-bedrock: a tool result that isn't a JSON object fails the next requestForse già presa @effect-bot l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 10/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
Investigate Deno CI timeouts in JSDoc diagnostic testsForse già presa @haranishi l’ha presa oggi. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
`HttpClient.withRateLimiter`: let `RateLimiterError` be handled as an `HttpClientError`Forse già presa @effect-bot l’ha presa 2 giorni fa. Apertaenhancement
Effect-TS/effect#10697 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Effect-TS/effect
Issue simili
-
type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
db-ux-design-system/core-web#8856 ·
I maintainer di solito rispondono entro 1 giorno
-
'!' breaking change is lost when the commit also has an empty BREAKING CHANGE footerForse già presa @wittdennis l’ha presa oggi. Apertapriority: p3 type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
googleapis/release-please#2971 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 87/100
I maintainer di solito rispondono entro 1 giorno
-
🛠️ dette technique
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
betagouv/mon-entreprise#4752 · 1 commento ·
I maintainer di solito rispondono entro 5 giorni