Copilot commented on code in PR #3594:
URL: https://github.com/apache/dubbo-go/pull/3594#discussion_r3717974767
##########
internal/config.go:
##########
@@ -233,13 +233,13 @@ func IsGenericMode(generic string) bool {
}
// 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.
+// An empty value or "false" 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 {
- if generic == "" || IsGenericMode(generic) {
+ if generic == "" || strings.EqualFold(generic, "false") ||
IsGenericMode(generic) {
return nil
}
return fmt.Errorf("invalid generic type %q, valid values: true, gson,
protobuf-json, bean", generic)
Review Comment:
ValidateGenericType now accepts "false" (disable) and also treats legacy
"protobuf" as valid via IsGenericMode, but the returned error message still
lists only true/gson/protobuf-json/bean. This makes configuration errors harder
to diagnose because the message doesn't reflect the actual accepted values.
--
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]