From c939c4f0c83e2de2ef44b0b3782cb3adb5b66805 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com> Date: Fri, 31 Oct 2025 11:17:14 +0530 Subject: [PATCH] fix(common): update request headers/params setter method types to accept partial objects The runtime schema uses .catch() fallbacks for all fields (`key`, `value`, `active`, `description`), making them effectively optional at runtime. Updated type definitions to use Partial<> to match actual runtime behavior and prevent type errors in usage. This allows valid usage patterns like: `` hopp.request.setHeaders([{ key: "X-Custom", value: "foo" }]) ``` Without requiring all fields (`active`, `description`) to be explicitly provided. --- packages/hoppscotch-common/src/types/pre-request.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hoppscotch-common/src/types/pre-request.d.ts b/packages/hoppscotch-common/src/types/pre-request.d.ts index 50de8bbf..7b781631 100644 --- a/packages/hoppscotch-common/src/types/pre-request.d.ts +++ b/packages/hoppscotch-common/src/types/pre-request.d.ts @@ -275,10 +275,10 @@ declare namespace hopp { setUrl(url: string): void setMethod(method: string): void setHeader(name: string, value: string): void - setHeaders(headers: HoppRESTHeader[]): void + setHeaders(headers: Array>): void removeHeader(key: string): void setParam(name: string, value: string): void - setParams(params: HoppRESTParam[]): void + setParams(params: Array>): void removeParam(key: string): void /** * Set or update request body with automatic merging