diff --git a/frontend/src/lib/components/ArgInput.svelte b/frontend/src/lib/components/ArgInput.svelte index 8fb31363a1..7e63876cdd 100644 --- a/frontend/src/lib/components/ArgInput.svelte +++ b/frontend/src/lib/components/ArgInput.svelte @@ -166,7 +166,7 @@ {/if} {#if editableSchema} -
+
{ diff --git a/frontend/src/lib/components/ObjectResourceInput.svelte b/frontend/src/lib/components/ObjectResourceInput.svelte index af648cba99..dd1f14f6cb 100644 --- a/frontend/src/lib/components/ObjectResourceInput.svelte +++ b/frontend/src/lib/components/ObjectResourceInput.svelte @@ -34,7 +34,11 @@ } function resourceToValue() { - value = `$res:${path}` + if (path) { + value = `$res:${path}` + } else { + value = undefined + } } function isResource() { diff --git a/frontend/src/lib/components/StringTypeNarrowing.svelte b/frontend/src/lib/components/StringTypeNarrowing.svelte index 8306b24b15..81b43b11f6 100644 --- a/frontend/src/lib/components/StringTypeNarrowing.svelte +++ b/frontend/src/lib/components/StringTypeNarrowing.svelte @@ -70,7 +70,6 @@ ['None', 'none'], ['File (base64)', 'base64'], ['Enum', 'enum'], - ['Resource Path', 'resource'], ['Format', 'format'], ['Pattern', 'pattern'] ]} diff --git a/frontend/src/lib/infer.ts b/frontend/src/lib/infer.ts index c2550ca3f1..5fbdf88e38 100644 --- a/frontend/src/lib/infer.ts +++ b/frontend/src/lib/infer.ts @@ -67,7 +67,6 @@ function argSigToJsonSchemaType( oldS: SchemaProperty ): void { - const newS: SchemaProperty = { type: '', description: '' } if (t === 'int') { newS.type = 'integer' @@ -128,4 +127,7 @@ function argSigToJsonSchemaType( } } Object.assign(oldS, newS) + if (oldS.format?.startsWith('resource-') && newS.type != 'object') { + oldS.format = undefined + } } diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts index d006ff423c..d48ae66d50 100644 --- a/frontend/src/lib/utils.ts +++ b/frontend/src/lib/utils.ts @@ -464,8 +464,6 @@ export function setInputCat( return 'yaml' } else if (type == 'string' && contentEncoding == 'base64') { return 'base64' - } else if (type == 'string' && format?.startsWith('resource')) { - return 'resource-string' } else { return 'string' }