feat: add OpenAPI and Smithy model gateway target types#516
Merged
aidandaly24 merged 2 commits intomainfrom Mar 9, 2026
Merged
feat: add OpenAPI and Smithy model gateway target types#516aidandaly24 merged 2 commits intomainfrom
aidandaly24 merged 2 commits intomainfrom
Conversation
Add support for openApiSchema and smithyModel as new gateway target types, enabling users to auto-derive tools from an OpenAPI JSON spec or Smithy JSON model. Schema: - Add SchemaSourceSchema Zod type (inline local file or S3 URI) - Add schemaSource field to AgentCoreGatewayTargetSchema with superRefine validation - Update LLM-compacted schema CLI: - Add --schema and --schema-s3-account flags to add gateway-target command - Add validation for schema-based targets (JSON-only, file existence, S3 URI format) - Add createSchemaBasedGatewayTarget() primitive method - Add SchemaBasedTargetConfig to discriminated union type TUI: - Add SchemaBasedTargetConfig to AddGatewayTargetConfig union - Add openApiSchema/smithyModel to TARGET_TYPE_OPTIONS - Add schema-based branch in AddGatewayTargetFlow Tests: - Add SchemaSourceSchema and AgentCoreGatewayTargetSchema unit tests - Add discriminated union narrowing tests for SchemaBasedTargetConfig - Add integration tests for OpenAPI/Smithy lifecycle, S3 URI, cross-account, and validation errors
Contributor
Coverage Report
|
aidandaly24
previously approved these changes
Mar 9, 2026
Contributor
aidandaly24
left a comment
There was a problem hiding this comment.
two nit comments but other than that I think this looks clean and good to me.
…rgets Mirror CDK schema validation: openApiSchema/smithyModel targets should reject toolDefinitions (tools are auto-derived) and apiGateway config.
aidandaly24
approved these changes
Mar 9, 2026
Contributor
aidandaly24
left a comment
There was a problem hiding this comment.
thanks for making the updates approved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
openApiSchemaandsmithyModelas new gateway target types, enabling users to auto-derive tools from an OpenAPI JSON spec or Smithy JSON model--schemaflag (accepts local.jsonfile path ors3://URI) and--schema-s3-accountflag for cross-account S3 accessSchemaSourceSchemaZod type,SchemaBasedTargetConfigdiscriminated union variant,createSchemaBasedGatewayTarget()primitive method, and CLI validationChanges
src/schema/schemas/mcp.ts):SchemaSourceSchema(inline/S3),schemaSourcefield onAgentCoreGatewayTargetSchema, superRefine rulessrc/cli/commands/add/validate.ts): JSON-only enforcement, file existence check, S3 URI format validationsrc/cli/primitives/GatewayTargetPrimitive.ts):--schema/--schema-s3-accountflags,createSchemaBasedGatewayTarget()methodsrc/cli/tui/screens/mcp/types.ts):SchemaBasedTargetConfigin discriminated union, newTARGET_TYPE_OPTIONSAddGatewayTargetFlow.tsx): Branch for schema-based targetsUsage
Test plan
Related