Skip to content

Conversation

@aditya-arolkar-swe
Copy link
Contributor

Description

Refs: Slack thread from @aditya-arolkar-swe

Link to Devin run: https://app.devin.ai/sessions/2143d4e4bc654af4b7ca3d0aee402c1c

This PR adds support for the x-fern-parameter-name extension on websocket query parameters in AsyncAPI specs. Previously, this extension was only supported for HTTP endpoint parameters, and websocket query parameters always had parameterNameOverride set to undefined.

This enables users to rename websocket query parameters in generated SDKs to avoid naming conflicts (e.g., when a query parameter and an event type would generate the same property name).

Changes Made

  • Updated parseAsyncAPIV2.ts to extract x-fern-parameter-name extension for websocket query parameters (both reference and non-reference schemas)
  • Updated parseAsyncAPIV3.ts to extract x-fern-parameter-name extension for websocket channel parameters
  • Added test fixture asyncapi-websocket-parameter-name to validate the feature

Testing

  • Unit tests added (new test fixture with snapshots)
  • Lint checks pass

Human Review Checklist

  • Verify the extension extraction logic matches how it's done for HTTP parameters in convertParameters.ts
  • Confirm both AsyncAPI v2 code paths (reference objects at line 186-189 and non-reference at line 212) are correctly updated
  • Check that the generated Fern definition correctly uses name: field for overridden parameters (visible in snapshot at chat.yml)

…parameters

Co-Authored-By: adi@buildwithfern.com <aditya.arolkar@berkeley.edu>
@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

🌱 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.

2 participants