AlexStocks commented on code in PR #3500:
URL: https://github.com/apache/dubbo-go/pull/3500#discussion_r3628100975


##########
internal/config.go:
##########
@@ -215,3 +215,23 @@ func ValidateRegistryIDs(ids []string, regs 
map[string]*global.RegistryConfig) e
        }
        return nil
 }
+
+// ValidateGenericType validates the generic serialization type (generic mode).
+// An empty value means the call is not generic and is allowed. Unknown values 
fail
+// fast instead of silently falling back to the Map generalizer.
+//
+// Valid values: "true" (Map, default), "gson", "protobuf-json", "bean".
+// "protobuf" is kept as a legacy compatibility value and is not recommended.
+func ValidateGenericType(generic string) error {
+       switch {
+       case generic == "",
+               strings.EqualFold(generic, 
constant.GenericSerializationDefault),
+               strings.EqualFold(generic, constant.GenericSerializationGson),
+               strings.EqualFold(generic, 
constant.GenericSerializationProtobufJson),
+               strings.EqualFold(generic, constant.GenericSerializationBean),

Review Comment:
   [P1] 同步 Triple 对 bean 的 generic 判断
   
   这里将 `bean` 作为合法模式放行,但当前 `protocol/triple/triple.go:isGenericCall` 只识别 
`true/gson/protobuf/protobuf-json`。因此通过 `Dial(..., WithGenericType("bean"))` 
创建的 Triple 引用(未额外设置 `NONIDL` 或 `ClientInfoKey`)会走 `NewDubbo3Invoker`,而不是支持 
`$invoke` 的 `NewTripleInvoker`。我用 overlay 测试调用 
`isGenericCall(constant.GenericSerializationBean)` 可稳定复现为 false。请在 Triple 
合法模式集合及对应测试中补上 `bean`,并与这里的校验共用或同步同一策略。



-- 
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]

Reply via email to