feat: support OpenAPI metadata comment blocks#9
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for defining OpenAPI operation metadata directly within Go handler comments using an "openapi:" YAML block. This allows developers to specify fields such as summary, tags, deprecated, and custom extensions (e.g., x-public) directly in the source code. The implementation includes logic to extract and parse these blocks from doc comments, updates to the internal operation documentation structures, and corresponding tests. Review feedback identifies a bug in the comment parsing logic that strips leading whitespace and destroys YAML indentation. Additionally, it is recommended to use a struct for composite return values to improve code quality and to provide better error reporting when YAML unmarshaling fails within a comment block.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the ability to define OpenAPI operation-level metadata and extensions directly in Go handler comments using a YAML-formatted openapi: block. The implementation includes a parser for these blocks, updates to the generator to apply the metadata, and corresponding documentation and tests. A review comment suggests that source-level warnings should be moved to a location re-evaluated during each generation cycle to ensure they are not lost when the specification is regenerated.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for openapi: metadata blocks within Go handler comments, allowing developers to define operation-level fields such as summary, description, operationId, tags, deprecated, and custom OpenAPI extensions (e.g., x-public). The implementation includes a YAML parser for these blocks, logic to strip them from the final human-readable description, and a warning system for invalid metadata. Documentation and tests have been updated to reflect these changes. I have no feedback to provide.
Summary
openapi:blocks for operation metadatax-*extensions plus simple operation fields such assummary,description,operationId,tags, anddeprecatedValidation
go test ./...