tombentley commented on pull request #9433: URL: https://github.com/apache/kafka/pull/9433#issuecomment-724572562
> Personally, the implementations of `errorCounts` are almost same. Maybe it should be implemented > by auto-generated protocol so the consistency (code style and behavior) can be protected. @hachikuji WDYT? That's a good idea in theory, but in practice the code generator doesn't know which fields are error codes, apart from the convention that they're called `ErrorCode` and are an `int16`. If we ever needed to call an error code field something else `errorCounts()` would break. I think there is some value in having a richer way of expressing types (that is, separately from the "serialization type") in the RPC JSON (see https://issues.apache.org/jira/browse/KAFKA-7787 for example), but any effort to do that would require a KIP and potentially impose a burden on other client implementer who are consuming that JSON. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org