Skip to content

[gRPC] Support for multi-package specs #632

Description

@witemple-msft

Consider this Cadl spec:

@package("com.azure.A")
namespace A {
  @service Foo {
    bar(...B.Request): void;
  }
}

@package("com.azure.B")
namespace B {
  model Request {
    @field(1)
    name: string;
  }
}

The definition of the service Foo will be generated as part of com/azure/A.proto and the message will be generated as part of com/azure/B.proto, so we need to have a way to import and use the qualified names of each type when cross-package references are used:

com/azure/A.proto:

import "../../google/protobuf/Empty.proto";
import "./B.proto";

package "com.azure.A";

service Foo {
  rpc bar (com.azure.B.Request) returns (google.protobuf.Empty);
}

com/azure/B.proto:

package "com.azure.B";

message Request {
  string name = 1;
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions