googleapis / gapic-generator-csharp

Apache License 2.0
48 stars 20 forks source link

Consider generating properties for resource references in nested messages #545

Closed jskeet closed 4 months ago

jskeet commented 1 year ago

Consider the following proto:

message Abc {
  string location = 1 [
    (google.api.resource_reference) = {
      type: "locations.googleapis.com/Location"
    }
  ];

  message Def {
    string location = 1 [
      (google.api.resource_reference) = {
        type: "locations.googleapis.com/Location"
      }
    ];
  }
}

Currently we'll generate a LocationAsLocationName property for Abc, but not for Def (it's in ResourceNamesGenerator.ProtoMessagePartials).

Generating the extra properties is:

... on the other hand, this inconsistency is annoying.

I don't think we've had a single customer request this.

The following fields would have resource annotations generated for them:

jskeet commented 4 months ago

Will close here, reopen internally as P3.