From bd99948811f6055581fbeecc17727654f5c418f8 Mon Sep 17 00:00:00 2001 From: LOPES Daniel Date: Fri, 20 Feb 2026 18:12:48 +0100 Subject: [PATCH] Allow undefined fields on JsonObject --- skiplang/skjson/ts/binding/src/index.ts | 2 +- skipruntime-ts/helpers/src/external.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/skiplang/skjson/ts/binding/src/index.ts b/skiplang/skjson/ts/binding/src/index.ts index 67b08c177..877d69663 100644 --- a/skiplang/skjson/ts/binding/src/index.ts +++ b/skiplang/skjson/ts/binding/src/index.ts @@ -167,7 +167,7 @@ export type Json = /** * Objects containing `Json` values. */ -export type JsonObject = { readonly [key: string]: Json | null }; +export type JsonObject = { readonly [key: string]: Json | null | undefined }; export type Exportable = | null diff --git a/skipruntime-ts/helpers/src/external.ts b/skipruntime-ts/helpers/src/external.ts index baba24dd9..1c8f60b20 100644 --- a/skipruntime-ts/helpers/src/external.ts +++ b/skipruntime-ts/helpers/src/external.ts @@ -16,6 +16,7 @@ export function defaultParamEncoder(params: Json): string { if (typeof params == "object") { const queryParams: { [param: string]: string } = {}; for (const [key, value] of Object.entries(params)) { + if (value === undefined) continue; if (typeof value == "object") queryParams[key] = JSON.stringify(value); else queryParams[key] = value.toString(); }