telescope icon indicating copy to clipboard operation
telescope copied to clipboard

non alphanumeric json_name can break codegen

Open pyramation opened this issue 2 years ago • 0 comments

culprit is string module_name = 10 [json_name="-", (gogoproto.jsontag) = "-"];

proto/thorchain/v1/x/thorchain/types/type_tx_out.proto:

message TxOutItem {
  string chain = 1 [(gogoproto.casttype) = "gitlab.com/thorchain/thornode/common.Chain"];
  string to_address = 2 [(gogoproto.casttype) = "gitlab.com/thorchain/thornode/common.Address"];
  string vault_pub_key = 3 [(gogoproto.casttype) = "gitlab.com/thorchain/thornode/common.PubKey"];
  common.Coin coin = 4 [(gogoproto.nullable) = false];
  string memo = 5;
  repeated common.Coin max_gas = 6 [(gogoproto.castrepeated) = "gitlab.com/thorchain/thornode/common.Gas", (gogoproto.nullable) = false];
  int64 gas_rate = 7;
  string in_hash = 8 [(gogoproto.casttype) = "gitlab.com/thorchain/thornode/common.TxID"];
  string out_hash = 9 [(gogoproto.casttype) = "gitlab.com/thorchain/thornode/common.TxID"];
  string module_name = 10 [json_name="-", (gogoproto.jsontag) = "-"];
  string aggregator = 11;
  string aggregator_target_asset = 12;
  string aggregator_target_limit = 13 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint", (gogoproto.nullable) = true];
}

probably should be this

      moduleName: isSet(object.moduleName) ? String(object.moduleName) : "",

but instead does this

      moduleName: isSet(object.-) ? String(object.-) : "",

pyramation avatar Jan 12 '23 02:01 pyramation