**Is your feature request related to a problem? Please describe.** `to_json` (and `to_proto`) has been deprecated since Bazel 4.0.0. **Describe the solution you'd like** Make use of `json.encode(struct)` instead and enable `--incompatible_struct_has_no_methods` .