feat(http): treat null JsonFormat fields as absent#6863
Conversation
1. Treat known protobuf fields with literal null as absent so HTTP APIs recover the 4.8.1 fastjson-compatible behavior for null object fields. 2. This relaxes JSON-RPC buildTransaction ABI handling because that path now accepts null ABI fields instead of returning invalid abi. 3. TRON's JsonFormat now aligns more closely with protobuf Java JsonFormat: field-level null is treated as absent, while null elements inside repeated arrays remain invalid.
|
Nice fix on the inbound side. One gap worth a follow-up: this only covers the inbound (parse) side. The It's functionally fine now (the parser tolerates null), but the response JSON shape still diverges from the old fastjson behavior: fastjson omitted null-valued fields by default, whereas the current output keeps them. Downstream tools that migrated assuming "fastjson omits nulls" will see extra"field":null` entries in node responses. To fully restore fastjson output compatibility, we'd also need to strip |
|
@Sunny6889 That said, in the current HTTP response paths, I did not find a production path that inserts So I agree this is a valid compatibility caveat for the wrapper. However, I would treat it as a follow-up compatibility-hardening item rather than a blocker for this inbound |
Treat known protobuf fields with literal null as absent so HTTP APIs recover the 4.8.1 fastjson-compatible behavior for null object fields.
This relaxes JSON-RPC buildTransaction ABI handling because that path now accepts null ABI fields instead of returning invalid abi.
Existing array-element behavior is unchanged: null elements in repeated message/object arrays remain invalid, while null elements in repeated primitive/bytes/enum arrays are consumed and skipped by the legacy parser.
fix: [Feature] Replace fastjson with Jackson #6607 (comment)