feat(java): annotate endpoint availability in generated SDK#15120
feat(java): annotate endpoint availability in generated SDK#15120Swimburger wants to merge 11 commits intomainfrom
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
SDK Generation Benchmark ResultsComparing PR branch against latest nightly baseline on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
…dpoint-availability flag Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… mode Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…otations default on Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Description
Mirrors the TypeScript SDK generator's
getAvailabilityDocsbehavior in both Java generators. Generated client methods (v1) and generatedreference.md(v2) now reflect the IRavailabilityfield.Mapping per
AvailabilityStatus:DEPRECATED→ v1:@Deprecatedannotation +@deprecated[ message]Javadoc tag; v2:@deprecated[ message]appended toreference.mddescriptionIN_DEVELOPMENT→@beta This endpoint is in development and may change.[ message]PRE_RELEASE→@beta This endpoint is in pre-release and may change.[ message]GENERAL_AVAILABILITY→ nothing extraChanges Made
generators/java/(v1 — client class generation)AvailabilityUtilsingenerators/java/generator-utils/exposinggetAvailabilityDocs(...)andisDeprecated(...).AbstractEndpointWriter.generate()now emits the endpoint docs first and appends the availability Javadoc after them (Javadoc block tags must follow the main description), and applies@Deprecatedto every method variant it builds (default, no-request-options, no-request-body, body-only, byte-array, and all 4 file-upload input-stream overloads).SyncDelegatingHttpEndpointMethodSpecs/AsyncDelegatingHttpEndpointMethodSpecsnow copymethodSpec.annotationsalongside javadoc so@Deprecatedpropagates to the delegating client methods.generators/java/sdk/changes/unreleased/.generators/java-v2/(reference.md generation)Java v2 does not generate SDK client classes (those remain v1's responsibility per
generators/java-v2/CLAUDE.md), but it ownsreference.md. The helper is mirrored in TypeScript (can't literally share code with v1, which is Java) to keep wording identical.generators/java-v2/sdk/src/utils/getAvailabilityDocs.ts— TS port of the helper returning the same@deprecated/@betastrings as the TS SDK helper.buildReference.tsnow prepends the endpoint docs (if any) and appends the availability string (if any) as the description forEndpointReference, so deprecated / beta endpoints are surfaced in the generatedreference.md.src/utils/__test__/getAvailabilityDocs.test.tscovering everyAvailabilityStatusvariant with and without a message.Testing
AvailabilityUtilsTestcovering eachAvailabilityStatusvariant with and without a message, plusisDeprecatedcases.getAvailabilityDocs(8 cases) — passing viavitest run../gradlew spotlessApplyand./gradlew :generator-utils:test :sdk:compileJavapass.pnpm formatrun ingenerators/java-v2/sdk.Reviewer notes / things worth a close look
availabilityfield would produce a diff now (both v1 client methods and v2reference.md). If snapshots should be refreshed as part of this PR, please flag and I'll regenerate.@deprecated/@betastrings in markdown — matches the exact TS-SDK wording per the task spec, but if you'd prefer a markdown-native rendering (e.g.**Deprecated:** …) let me know.@Deprecatedapplication (v1) — the annotation is added on everyMethodSpec.Buildercreated insideAbstractEndpointWriter.generate()(including all file-upload / byte-array overloads). Worth double-checking I didn't miss one or apply it somewhere a delegating layer won't see it.@deprecated/@beta), to satisfy Javadoc's rule that block tags follow the main description. This addresses earlier Devin Review feedback on ordering.buildReference.ts— most of the diff is a prettier reflow (2-space indentation) applied bypnpm formatagainst the file; the functional change is thegetEndpointReferenceDescriptionhelper and the import.availability.getStatus().getEnumValue()so an unknown future enum value falls through toOptional.empty()/ non-deprecated rather than throwing.Link to Devin session: https://app.devin.ai/sessions/d0e161353b3141408ae79073dc3af055
Requested by: @Swimburger