fix(generators): document all exported symbols in generated code (#141) - #330
Merged
Merged
Conversation
Several exported symbols were generated without a doc comment (MessageWithCorrelationID, Error, the Error() method and the message constructors), and the Request* function's doc comment was detached from it by a blank line. Add the missing comments and reattach the Request comment so every exported declaration in generated code is documented. Fixes #141 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
lerenn
force-pushed
the
feat/141-generated-comments
branch
from
June 12, 2026 16:12
6911a7c to
4872b24
Compare
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.
Issue
Fixes #141 — some generated functions/types were missing doc comments or had them incomplete.
Change
Generated files are skipped by the linter (DO NOT EDIT header), so these gaps were invisible to CI. Audit of every
*.gen.gofound a consistent set of exported symbols without a doc comment:MessageWithCorrelationIDinterfaceErrorstruct and itsError()methodNew<Message>()constructorsRequest{As,To}<Op>function — its doc comment was detached by a blank line, so Go treated it as not a doc commentAll are fixed in the v2/v3
types.tmpl,message.tmpland v3controller.tmpl. 111 golden files are regenerated with the added comments (comment-only changes).Test
test/v3/issues/141parses the generatedasyncapi.gen.gowithgo/parserand asserts that every exported declaration (func, type, const, var) has a doc comment. It fails before the change (the symbols above lack docs) and passes after. The spec is a request-reply with correlation IDs so theRequestfunction and the message/error types are all exercised.🤖 Generated with Claude Code