Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/warm-hoops-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/platform": minor
---

The type of the HttpApi groups and endpoints are correctly inferred.
4 changes: 3 additions & 1 deletion packages/platform/src/HttpApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export interface HttpApi<
new(_: never): {}
readonly [TypeId]: TypeId
readonly identifier: Id
readonly groups: Record.ReadonlyRecord<string, Groups>
readonly groups: {
readonly [K in HttpApiGroup.HttpApiGroup.Name<Groups>]: HttpApiGroup.HttpApiGroup.WithName<Groups, K>
}
readonly annotations: Context.Context<never>
readonly errorSchema: Schema.Schema<E, unknown, R>
readonly middlewares: ReadonlySet<HttpApiMiddleware.TagClassAny>
Expand Down
4 changes: 3 additions & 1 deletion packages/platform/src/HttpApiGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ export interface HttpApiGroup<
readonly [TypeId]: TypeId
readonly identifier: Id
readonly topLevel: TopLevel
readonly endpoints: Record.ReadonlyRecord<string, Endpoints>
readonly endpoints: {
readonly [K in HttpApiEndpoint.HttpApiEndpoint.Name<Endpoints>]: HttpApiEndpoint.HttpApiEndpoint.WithName<Endpoints, K>
}
readonly errorSchema: Schema.Schema<Error, unknown, R>
readonly annotations: Context.Context<never>
readonly middlewares: ReadonlySet<HttpApiMiddleware.TagClassAny>
Expand Down