AlexStocks commented on code in PR #3500:
URL: https://github.com/apache/dubbo-go/pull/3500#discussion_r3642571807
##########
internal/config.go:
##########
@@ -215,3 +215,34 @@ func ValidateRegistryIDs(ids []string, regs
map[string]*global.RegistryConfig) e
}
return nil
}
+
+// IsGenericMode reports whether a generic value denotes a generic call. It is
the
+// single source of truth for the accepted generic modes so that callers
(config
+// validation, protocol-level routing) stay in sync instead of each
maintaining its
+// own list. An empty value means the call is not generic.
+//
+// Recognized modes: "true" (Map, default), "gson", "protobuf-json", "bean",
and the
+// legacy "protobuf" (kept for compatibility, not recommended).
+func IsGenericMode(generic string) bool {
+ if generic == "" {
+ return false
+ }
+ return strings.EqualFold(generic, constant.GenericSerializationDefault)
||
+ strings.EqualFold(generic, constant.GenericSerializationGson) ||
+ strings.EqualFold(generic,
constant.GenericSerializationProtobufJson) ||
+ strings.EqualFold(generic, constant.GenericSerializationBean) ||
+ strings.EqualFold(generic,
constant.GenericSerializationProtobuf)
Review Comment:
[P1] 共享谓词仍未覆盖 generic filter 的实际消费路径
这里把 legacy `protobuf` 作为受支持 generic mode,因此引用创建校验会通过,Triple 也会选择 `$invoke`
capable invoker;但 `filter/generic/util.go:isGeneric` 仍不识别该值。当前 Head 上用
`generic=protobuf&serialization=hessian2` 发起普通 `Hello` 调用,consumer filter 在
`filter.go:153` 原样下传 `Hello`,没有转换为 `$invoke`(期望 `$invoke`,实际
`Hello`)。因此同一配置在校验/Triple 与 filter 中仍是相反语义。请二选一:若保留 legacy `protobuf`,同步接通
filter 并补 Hessian string/map/POJO 行为测试;若不保留,则从这里、Triple、注释和测试中统一移除,并在创建引用时拒绝。
--
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]