Skip to content

Commit 05ec124

Browse files
committed
Status Codes
1 parent f9a564a commit 05ec124

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/effect/HTTPAPI.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ curl -H "X-API-Key: 1234567890" -H "X-Request-ID: 1234567890" http://localhost:3
922922

923923
The server validates these headers against the declared schema before handling the request.
924924

925-
### Status Codes (TODO: does this work?)
925+
### Status Codes
926926

927927
By default, the success status code is `200 OK`. You can change it by annotating the schema with a custom status.
928928

@@ -945,7 +945,8 @@ const Api = HttpApi.make("MyApi")
945945
HttpApiGroup.make("Users")
946946
.add(
947947
HttpApiEndpoint.get("getUsers", "/users", {
948-
success: Schema.Array(User) // how to set the status code?
948+
success: Schema.Array(User)
949+
.annotate({ httpApiStatus: 206 })
949950
})
950951
)
951952
)

0 commit comments

Comments
 (0)