mirror of
https://github.com/n8n-io/n8n.git
synced 2026-10-17 05:29:44 +02:00
fix(API): Allow extendsCredential in workflow create/update (#39243)
Co-authored-by: Uddish Verma <uddish.verma@n8n.io> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
9bda02122d
commit
9e7bc6691c
|
|
@ -73,6 +73,18 @@ describe('CreateWorkflowPublicDto', () => {
|
|||
expect(result.success).toBe(true);
|
||||
});
|
||||
|
||||
test('accepts node.extendsCredential but ignores it', () => {
|
||||
const result = CreateWorkflowPublicDto.safeParse({
|
||||
...validPayload,
|
||||
nodes: [{ ...validPayload.nodes[0], extendsCredential: 'datadogApi' }],
|
||||
});
|
||||
|
||||
expect(result.success).toBe(true);
|
||||
if (result.success) {
|
||||
expect(result.data.nodes[0]).not.toHaveProperty('extendsCredential');
|
||||
}
|
||||
});
|
||||
|
||||
test.each([
|
||||
['accepts', 155, true],
|
||||
['rejects', 156, false],
|
||||
|
|
|
|||
|
|
@ -51,10 +51,13 @@ const workflowNodeWritePublicSchema = z
|
|||
.object({ tag: z.array(customTelemetryTagPublicSchema).optional() })
|
||||
.strict()
|
||||
.optional(),
|
||||
// Accepted but ignored, this is an internal editor-produced marker for credential-only HTTP Request nodes
|
||||
extendsCredential: z.string().optional(),
|
||||
createdAt: readOnlyPublicSchema(readOnlyTimestampOpenApi),
|
||||
updatedAt: readOnlyPublicSchema(readOnlyTimestampOpenApi),
|
||||
})
|
||||
.strict();
|
||||
.strict()
|
||||
.transform(({ extendsCredential: _extendsCredential, ...node }) => node);
|
||||
|
||||
const workflowNodeGroupWritePublicSchema = z
|
||||
.object({
|
||||
|
|
|
|||
|
|
@ -124,6 +124,8 @@ requestBody:
|
|||
- value
|
||||
additionalProperties: false
|
||||
additionalProperties: false
|
||||
extendsCredential:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
|
|
|||
|
|
@ -141,6 +141,8 @@ requestBody:
|
|||
- value
|
||||
additionalProperties: false
|
||||
additionalProperties: false
|
||||
extendsCredential:
|
||||
type: string
|
||||
createdAt:
|
||||
type: string
|
||||
format: date-time
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user