From 2a057ac1114beb7f7e4030aa40efe7807fe08304 Mon Sep 17 00:00:00 2001 From: Jesse Turner Date: Tue, 28 Apr 2026 16:56:38 +0000 Subject: [PATCH] fix(import): remove resourceName/executionRoleArn co-variance refine The refine required both fields to be set together, but resourceName is always needed on import (to preserve the AWS name) while executionRoleArn is only present when the gateway has a custom role. Gateways without a custom role (service auto-creates one) fail the refine because resourceName is set but executionRoleArn is not. Keep the individual field validations (GatewayNameSchema for resourceName, regex for executionRoleArn). --- src/schema/schemas/mcp.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/schema/schemas/mcp.ts b/src/schema/schemas/mcp.ts index 90c634b2..aa5a28bd 100644 --- a/src/schema/schemas/mcp.ts +++ b/src/schema/schemas/mcp.ts @@ -615,11 +615,7 @@ export const AgentCoreGatewaySchema = z message: 'customJwtAuthorizer configuration is required when authorizerType is CUSTOM_JWT', path: ['authorizerConfiguration'], } - ) - .refine(data => (data.resourceName !== undefined) === (data.executionRoleArn !== undefined), { - message: 'resourceName and executionRoleArn must be set together (import) or both omitted (fresh gateway)', - path: ['resourceName'], - }); + ); export type AgentCoreGateway = z.infer;