feat(client): improve generated Godoc - #2407
Merged
Merged
Conversation
jamietanna
force-pushed
the
feat/client-docs
branch
from
June 14, 2026 18:30
f264ab9 to
a84e66f
Compare
Member
Author
|
I've split #2406 out of this one |
jamietanna
force-pushed
the
feat/client-docs
branch
from
June 14, 2026 20:02
a84e66f to
60e799b
Compare
Member
|
I think it's a nice looking improvement in terms of comments. The templates get a tiny bit more complex, but I think that's ok. |
Member
|
@greptileai please review this draft. |
Contributor
Greptile SummaryThis PR improves the generated Godoc for clients, servers, and response wrappers. The main changes are:
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| pkg/codegen/templates/client-with-responses.tmpl | Updates the generated GetBody comment text without changing emitted code behavior. |
Reviews (10): Last reviewed commit: "chore(client): remove unnecessary `(Body..." | Re-trigger Greptile
jamietanna
force-pushed
the
feat/client-docs
branch
2 times, most recently
from
June 15, 2026 17:28
13b5a09 to
5925f8c
Compare
jamietanna
force-pushed
the
feat/client-docs
branch
from
June 16, 2026 07:39
5925f8c to
6ea4727
Compare
jamietanna
commented
Jun 16, 2026
jamietanna
force-pushed
the
feat/client-docs
branch
3 times, most recently
from
June 16, 2026 21:09
4fa8d8a to
1b04b33
Compare
jamietanna
force-pushed
the
feat/client-docs
branch
2 times, most recently
from
June 17, 2026 07:53
31b99d9 to
4cbcee1
Compare
jamietanna
force-pushed
the
feat/client-docs
branch
3 times, most recently
from
June 17, 2026 08:30
a2a3f8d to
608534d
Compare
Member
Author
|
@greptileai review |
jamietanna
marked this pull request as ready for review
June 17, 2026 08:33
Open
To make sure that the comments show up as Godoc for IDEs, the convention is that the first word of the comment should be the function name. With help from Claude Sonnet to add test coverage, and ensure that no stray whitespace can be injected. Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@rootly.com>
As a follow-up from c5641fd, we can improve this wording, so it's a little clearer. This makes it a little clearer what this getter is doing - returning the response body for a given HTTP response and media type - rather than reiterating what type is returned.
To align with the comment on the helper function, if enabled, too.
To make it easier for folks to work with the generated code we produce for API clients, we should make a few tweaks to improve the output: - Provide a better default Godoc if we don't have a `summary` - Ensure the `ClientInterface` and `ClientWithResponsesInterface` include Godoc, too - Generate a more in-depth Godoc when we do have a `summary` and/or `description` This introduces new helper functions to simplify the rendering in Go, rather than introducing complex templating. With help from Claude Sonnet to add test coverage. Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@rootly.com>
jamietanna
force-pushed
the
feat/client-docs
branch
from
June 17, 2026 09:08
608534d to
ad7b3a0
Compare
Member
Author
|
@greptileai review |
Contributor
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
Member
|
I've removed "breaking change" since we've generally not bothered about flagging template changes. Pretty much everything is a breaking change if we follow that convention. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've noted this as "breaking" as it changes the way that an existing templating function works