-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support API versioning in generated protos #121
Conversation
If the methods that wind up in a each proto service all have the same "apiVersion" field in the Discovery document, that value becomes part of a new "api_version" annotation in the proto service. If the version numbers for the methods in a service don't match, generation fails.
813b0dd
to
b4d2c8d
Compare
// This method returns the same as parseMethods(), but returns all methods in a map indexed by | ||
// method name. | ||
// | ||
// TODO: Combine with parseMethods? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: Combine with parseMethods? | |
// TODO: See <REPLACE ME with link to new bug filed in https://github.com/googleapis/disco-to-proto3-converter/issues> |
Same applies to the 2nd TODO comment in this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -0,0 +1,761 @@ | |||
// Copyright 2020 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Copyright 2020 Google LLC | |
// Copyright 2024 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The date is derived from the Discovery revision field, so this is WAI. But to your point, since these Discovery fragments are new, I'll change them to have a 2024 date.
} | ||
|
||
@Test | ||
public void convertVersionedInconsistent() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Add a comment under each test which explains the purpose of each test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I don't know enough about this generator to give detailed feedback, but it looks fine to me. |
If the methods that wind up in a each proto service all have the same "apiVersion" field in the Discovery document, that value becomes part of a new "api_version" annotation in the proto service. If the version numbers for the methods in a service don't match, generation fails.