Aias00 opened a new issue, #7923: URL: https://github.com/apache/shenyu/issues/7923
## Goal Reduce manual configuration of Agent Gateway HTTP tools by generating supported tool plans from an OpenAPI definition and explicitly selected existing ShenYu HTTP routes. Import should produce a reviewable plan and explain unsupported operations before any configuration is published. ## Existing capability and distinction Master `87c22dde7` already contains: - [SwaggerImportServiceImpl.importMcpConfig](https://github.com/apache/shenyu/blob/87c22dde7/shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/SwaggerImportServiceImpl.java), which imports tool registrations for the existing MCP-server flow. - [AgentGatewayHttpToolConfig](https://github.com/apache/shenyu/blob/87c22dde7/shenyu-common/src/main/java/org/apache/shenyu/common/dto/AgentGatewayHttpToolConfig.java), which accepts explicitly named, bounded GET/POST HTTP tool plans. - The Agent Gateway HTTP dispatch/registry path introduced by #7572. This proposal targets generation of **Agent Gateway httpTools plans** and their rule permission bindings, not a second copy of the existing MCP-server Swagger importer or a new HTTP dispatch engine. ## MVP scope 1. Accept a supplied OpenAPI JSON document, reusing the existing parsing infrastructure where practical. Remote URL import, if included, must reuse the established import-fetch policy. 2. Select a namespace, existing gateway routes and operations; require an explicit method/path mapping. Do not infer backend-only paths as gateway routes. 3. Generate stable suggested tool names/descriptions, the currently supported inputSchema subset, requestTemplate and argsPosition; reconcile these names with the rule's allowedTools. 4. Start with literal GET/POST routes and supported flat scalar query/JSON-body arguments. Produce a per-operation unsupported report for path templates, arrays/nested schemas, unsupported constraints/media types, header/cookie parameters, ambiguous names and other unrepresentable mappings. Do not silently flatten, discard constraints or invent a weaker contract. 5. Preview additions/updates/removals and name collisions against startup-local, remote and configured HTTP tool namespaces. Publish only explicitly selected valid plans through existing Admin configuration APIs. 6. Make repeated import of the same source/mapping idempotent. Preserve explicitly managed/manual configuration, and require a visible deletion plan for operations removed from the source. ## Acceptance criteria - [ ] Generated plans pass both the Admin rule validator and gateway AgentGatewayHttpToolConfig parser. - [ ] Supported OpenAPI versions and schema subset are documented and tested; unsupported operations cannot silently become enabled tools. - [ ] Required/optional scalar parameters, GET query values, POST query/body values, reserved characters and UTF-8 are preserved end to end. - [ ] Query/body name collisions, duplicate operation IDs, invalid tool names and existing-provider collisions have actionable diagnostics. - [ ] Preview/generation does not publish configuration or expose every imported operation automatically. - [ ] Re-import, manual edits, source removals and namespace isolation have defined behavior. - [ ] Tests verify generated tools through the ordinary gateway routing chain, including final upstream URI and JSON result handling. The current HTTP tool path restrictions and private-header/session semantics remain authoritative. Extending that execution contract is a separate decision, not something the importer should bypass. Coordinate relevant integration fixes such as #7909 rather than reproducing their implementation in the generator. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
