Skip to content

Conversation

@noahdietz
Copy link
Collaborator

@noahdietz noahdietz commented Dec 8, 2025

Include the API version for the interface (protobuf service) client on the client documentation.

AIP-4236 denotes this a "may" requirement, but I am updating it to a "must" requirement for all languages in aip-dev/google.aip.dev#1585

Motivating bug http://b/467065424. Task tracking bug http://b/467067975.

@noahdietz noahdietz requested a review from a team as a code owner December 8, 2025 23:57
@shollyman
Copy link
Contributor

I guess my main question here is how much value we're getting from the repetition of the docstring? Should we just add a single comment? Just the comment on the the struct type or in the generated file headers? It's not currently exposed in as a constant or method so there's no programatic access to the identifier, but I'm not clear if that will change.

This is more nitpicky, but can/should we describe this value better with the comment? As a casual reader I already potentially have multiple endpoints that are versions (apiv1, apiv1beta1, etc), and module versions so a more descriptive comment would be helpful here to describe why users now have yet another versioning concept to keep track of.

@noahdietz
Copy link
Collaborator Author

Just the comment on the the struct type or in the generated file headers?

Yeah, just on the struct type is fine. I was just plugging into the doc gen function used for clients and its used in multiple places and didn't think it was that disruptive. I'll just add a param to the function and only have it on the type docs.

It's not currently exposed in as a constant or method so there's no programatic access to the identifier, but I'm not clear if that will change.

I don't think that will change unless there is a clear use case for having programmatic access to the value (don't want to over expose when we don't need to, ya know?). ATM there is no such use case.

can/should we describe this value better with the comment?...a more descriptive comment would be helpful here to describe why users now have yet another versioning concept to keep track of.

Yeah that's a fair ask. I think this comment, on the client type, should be tight and "do a job" i.e. be the breadcrumb users need to correlate this client with other API artifacts e.g. documentation site(s). I am working on another PR for package level documentation (in doc.go) that will list all client-interface-version tuples as a sort of ToC for API versions - would putting a brief description of what this is in that heading suffice?

@shollyman
Copy link
Contributor

Just the comment on the the struct type or in the generated file headers?

Yeah, just on the struct type is fine. I was just plugging into the doc gen function used for clients and its used in multiple places and didn't think it was that disruptive. I'll just add a param to the function and only have it on the type docs.

Thanks!

It's not currently exposed in as a constant or method so there's no programatic access to the identifier, but I'm not clear if that will change.

I don't think that will change unless there is a clear use case for having programmatic access to the value (don't want to over expose when we don't need to, ya know?). ATM there is no such use case.

Most of the usage I imagine is more exotic versions of dependency resolution, so tools can find a module release that supports a given interface contract version. I think its fair to keep it out of the mix.

can/should we describe this value better with the comment?...a more descriptive comment would be helpful here to describe why users now have yet another versioning concept to keep track of.

Yeah that's a fair ask. I think this comment, on the client type, should be tight and "do a job" i.e. be the breadcrumb users need to correlate this client with other API artifacts e.g. documentation site(s). I am working on another PR for package level documentation (in doc.go) that will list all client-interface-version tuples as a sort of ToC for API versions - would putting a brief description of what this is in that heading suffice?

I think that's a great way to handle it, thanks!

@noahdietz noahdietz requested a review from shollyman December 9, 2025 17:22
@noahdietz noahdietz enabled auto-merge (squash) December 9, 2025 17:25
@noahdietz noahdietz merged commit 171a9cf into googleapis:main Dec 9, 2025
7 checks passed
@noahdietz noahdietz deleted the api-version-docs branch December 9, 2025 17:47
@noahdietz noahdietz removed the request for review from shollyman December 9, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants