Skip to content

Commit 2a057ac

Browse files
committed
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).
1 parent 2df1387 commit 2a057ac

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/schema/schemas/mcp.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,11 +615,7 @@ export const AgentCoreGatewaySchema = z
615615
message: 'customJwtAuthorizer configuration is required when authorizerType is CUSTOM_JWT',
616616
path: ['authorizerConfiguration'],
617617
}
618-
)
619-
.refine(data => (data.resourceName !== undefined) === (data.executionRoleArn !== undefined), {
620-
message: 'resourceName and executionRoleArn must be set together (import) or both omitted (fresh gateway)',
621-
path: ['resourceName'],
622-
});
618+
);
623619

624620
export type AgentCoreGateway = z.infer<typeof AgentCoreGatewaySchema>;
625621

0 commit comments

Comments
 (0)