feat: support x-fern-display-name on AsyncAPI operations#14848
feat: support x-fern-display-name on AsyncAPI operations#14848fern-support wants to merge 1 commit intomainfrom
Conversation
Add support for the x-fern-display-name extension on AsyncAPI v3 operations and AsyncAPI v2 publish/subscribe operations. This allows users to set custom display names for operations in docs independently of the operation key, which is useful when operation keys must be unique across versioned endpoints. Co-Authored-By: Chris McDonnell <chris@buildwithfern.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.
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 |
Local Testing ResultsBuilt the CLI locally and ran Test 1: AsyncAPI v3 — operations WITH x-fern-display-name (PASSED)Input — operations with operations:
SendPlantUpdateV1:
x-fern-display-name: Send Plant Update
action: send
...
ReceivePlantStatusV1:
x-fern-display-name: Receive Plant Status
action: receive
...Output — Fern Definition YAML: channel:
messages:
plantStatus:
body: PlantStatus
display-name: Receive Plant Status
origin: server
plantUpdate:
body: PlantUpdate
display-name: Send Plant Update
origin: client
Test 2: Backward Compatibility — no x-fern-display-name (PASSED)Used existing fixture channel:
messages:
testChannel_sendMessage:
body: string
origin: client
path: /testTest 3: AsyncAPI v2 — publish/subscribe WITH x-fern-display-name (PASSED)Input — v2 publish/subscribe with channels:
/plants/updates:
publish:
x-fern-display-name: Send Plant Update
...
subscribe:
x-fern-display-name: Receive Plant Status
...Output — Fern Definition YAML: channel:
messages:
publish:
body: PlantsUpdatesPublish
display-name: Send Plant Update
origin: client
subscribe:
body: PlantsUpdatesSubscribe
display-name: Receive Plant Status
origin: server
Summary: All 3 tests passed. The feature works end-to-end for both AsyncAPI v2 and v3 through the |
Description
Adds support for the
x-fern-display-nameextension on AsyncAPI operations, allowing users to set custom display names for operations independently of the operation key. This is useful when operation keys must be globally unique (e.g., versioned endpoints likeSendMessageV1) but the docs should show a friendlier name (e.g.,Send Message).Previously,
x-fern-display-nameonly worked on channels. Operation display names were hardcoded to the operation key (v3) or"publish"/"subscribe"(v2).Changes Made
DisplayNameExtensionto accept operations (v2 publish/subscribe, v3 operations) in addition to channels, renamingchannel→nodex-fern-display-namefrom each operation inChannelConverter3_0, falling back tooperationIdx-fern-display-namefrom publish/subscribe inChannelConverter2_X, falling back to message typedisplayNamefrom operations inparseAsyncAPIV3and pass through toWebsocketMessageSchemadisplayNamefrom publish/subscribe inparseAsyncAPIV2displayName: optional<string>toWebsocketMessageSchemain OpenAPI IR (definition, API type, serialization)buildChannel.tsto forwarddisplayName→display-namein the Fern Definition outputBoth parser code paths (newer
asyncapi-to-irand olderopenapi-ir-parser) are updated.Testing
biome check)Suggested reviewer checklist
DisplayNameExtensiontype union correctly covers all operation typesWebsocketMessageSchema.ts) are consistent withfinalIr.ymldefinition changeLink to Devin session: https://app.devin.ai/sessions/3702d64e03ae4c63bec715eecfc0b3b3
Requested by: @cdonel707