fix python type inference

This commit is contained in:
Ruben Fiszel
2023-02-05 14:09:21 +01:00
parent 40858875b1
commit 1579b61157
5 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -166,7 +166,7 @@
<FieldHeader {label} {required} {type} {contentEncoding} {format} {itemsType} />
{/if}
{#if editableSchema}
<div class="my-1 text-xs border-solid border border-gray-400">
<div class="p-2 my-1 text-xs border-solid border border-gray-400">
<span
class="underline"
on:click={() => {
@@ -34,7 +34,11 @@
}
function resourceToValue() {
value = `$res:${path}`
if (path) {
value = `$res:${path}`
} else {
value = undefined
}
}
function isResource() {
@@ -70,7 +70,6 @@
['None', 'none'],
['File (base64)', 'base64'],
['Enum', 'enum'],
['Resource Path', 'resource'],
['Format', 'format'],
['Pattern', 'pattern']
]}
+3 -1
View File
@@ -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
}
}
-2
View File
@@ -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'
}