diff --git a/packages/platform-bun/examples/http-client.ts b/packages/platform-bun/examples/http-client.ts index 57fcdb7afe..eeaab80b82 100644 --- a/packages/platform-bun/examples/http-client.ts +++ b/packages/platform-bun/examples/http-client.ts @@ -29,7 +29,7 @@ const makeTodoService = Effect.gen(function*() { HttpClient.mapRequest(HttpClientRequest.prependUrl("https://jsonplaceholder.typicode.com")) ) - const addTodoWithoutIdBody = HttpClientRequest.schemaBody(TodoWithoutId) + const addTodoWithoutIdBody = HttpClientRequest.schemaBodyJson(TodoWithoutId) const create = (todo: TodoWithoutId) => addTodoWithoutIdBody( HttpClientRequest.post("/todos"), diff --git a/packages/platform-node/examples/http-client.ts b/packages/platform-node/examples/http-client.ts index 773edb4125..abcaf80891 100644 --- a/packages/platform-node/examples/http-client.ts +++ b/packages/platform-node/examples/http-client.ts @@ -34,7 +34,7 @@ const makeTodoService = Effect.gen(function*() { HttpClient.mapRequest(HttpClientRequest.prependUrl("https://jsonplaceholder.typicode.com")) ) - const addTodoWithoutIdBody = HttpClientRequest.schemaBody(TodoWithoutId) + const addTodoWithoutIdBody = HttpClientRequest.schemaBodyJson(TodoWithoutId) const create = (todo: TodoWithoutId) => addTodoWithoutIdBody( HttpClientRequest.post("/todos"), diff --git a/packages/platform/src/HttpClientRequest.ts b/packages/platform/src/HttpClientRequest.ts index ea522eea6d..39f6485d72 100644 --- a/packages/platform/src/HttpClientRequest.ts +++ b/packages/platform/src/HttpClientRequest.ts @@ -337,13 +337,13 @@ export const bodyUnsafeJson: { * @since 1.0.0 * @category combinators */ -export const bodySchema: ( +export const schemaBodyJson: ( schema: Schema.Schema, options?: ParseOptions | undefined ) => { (body: A): (self: HttpClientRequest) => Effect.Effect (self: HttpClientRequest, body: A): Effect.Effect -} = internal.bodySchema +} = internal.schemaBodyJson /** * @since 1.0.0 diff --git a/packages/platform/src/internal/httpClientRequest.ts b/packages/platform/src/internal/httpClientRequest.ts index 47cab8991a..9ed4683f55 100644 --- a/packages/platform/src/internal/httpClientRequest.ts +++ b/packages/platform/src/internal/httpClientRequest.ts @@ -455,7 +455,7 @@ export const bodyFileWeb = dual< >(2, (self, file) => setBody(self, internalBody.fileWeb(file))) /** @internal */ -export const bodySchema = (schema: Schema.Schema, options?: ParseOptions | undefined): { +export const schemaBodyJson = (schema: Schema.Schema, options?: ParseOptions | undefined): { ( body: A ): (self: ClientRequest.HttpClientRequest) => Effect.Effect