Skip to content

Commit

Permalink
fix: should ignore google/rpc/context/*.proto (#1119)
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-ji-eng committed Mar 4, 2022
1 parent 49a3ad5 commit 62d6913
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions typescript/src/schema/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class API {
fd.package === 'google.protobuf' ||
fd.package === 'google.type' ||
fd.package === 'google.rpc' ||
fd.package === 'google.rpc.context' ||
fd.package === 'google.api'
);
}
Expand Down
2 changes: 0 additions & 2 deletions typescript/src/templater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ function createSnippetIndexMetadata(
api: API,
basePath: string
): protos.google.cloud.tools.snippetgen.snippetindex.v1.IIndex {
const apis: protos.google.cloud.tools.snippetgen.snippetindex.v1.IApi[] = [];

const clientLibrary: protos.google.cloud.tools.snippetgen.snippetindex.v1.IClientLibrary = {
name: `nodejs-${api.naming.productName.toKebabCase()}`,
version: '0.1.0',
Expand Down
5 changes: 4 additions & 1 deletion typescript/test/unit/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ describe('src/schema/api.ts', () => {
const fd5 = new protos.google.protobuf.FileDescriptorProto();
fd5.name = 'google/api/servicemanagement/v1/servicemanager.proto';
fd5.package = 'google.api.servicemanager.v1';
const api = new API([fd1, fd2, fd3, fd4, fd5], 'google', {
const fd6 = new protos.google.protobuf.FileDescriptorProto();
fd6.name = 'google/rpc/context/attribute_context.proto';
fd6.package = 'google.rpc.context';
const api = new API([fd1, fd2, fd3, fd4, fd5, fd6], 'google', {
grpcServiceConfig: new protos.grpc.service_config.ServiceConfig(),
});
assert.deepStrictEqual(api.filesToGenerate, [
Expand Down

0 comments on commit 62d6913

Please sign in to comment.