Skip to content

Commit c939c4f

Browse files
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.
1 parent dae02c8 commit c939c4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/hoppscotch-common/src/types/pre-request.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,10 @@ declare namespace hopp {
275275
setUrl(url: string): void
276276
setMethod(method: string): void
277277
setHeader(name: string, value: string): void
278-
setHeaders(headers: HoppRESTHeader[]): void
278+
setHeaders(headers: Array<Partial<HoppRESTHeader>>): void
279279
removeHeader(key: string): void
280280
setParam(name: string, value: string): void
281-
setParams(params: HoppRESTParam[]): void
281+
setParams(params: Array<Partial<HoppRESTParam>>): void
282282
removeParam(key: string): void
283283
/**
284284
* Set or update request body with automatic merging

0 commit comments

Comments
 (0)