fix: correctly set deprecated Godoc where necessary - #2405
Merged
Merged
Conversation
jamietanna
force-pushed
the
fix/deprecated
branch
3 times, most recently
from
June 14, 2026 07:40
d471034 to
c390cb3
Compare
Member
Author
|
@greptileai review |
Contributor
Greptile SummaryThis PR adds deprecation support to generated OpenAPI code. The main changes are:
Confidence Score: 5/5This looks safe to merge.
|
| Filename | Overview |
|---|---|
| pkg/codegen/operations.go | Adds operation deprecation propagation for request body definitions and preserves existing generation order. |
| pkg/codegen/schema.go | Adds explicit typedef-level deprecation comments while keeping schema-level deprecation behavior intact. |
| pkg/codegen/templates/request-bodies.tmpl | Emits sanitized deprecation comments above generated request body aliases. |
Reviews (4): Last reviewed commit: "fix: propagate **??**" | Re-trigger Greptile
Member
Author
|
@greptileai review |
jamietanna
force-pushed
the
fix/deprecated
branch
from
June 17, 2026 12:51
58ae531 to
8b26990
Compare
As part of future changes, we'll be improving how `oapi-codegen` generates deprecation notices through godoc. Before we do this, we can introduce a more in-depth test case for the different areas that can be marked as deprecated, so we can validate the functionality. With help from As a starting point from **??**, we can then extend this to: - Cover at least an HTTP client and server - Add Strict Server functionality - Deprecate a parameter - Generate a deprecation on `components/response` Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@rootly.com>
jamietanna
force-pushed
the
fix/deprecated
branch
from
June 17, 2026 13:26
8b26990 to
984f3bc
Compare
Member
Author
|
@greptileai review |
Previously, we would miss rendering a deprecation notice in Godoc for API types, fields and HTTP routes in our generated client, which makes it harder for users to be aware of deprecated functionality they're relying upon. We can make sure to introduce `DeprecationComment` functions where necessary, and call it when rendering templates. Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@rootly.com>
In the case that we have type aliases that are deprecated (because the type they're pointing to, are also deprecated), we were previously not marking the type alias as deprecated, too. Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@rootly.com>
jamietanna
force-pushed
the
fix/deprecated
branch
from
June 17, 2026 18:43
984f3bc to
a1e91cc
Compare
jamietanna
marked this pull request as ready for review
June 17, 2026 18:48
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.
No description provided.