Skip to content

Commit 7cb7c14

Browse files
committed
add changeset
1 parent cde86cc commit 7cb7c14

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.changeset/flat-moons-greet.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,28 @@
33
---
44

55
typecheck path components
6+
7+
```ts
8+
import { Schema } from "effect"
9+
import { HttpApiEndpoint } from "@effect/platform"
10+
11+
const endpoint = HttpApiEndpoint.get("findById", "/:id")
12+
/**
13+
* Type 'Struct<{}>' is not assignable to type
14+
* '["Missing path components:", "id"]'
15+
*/
16+
endpoint.setPath(Schema.Struct({}))
17+
18+
/**
19+
* Type 'Struct<{ id: typeof NumberFromString; id2: typeof NumberFromString; }>'
20+
* is not assignable to type
21+
* '["Redundant path components:", "id2" | "id3"]'.
22+
*/
23+
endpoint.setPath(
24+
Schema.Struct({
25+
id: Schema.NumberFromString,
26+
id2: Schema.NumberFromString,
27+
id3: Schema.NumberFromString
28+
})
29+
)
30+
```

0 commit comments

Comments
 (0)