We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cde86cc commit 7cb7c14Copy full SHA for 7cb7c14
.changeset/flat-moons-greet.md
@@ -3,3 +3,28 @@
3
---
4
5
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