File tree Expand file tree Collapse file tree
fern/products/sdks/overview/java/changelog Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## 4.0.3
2+ ** ` (fix): ` ** Fix WebSocket ` handleIncomingMessage() ` using Fern-internal message IDs
3+ (e.g. ` AgentV1Welcome ` , ` ListenV1Results ` ) instead of the wire discriminant
4+ values from the spec (e.g. ` Welcome ` , ` Results ` ). This caused all incoming
5+ message handlers to never fire, falling through to the unknown type handler.
6+
7+ The generator now extracts wire discriminant values from each message body's
8+ ` type ` property — resolving literal values (e.g. ` literal<"Welcome"> ` ) and
9+ enum values (e.g. ` enum[Flushed, Cleared] ` ) — and dispatches via a ` switch `
10+ statement on those values. This aligns with the approach used by the Python
11+ generator.
12+
13+
14+ ** ` (fix): ` ** WebSocket handler registration methods and field names now use
15+ wire discriminant values instead of Fern-internal prefixed names. For example,
16+ ` onAgentV1Welcome(handler) ` is now ` onWelcome(handler) ` , and
17+ ` onAgentV1PromptUpdated(handler) ` is now ` onPromptUpdated(handler) ` . Methods
18+ that were already backed by a custom ` x-fern-sdk-method-name ` (e.g.
19+ ` onFunctionCallResponse ` ) are unchanged.
20+
21+
22+ ** ` (chore): ` ** Improve generated WebSocket client code quality: use a string literal for
23+ static URL paths instead of ` StringBuilder ` , remove dead if/else branches in
24+ async ` sendMessage() ` , consolidate redundant catch blocks in message dispatch,
25+ and correct Javadoc articles ("a" vs "an") for type names starting with vowels.
26+
27+
You can’t perform that action at this time.
0 commit comments