AlexStocks commented on code in PR #933: URL: https://github.com/apache/dubbo-go-pixiu/pull/933#discussion_r3278890993
########## skills/pixiu-mcp-gateway/SKILL.md: ########## @@ -0,0 +1,309 @@ +--- +name: pixiu-mcp-gateway +description: Creates and validates dubbo-go-pixiu MCP gateway conf.yaml. Use for MCP server filters, tools/list, tools/call, Mcp-Session-Id, MCP auth, Nacos MCP registry, or exposing backend HTTP APIs as MCP tools. Do not use for LLM model proxying. +--- + +# pixiu-mcp-gateway + +## Purpose +Generate a complete or embeddable MCP gateway `conf.yaml` that exposes backend HTTP APIs as MCP tools. + +## When to use +- Use when: + - Exposing backend HTTP APIs as MCP tools through the Pixiu MCP gateway, in static or Nacos dynamic mode, or configuring resources/templates/prompts, OAuth/JWT protection, or Streamable HTTP/SSE. + +- Do not use for: + - LLM model proxying or implementing a new MCP-related filter. + +## Inputs + +<HARD-GATE> +Do not generate YAML, write code, create files, or take any implementation action until the user has provided all required inputs. This is a first principle. + +If any required input is missing, this turn must only ask for the missing fields in the current input group; do not generate examples, defaults, YAML, code, or final output. + +Even if configuration information seems inferable, obvious, or implied by context, you must still ask the user to confirm it. Do not proceed until the user confirms it. +</HARD-GATE> + +- Choose tool source (required): + - Required: + - `tool_mode`: `static` or `registry` + +- `listener` (required): + - Defaults: + - `address.socket_address.address: 0.0.0.0` + - `address.socket_address.port: 8888` + +- `route_config` (required): + - Defaults: + - `routes[].match.prefix: /mcp` + - `routes[].route.cluster: mcp-route` (route cluster name) + +- `dgp.filter.mcp.mcpserver` (required): + - Defaults: + - `config.endpoint: /mcp` + - `config.server_info.name: Pixiu MCP Server` + - `config.server_info.version: 1.0.0` + - `config.server_info.description: MCP Server powered by Apache Dubbo-go-pixiu` + - `config.server_info.instructions: Use the provided tools to interact with backend services.` + +- Static tools (required when `tool_mode: static`): + - Required: + - `tools[].name` + - `tools[].request.path` + - Endpoint under `static_resources.clusters[]` for each backend cluster referenced by a tool: + - `clusters[].endpoints[].socket_address.address` + - `clusters[].endpoints[].socket_address.port` + - Optional: + - `tools[].description` + - `tools[].args[]` + - Defaults (`tools[].cluster` and `clusters[].name` reference the same name; changing one requires changing the other): + - `tools[].cluster: mcp-backend` + - `clusters[].name: mcp-backend` + - `tools[].request.method: GET` + - `tools[].request.timeout: 30s` + - `tools[].args[].type: string` + +- Registry tools (required when `tool_mode: registry`): + - Required: + - `registries.nacos.address` + - Optional: + - `registries.nacos.group` + - `registries.nacos.namespace` + - `registries.nacos.username` + - `registries.nacos.password` + - Defaults: + - `adapters[].id: mcp-nacos` + - `adapters[].name: dgp.adapter.mcpserver` + - `registries.nacos.protocol: nacos` + - `registries.nacos.timeout: 5s` + - `registries.nacos.group: DEFAULT_GROUP` + +- `resources[]` (optional): + - Required: + - `resources[].name` + - `resources[].uri` + - `resources[].source.type` + - `resources[].source.content` Review Comment: [P1] `ResourceSource` 在代码里有 `path` / `url` / `content` / `template` 四种互斥来源,但这里把 `resources[].source.content` 写成了统一必填,会直接把 `file`、`url`、`template` 这三类合法配置都描述成不完整输入。这个不是文案小偏差,而是会把使用者带向错误 YAML。建议把必填项改成按 `resources[].source.type` 条件化。 ########## skills/pixiu-http-to-dubbo/SKILL.md: ########## @@ -1,399 +1,248 @@ --- name: pixiu-http-to-dubbo -description: | - Map a REST/HTTP endpoint onto a backend Dubbo service through - dubbo-go-pixiu. Use whenever the user wants to "expose Dubbo as HTTP", - "REST gateway for Dubbo", "Dubbo generic invoke", configure - `api_config.yaml`, `integrationRequest`, `mappingParams`, `mapType`, - `opt.types` / `opt.values`, group / version, or says "how do I call - my Dubbo service from curl". - Use this even when the user only asks to tweak an existing yaml route — - the combination of conf.yaml + api_config.yaml is where most "500 from - pixiu" reports come from, and this skill encodes the invariants. -allowed-tools: [Read, Grep, Glob, Edit, Write, Bash] -metadata: - version: "0.1.2" - domain: config - scope: generate-and-validate - triggers: ["http to dubbo", "REST to Dubbo", "Dubbo gateway", "api_config.yaml", "integrationRequest", "Dubbo generic invoke", "mappingParams", "mapType", "opt.types", "expose Dubbo as HTTP"] - pixiu_min_version: "0.6.0" - role: specialist +description: Creates and debugs dubbo-go-pixiu HTTP-to-Dubbo route YAML. Use for api_config.yaml/conf.yaml routes, direct Dubbo URLs, registry-backed Dubbo, mappingParams, mapType, parameterTypes, opt.types/opt.values, or generic-invoke errors. Do not use for non-Dubbo HTTP proxy routes or new registry adapter implementation. --- -# pixiu-http-to-dubbo — Wiring HTTP Clients to Dubbo Backends - -pixiu's bread and butter is "let a REST client call a Dubbo service". On -the surface it's two yaml files; underneath, you are configuring a -generic Dubbo invoke, and most failures come from the three-way mismatch -between the client request shape, the Dubbo interface signature, and -the mapping rules in between. - -## Two files, two jobs - -- **`conf.yaml`** (bootstrap) — wires the HTTP listener, enables the - `dgp.filter.httpconnectionmanager` network filter, and loads the - Dubbo registry adapter. You almost always keep this close to the - sample; changes are listener port, adapter type, and sometimes - cluster definitions. - In config answers, explicitly use canonical HCM Kind - `dgp.filter.httpconnectionmanager` (never - `dgp.filter.http.httpconnectionmanager`) and put - `dgp.filter.http.apiconfig` before `dgp.filter.http.dubboproxy` or - `dgp.filter.http.httpproxy` inside HCM `http_filters`. -- **`api_config.yaml`** — the per-endpoint mapping. One - `resources[].methods[]` entry per HTTP route. Every field except the - path comes from the Dubbo side; every mapping rule comes from the - HTTP side. - -This skill's job is to keep those two in sync. - -## When to Use - -Use this skill when the user wants to: -- Expose an existing Dubbo interface through HTTP (GET/POST/PUT/DELETE). -- Configure `integrationRequest` for an existing route. -- Fix a 500 / "generic invoke failed" / "no provider found" error that - points at a yaml route. -- Add parameter-name mapping (query → method param, body field → method - param, header → method param). -- Switch an existing HTTP proxy route to Dubbo backend. - -**Do NOT use this skill for:** -- Writing a new filter in the chain → `pixiu-filter-author`. -- Adding a new registry adapter for a non-standard service registry — - out of scope; the user will need to author the adapter directly - against `pkg/common/extension/adapter/adapter.go`. -- Pure yaml audit with no new HTTP-to-Dubbo route — out of scope. This - skill only validates the route/config fragments it generates or edits. - -## Prerequisites - -- pixiu ≥ 0.6.0. -- A Dubbo provider running somewhere reachable. The user must know the - interface FQCN, method name, Java method signature, and the Dubbo - `group` / `version`. -- Registry mode needs ZooKeeper/Nacos config under - `dgp.filter.http.dubboproxy.config.dubboProxyConfig.registries`. - Direct mode instead uses `integrationRequest.url` in `api_config.yaml` - and must also declare `parameterTypes` and `serialization`. - -## Steps - -### Step 0 — Verify Context - -1. Confirm pixiu version: `grep dubbo-go-pixiu go.mod`. -2. Locate existing config: typically `configs/conf.yaml` and - `configs/api_config.yaml` in the pixiu repo, or user-specified - paths. -3. Open `pkg/config/api_config.go` — that's the Go struct the yaml - actually binds to. Current `DubboBackendConfig` includes - `parameterTypes` and `serialization`; the legacy spelling - `paramTypes` is not the current field name. -4. Open `pkg/filter/http/remote/dubbo_handler.go`, - `pkg/client/dubbo/types.go`, `pkg/client/dubbo/typeconv.go`, and - `pkg/client/dubbo/dubbo.go` before editing mappings. Do not cite - legacy mapping helpers on branches where they no longer exist. -5. If the user says "Dubbo direct URL, no registry", use the current - direct generic contract: `integrationRequest.url` plus explicit - `protocol`, `parameterTypes`, and `serialization`. - -### Step 1 — Gather the Required Things (STOP and ask) - -You cannot write a valid `integrationRequest` without all applicable -items: - -1. **HTTP method + path**: `POST /api/v1/user`, etc. -2. **Dubbo interface FQCN**: e.g. `com.example.UserProvider`. -3. **Dubbo method name**: e.g. `createUser`. -4. **Java method signature**: e.g. - `User createUser(com.example.User user)` or - `Page<Order> search(String tenant, OrderQuery q)`. Translate each - argument into `parameterTypes` and supported pixiu `mapType` values - (`string`, `int`, `long`, `double`, `boolean`, `object`, etc.). -5. **Dubbo `group` and `version`**: empty strings are allowed but must - be explicit. -6. **Where each parameter comes from** on the HTTP side: `queryStrings. - <name>`, `requestBody.<path>`, `headers.<name>`, `uri.<name>`. -7. **Registry/direct mode**: ZK/Nacos registry, or direct URL. Registry - settings live in `conf.yaml`; direct provider address lives in - `integrationRequest.url`. -8. **Direct-call extras**: for direct URL mode, the declared protocol, - `parameterTypes`, and `serialization`. - -For POJO arguments, also ask whether the HTTP JSON body includes the -Dubbo/Hessian class discriminator the provider expects, usually a -`class` field such as `"class": "com.example.User"`. Pixiu can map the -argument as `object`, but it cannot infer every provider-side POJO FQCN -from a yaml field that the current config struct ignores. - -For primitives, collections, and nested POJOs, stay close to -`DubboHandler`, `typeconv.go`, and existing `api_config.yaml` examples -before finalizing `mappingParams`. - -If the user says "direct URL", "no registry", or gives a provider -address such as `10.0.0.8:20880`, keep the Dubbo route as -`integrationRequest.requestType: dubbo` and put the provider address in -`integrationRequest.url`. Direct generic invoke also requires -`parameterTypes` and `serialization`; without them Pixiu returns direct -generic validation errors before invoking the provider. - -Do NOT proceed until the required fields are answered. It is fine to propose -defaults and ask for confirmation — but **every field must be explicit -in the final yaml**. - -### Step 2 — Shape the `api_config.yaml` entry - -The template: +# pixiu-http-to-dubbo + +## Purpose +Generate a complete or embeddable `api_config.yaml`, and add the required companion `conf.yaml` fragments. + +## When to use +- Use when: + - Creating or modifying HTTP-to-Dubbo routes, including registry/direct mode switching, parameter mapping, type conversion, generic-invoke config, or debugging errors such as `no provider found`, `ClassNotFound`, empty responses, and signature mismatches. + +- Do not use for: + - New registry adapter implementation or non-Dubbo HTTP proxy routes. + +## Inputs + +<HARD-GATE> +Do not generate YAML, write code, create files, or take any implementation action until the user has provided all required inputs. This is a first principle. + +If any required input is missing, this turn must only ask for the missing fields in the current input group; do not generate examples, defaults, YAML, code, or final output. + +Even if configuration information seems inferable, obvious, or implied by context, you must still ask the user to confirm it. Do not proceed until the user confirms it. +</HARD-GATE> + +- Choose Dubbo provider mode (required): + - Required: + - `provider_mode`: `registry` or `direct` +- `listener` (required): + - Defaults: + - `address.socket_address.address: 0.0.0.0` + - `address.socket_address.port: 8888` +- `route_config` (required): + - Defaults: + - `routes[].match.prefix: /api/v1` + - `routes[].route.cluster: dubbo-route` +- `dgp.filter.http.apiconfig` (required): + - Defaults: + - `config.path: configs/api_config.yaml` + - `config.dynamic: false` +- `dgp.filter.http.dubboproxy` (required): + - Defaults: + - `dubboProxyConfig.timeout_config.connect_timeout: 5s` + - `dubboProxyConfig.timeout_config.request_timeout: 5s` + - `dubboProxyConfig.load_balance: roundrobin` + - `dubboProxyConfig.retries: "3"` +- `api_config.yaml` resource/method (required): + - Required: + - `resources[].path` + - `methods[].httpVerb` + - `integrationRequest.interface` + - `integrationRequest.method` + - Optional: + - `resources[].description` + - `integrationRequest.group` + - `integrationRequest.version` + - `integrationRequest.applicationName` + - `integrationRequest.clusterName` + - Defaults: + - `resources[].type: restful` + - `resources[].timeout: 1000ms` + - `methods[].enable: true` + - `methods[].timeout: 1000ms` + - `inboundRequest.requestType: http` + - `integrationRequest.requestType: dubbo` +- Dubbo method parameters (required when the method has parameters): + - Required: + - `mappingParams[]` (common usage: map `opt.values` and `opt.types`) + - `opt.values` (Dubbo generic invoke argument value list) + - `opt.types` (Java type list aligned with `opt.values`) Review Comment: [P1] 这里把 `opt.values` 和 `opt.types` 写成“只要 Dubbo 方法有参数就必填”,和实际运行时约束不一致。`DubboHandler` 明确把 positional `mappingParams[].mapTo: "0"/"1"...` 和 `opt.values` 判定为互斥,registry 模式还允许省略 `opt.types` 走类型推断。按这份 skill 生成配置,会把一部分本来合法的写法误导成非法。建议把这里改成二选一:要么走 positional `mappingParams`,要么走 `opt.values`/`opt.types`。 ########## skills/pixiu-http-to-dubbo/SKILL.md: ########## @@ -1,399 +1,248 @@ --- name: pixiu-http-to-dubbo -description: | - Map a REST/HTTP endpoint onto a backend Dubbo service through - dubbo-go-pixiu. Use whenever the user wants to "expose Dubbo as HTTP", - "REST gateway for Dubbo", "Dubbo generic invoke", configure - `api_config.yaml`, `integrationRequest`, `mappingParams`, `mapType`, - `opt.types` / `opt.values`, group / version, or says "how do I call - my Dubbo service from curl". - Use this even when the user only asks to tweak an existing yaml route — - the combination of conf.yaml + api_config.yaml is where most "500 from - pixiu" reports come from, and this skill encodes the invariants. -allowed-tools: [Read, Grep, Glob, Edit, Write, Bash] -metadata: - version: "0.1.2" - domain: config - scope: generate-and-validate - triggers: ["http to dubbo", "REST to Dubbo", "Dubbo gateway", "api_config.yaml", "integrationRequest", "Dubbo generic invoke", "mappingParams", "mapType", "opt.types", "expose Dubbo as HTTP"] - pixiu_min_version: "0.6.0" - role: specialist +description: Creates and debugs dubbo-go-pixiu HTTP-to-Dubbo route YAML. Use for api_config.yaml/conf.yaml routes, direct Dubbo URLs, registry-backed Dubbo, mappingParams, mapType, parameterTypes, opt.types/opt.values, or generic-invoke errors. Do not use for non-Dubbo HTTP proxy routes or new registry adapter implementation. --- -# pixiu-http-to-dubbo — Wiring HTTP Clients to Dubbo Backends - -pixiu's bread and butter is "let a REST client call a Dubbo service". On -the surface it's two yaml files; underneath, you are configuring a -generic Dubbo invoke, and most failures come from the three-way mismatch -between the client request shape, the Dubbo interface signature, and -the mapping rules in between. - -## Two files, two jobs - -- **`conf.yaml`** (bootstrap) — wires the HTTP listener, enables the - `dgp.filter.httpconnectionmanager` network filter, and loads the - Dubbo registry adapter. You almost always keep this close to the - sample; changes are listener port, adapter type, and sometimes - cluster definitions. - In config answers, explicitly use canonical HCM Kind - `dgp.filter.httpconnectionmanager` (never - `dgp.filter.http.httpconnectionmanager`) and put - `dgp.filter.http.apiconfig` before `dgp.filter.http.dubboproxy` or - `dgp.filter.http.httpproxy` inside HCM `http_filters`. -- **`api_config.yaml`** — the per-endpoint mapping. One - `resources[].methods[]` entry per HTTP route. Every field except the - path comes from the Dubbo side; every mapping rule comes from the - HTTP side. - -This skill's job is to keep those two in sync. - -## When to Use - -Use this skill when the user wants to: -- Expose an existing Dubbo interface through HTTP (GET/POST/PUT/DELETE). -- Configure `integrationRequest` for an existing route. -- Fix a 500 / "generic invoke failed" / "no provider found" error that - points at a yaml route. -- Add parameter-name mapping (query → method param, body field → method - param, header → method param). -- Switch an existing HTTP proxy route to Dubbo backend. - -**Do NOT use this skill for:** -- Writing a new filter in the chain → `pixiu-filter-author`. -- Adding a new registry adapter for a non-standard service registry — - out of scope; the user will need to author the adapter directly - against `pkg/common/extension/adapter/adapter.go`. -- Pure yaml audit with no new HTTP-to-Dubbo route — out of scope. This - skill only validates the route/config fragments it generates or edits. - -## Prerequisites - -- pixiu ≥ 0.6.0. -- A Dubbo provider running somewhere reachable. The user must know the - interface FQCN, method name, Java method signature, and the Dubbo - `group` / `version`. -- Registry mode needs ZooKeeper/Nacos config under - `dgp.filter.http.dubboproxy.config.dubboProxyConfig.registries`. - Direct mode instead uses `integrationRequest.url` in `api_config.yaml` - and must also declare `parameterTypes` and `serialization`. - -## Steps - -### Step 0 — Verify Context - -1. Confirm pixiu version: `grep dubbo-go-pixiu go.mod`. -2. Locate existing config: typically `configs/conf.yaml` and - `configs/api_config.yaml` in the pixiu repo, or user-specified - paths. -3. Open `pkg/config/api_config.go` — that's the Go struct the yaml - actually binds to. Current `DubboBackendConfig` includes - `parameterTypes` and `serialization`; the legacy spelling - `paramTypes` is not the current field name. -4. Open `pkg/filter/http/remote/dubbo_handler.go`, - `pkg/client/dubbo/types.go`, `pkg/client/dubbo/typeconv.go`, and - `pkg/client/dubbo/dubbo.go` before editing mappings. Do not cite - legacy mapping helpers on branches where they no longer exist. -5. If the user says "Dubbo direct URL, no registry", use the current - direct generic contract: `integrationRequest.url` plus explicit - `protocol`, `parameterTypes`, and `serialization`. - -### Step 1 — Gather the Required Things (STOP and ask) - -You cannot write a valid `integrationRequest` without all applicable -items: - -1. **HTTP method + path**: `POST /api/v1/user`, etc. -2. **Dubbo interface FQCN**: e.g. `com.example.UserProvider`. -3. **Dubbo method name**: e.g. `createUser`. -4. **Java method signature**: e.g. - `User createUser(com.example.User user)` or - `Page<Order> search(String tenant, OrderQuery q)`. Translate each - argument into `parameterTypes` and supported pixiu `mapType` values - (`string`, `int`, `long`, `double`, `boolean`, `object`, etc.). -5. **Dubbo `group` and `version`**: empty strings are allowed but must - be explicit. -6. **Where each parameter comes from** on the HTTP side: `queryStrings. - <name>`, `requestBody.<path>`, `headers.<name>`, `uri.<name>`. -7. **Registry/direct mode**: ZK/Nacos registry, or direct URL. Registry - settings live in `conf.yaml`; direct provider address lives in - `integrationRequest.url`. -8. **Direct-call extras**: for direct URL mode, the declared protocol, - `parameterTypes`, and `serialization`. - -For POJO arguments, also ask whether the HTTP JSON body includes the -Dubbo/Hessian class discriminator the provider expects, usually a -`class` field such as `"class": "com.example.User"`. Pixiu can map the -argument as `object`, but it cannot infer every provider-side POJO FQCN -from a yaml field that the current config struct ignores. - -For primitives, collections, and nested POJOs, stay close to -`DubboHandler`, `typeconv.go`, and existing `api_config.yaml` examples -before finalizing `mappingParams`. - -If the user says "direct URL", "no registry", or gives a provider -address such as `10.0.0.8:20880`, keep the Dubbo route as -`integrationRequest.requestType: dubbo` and put the provider address in -`integrationRequest.url`. Direct generic invoke also requires -`parameterTypes` and `serialization`; without them Pixiu returns direct -generic validation errors before invoking the provider. - -Do NOT proceed until the required fields are answered. It is fine to propose -defaults and ask for confirmation — but **every field must be explicit -in the final yaml**. - -### Step 2 — Shape the `api_config.yaml` entry - -The template: +# pixiu-http-to-dubbo + +## Purpose +Generate a complete or embeddable `api_config.yaml`, and add the required companion `conf.yaml` fragments. + +## When to use +- Use when: + - Creating or modifying HTTP-to-Dubbo routes, including registry/direct mode switching, parameter mapping, type conversion, generic-invoke config, or debugging errors such as `no provider found`, `ClassNotFound`, empty responses, and signature mismatches. + +- Do not use for: + - New registry adapter implementation or non-Dubbo HTTP proxy routes. + +## Inputs + +<HARD-GATE> +Do not generate YAML, write code, create files, or take any implementation action until the user has provided all required inputs. This is a first principle. + +If any required input is missing, this turn must only ask for the missing fields in the current input group; do not generate examples, defaults, YAML, code, or final output. + +Even if configuration information seems inferable, obvious, or implied by context, you must still ask the user to confirm it. Do not proceed until the user confirms it. +</HARD-GATE> + +- Choose Dubbo provider mode (required): + - Required: + - `provider_mode`: `registry` or `direct` +- `listener` (required): + - Defaults: + - `address.socket_address.address: 0.0.0.0` + - `address.socket_address.port: 8888` +- `route_config` (required): + - Defaults: + - `routes[].match.prefix: /api/v1` + - `routes[].route.cluster: dubbo-route` +- `dgp.filter.http.apiconfig` (required): + - Defaults: + - `config.path: configs/api_config.yaml` + - `config.dynamic: false` +- `dgp.filter.http.dubboproxy` (required): + - Defaults: + - `dubboProxyConfig.timeout_config.connect_timeout: 5s` + - `dubboProxyConfig.timeout_config.request_timeout: 5s` + - `dubboProxyConfig.load_balance: roundrobin` + - `dubboProxyConfig.retries: "3"` +- `api_config.yaml` resource/method (required): + - Required: + - `resources[].path` + - `methods[].httpVerb` + - `integrationRequest.interface` + - `integrationRequest.method` + - Optional: + - `resources[].description` + - `integrationRequest.group` + - `integrationRequest.version` + - `integrationRequest.applicationName` + - `integrationRequest.clusterName` + - Defaults: + - `resources[].type: restful` + - `resources[].timeout: 1000ms` + - `methods[].enable: true` + - `methods[].timeout: 1000ms` + - `inboundRequest.requestType: http` + - `integrationRequest.requestType: dubbo` +- Dubbo method parameters (required when the method has parameters): + - Required: + - `mappingParams[]` (common usage: map `opt.values` and `opt.types`) + - `opt.values` (Dubbo generic invoke argument value list) + - `opt.types` (Java type list aligned with `opt.values`) + - Conditionally required: + - When method parameters contain POJOs, nested objects, or collections, provide the corresponding Java class names and field types. + - Optional: + - `parameterTypes[]` (use when Java types must be declared explicitly or override `opt.types`) +- Registry provider (required when `provider_mode: registry`; defaults use Zookeeper, Nacos can also be chosen, examples below use Zookeeper): + - Required: + - `dubboProxyConfig.registries.zookeeper.address` + - Optional: + - `dubboProxyConfig.registries.zookeeper.group` + - `dubboProxyConfig.registries.zookeeper.namespace` + - `dubboProxyConfig.registries.zookeeper.username` + - `dubboProxyConfig.registries.zookeeper.password` + - Defaults: + - `dubboProxyConfig.registries.zookeeper.protocol: zookeeper` + - `dubboProxyConfig.registries.zookeeper.registry_type: interface` + - `dubboProxyConfig.registries.zookeeper.timeout: 3s` + - `dubboProxyConfig.registries.zookeeper.group: DEFAULT_GROUP` +- Direct provider (required when `provider_mode: direct`): + - Required: + - `integrationRequest.url` + - Conditionally required: + - `integrationRequest.parameterTypes` (use `[]` for no-argument methods; required when `opt.types` is not used) + - Optional: + - `integrationRequest.protocol` (needed when `url` is `host:port`; when `url` has a scheme, it must match that scheme) + - Defaults: + - `integrationRequest.protocol: dubbo` + - `integrationRequest.serialization: hessian2` + +## Workflow +1. Check required Inputs first: + 1. Read existing config and already provided user information first; do not ask again for information already present or stated. + 2. Ask one `Inputs` group at a time. Each time, output only that group's required fields, with a short explanation after each field. + 3. If the current group's required fields are incomplete, ask only for the missing fields and do not move to the next group. + 4. After the current group's required fields are complete, ask whether to fill that group's optional fields; if yes, list those optional fields with short explanations. + 5. After optional fields are skipped or completed, apply that group's defaults and output default-value information; defaults must not override existing config or user input. +2. Read current source before editing YAML: + - `pkg/config/api_config.go`. + - `pkg/filter/http/remote/dubbo_handler.go`. + - `pkg/client/dubbo/types.go`, `pkg/client/dubbo/typeconv.go`, and `pkg/client/dubbo/dubbo.go`. +3. Choose registry or direct path by `provider_mode`: + - Registry uses the registry config in `dgp.filter.http.dubboproxy`. + - Direct uses `integrationRequest.url`. +4. Generate `api_config.yaml`: write `resources[].methods[]` for each HTTP API, and use `opt.values`/`opt.types` to organize Dubbo arguments. +5. Complete `conf.yaml`: use HCM for route and filters, and ensure `dgp.filter.http.apiconfig` is before the Dubbo proxy. + +## Output format +- Show the relevant YAML fragments. + +## Validation +- Verify `mappingParams[].mapTo` indexes match the `parameterTypes[]` list order exactly. +- Verify `dgp.filter.http.apiconfig` is ordered before `dgp.filter.http.dubboproxy`. +- Verify `mapType` uses the lowercase values from `pkg/common/constant/jtypes.go` (`string`/`int`/`long`/`boolean`, etc.), not Java-style `String`/`Boolean`. Review Comment: [P2] 这里把 `mapType` 约束成“只能用 lowercase primitive”,描述得太窄了。`pkg/common/constant/jtypes.go` 里除了 `string/int/boolean` 这些短写,还支持 `java.lang.String`、`java.lang.Integer`、`java.util.Date` 等键。现在这句会把一部分合法配置误判成错误配置。建议改成“必须是 `constant.JTypeMapper` 支持的 key”,同时继续明确 `String`/`Boolean` 这种短大写别名不支持。 -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
