Skip to content

fix/deprecated#2405

Draft
jamietanna wants to merge 3 commits into
mainfrom
fix/deprecated
Draft

fix/deprecated#2405
jamietanna wants to merge 3 commits into
mainfrom
fix/deprecated

Conversation

@jamietanna

@jamietanna jamietanna commented Jun 13, 2026

Copy link
Copy Markdown
Member
  • test against rootly-go
  • maybe extract the method generation (for client API calls) to a separate commit
  • don't allow a multi-line deprecation to break out of comments

@jamietanna jamietanna force-pushed the fix/deprecated branch 2 times, most recently from f95c51f to d471034 Compare June 14, 2026 07:31
jamietanna and others added 2 commits June 14, 2026 08:40
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>
This adds a new **??**,

dep-reason

fix: emit deprecation notice on deprecated type definitions

Types defined in components/schemas (and elsewhere) with deprecated:true
now get a // Deprecated: comment as the final paragraph of their doc
comment, which godoc and IDEs recognise as a deprecation warning.

Adds DocComment() and DeprecationComment() to TypeDefinition, and updates
typedef.tmpl to call DocComment() instead of inlining the description logic.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@rootly.com>
@jamietanna

Copy link
Copy Markdown
Member Author

@greptileai review

@greptile-apps

greptile-apps Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds generated Go deprecation comments from OpenAPI metadata. The main changes are:

  • Adds deprecation comments for models, fields, parameters, operations, and response headers.
  • Reads x-deprecated-reason when present and falls back to generated default messages.
  • Updates client, server, strict-server, and response templates to emit those comments.
  • Adds a deprecation-focused test fixture and generated golden output.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Reviews (3): Last reviewed commit: "fixup! fix: deprecate **??**" | Re-trigger Greptile

@jamietanna

Copy link
Copy Markdown
Member Author

@greptileai review

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.

1 participant