Use workflow inputSchema to render boolean, number, and enum fields in code/logic function steps (#20439)
<img width="415" height="772" alt="Screenshot 2026-05-11 at 4 44 08 PM" src="https://github.com/user-attachments/assets/32dbdd3c-e60b-4c43-90bc-18be05f22dcf" /> <img width="414" height="371" alt="Screenshot 2026-05-11 at 4 48 24 PM" src="https://github.com/user-attachments/assets/83be062c-7ed3-4953-98bb-e4290865040b" />
This commit is contained in:
+27
@@ -81,4 +81,31 @@ describe('jsonSchemaToInputSchema', () => {
|
||||
enum: ['a', 'b'],
|
||||
});
|
||||
});
|
||||
|
||||
it('preserves multiline on string properties when true', () => {
|
||||
const result = jsonSchemaToInputSchema({
|
||||
type: 'object',
|
||||
properties: {
|
||||
body: { type: 'string', multiline: true },
|
||||
},
|
||||
});
|
||||
|
||||
expect(result[0].properties?.body).toEqual({
|
||||
type: 'string',
|
||||
multiline: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('does not set multiline when false or omitted', () => {
|
||||
const result = jsonSchemaToInputSchema({
|
||||
type: 'object',
|
||||
properties: {
|
||||
title: { type: 'string', multiline: false },
|
||||
other: { type: 'string' },
|
||||
},
|
||||
});
|
||||
|
||||
expect(result[0].properties?.title).toEqual({ type: 'string' });
|
||||
expect(result[0].properties?.other).toEqual({ type: 'string' });
|
||||
});
|
||||
});
|
||||
|
||||
@@ -15,4 +15,5 @@ export type InputJsonSchema = {
|
||||
additionalProperties?: boolean | InputJsonSchema;
|
||||
minimum?: number;
|
||||
maximum?: number;
|
||||
multiline?: boolean;
|
||||
};
|
||||
|
||||
@@ -46,6 +46,10 @@ const convertProperty = (jsonSchema: InputJsonSchema): InputSchemaProperty => {
|
||||
);
|
||||
}
|
||||
|
||||
if (jsonSchema.multiline === true) {
|
||||
property.multiline = true;
|
||||
}
|
||||
|
||||
return property;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user