Skip to content

Commit ad0ee58

Browse files
fix(import): remove resourceName/executionRoleArn co-variance refine (#996)
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 ad0ee58

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)