Skip to content

fix(cli): decode JSON Pointer escape sequences in AsyncAPI V3 parser#12051

Open
fern-support wants to merge 1 commit intomainfrom
devin/1770178469-fix-asyncapi-json-pointer-escape
Open

fix(cli): decode JSON Pointer escape sequences in AsyncAPI V3 parser#12051
fern-support wants to merge 1 commit intomainfrom
devin/1770178469-fix-asyncapi-json-pointer-escape

Conversation

@fern-support
Copy link
Collaborator

Description

Refs: Investigation for Smallest AI websocket generation issue

Fixes the AsyncAPI V3 parser to properly decode JSON Pointer escape sequences in channel references per RFC 6901.

When AsyncAPI specs have channel paths containing slashes (e.g., /api/v1/ws), these are encoded as ~1 in JSON Pointer $ref values (e.g., #/channels/~1api~1v1~1ws). The parser was not decoding these escape sequences, causing channel lookups to fail and AsyncAPI documents to be skipped during parsing.

Changes Made

  • Added JSON Pointer escape sequence decoding (~1/, ~0~) in getChannelPathFromOperation()
  • Rewrote message reference resolution in AsyncAPIV3ParserContext.resolveMessageReference() to properly extract and decode channel paths before lookup
  • Added defensive null check for operation.channel with descriptive error message
  • Added changelog entry for version 3.60.2

Testing

  • Manual testing with minimal AsyncAPI V3 fixture containing URL-encoded channel paths
  • Verified websocket client code is generated correctly after fix
  • Lint checks pass (pnpm run check)
  • Seed test fixture not added (consider adding for regression prevention)

Human Review Checklist

  • Verify escape sequence decoding order is correct (~1 before ~0 matters per RFC 6901)
  • Consider whether a seed test fixture should be added for AsyncAPI specs with encoded channel paths

Link to Devin run: https://app.devin.ai/sessions/6edd55620e9c49c2a7edd190fe1e16d7
Requested by: @fern-support

Channel paths containing slashes (e.g., /api/v1/ws) are encoded as ~1 in
JSON Pointer references per RFC 6901. The parser now correctly decodes
~1 to / and ~0 to ~ when resolving channel references, enabling proper
parsing of AsyncAPI specs with URL-like channel paths.

Co-Authored-By: blank@buildwithfern.com <blank@buildwithfern.com>
@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI
  • Postman

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant