Skip to content
This repository was archived by the owner on Jan 18, 2026. It is now read-only.

feat: api_dump template to use in tests#845

Merged
alexander-fenster merged 2 commits intomasterfrom
api-dump
Mar 23, 2021
Merged

feat: api_dump template to use in tests#845
alexander-fenster merged 2 commits intomasterfrom
api-dump

Conversation

@alexander-fenster
Copy link
Contributor

Before fixing the naming issue for Pub/Sub, adding some test coverage.

The generator now has a template called api_dump which just dumps the JSON representation of the API metadata being generated. As you can see, the package name for the Pub/Sub API is currently generated as google and not google.pubsub, which is the source of the Pub/Sub problems, and it will be fixed in the following PR.

Please ignore the copyright year changes in the baseline protos.

@alexander-fenster alexander-fenster requested a review from bcoe March 23, 2021 16:11
@alexander-fenster alexander-fenster requested a review from a team as a code owner March 23, 2021 16:11
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Mar 23, 2021
@@ -0,0 +1,14065 @@
{
"packageName": "google",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the problem I will fix in the following PR: the package name must be google.pubsub but is detected incorrectly.

@@ -0,0 +1 @@
{{ api.dump | safe }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new template being added for test purposes. Running the generator with --template=api_dump will produce the above JSON representation, which will help debugging weird problems.

);
}

get dump() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new getter to produce an API dump.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, it will be only used in tests or during debugging. We won't dump this thing for regular libraries.

@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little strange that it changes the date?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original protos are (c) 2020 and apparently someone changed everything to 2021 even though this particular change was not needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants