Skip to content

fix: support x-displayName extension on OpenAPI tags#14130

Open
jon-fern wants to merge 1 commit intomainfrom
devin/1774551159-fix-tag-display-names
Open

fix: support x-displayName extension on OpenAPI tags#14130
jon-fern wants to merge 1 commit intomainfrom
devin/1774551159-fix-tag-display-names

Conversation

@jon-fern
Copy link
Copy Markdown
Contributor

Description

Refs Slack thread — Phil Freo reported that:

  1. Tag names like "WhatsApp" get mangled to "Whats App" because of titleCase processing
  2. The x-displayName extension on tags is not being respected in the documentation sidebar

This PR adds support for the x-displayName OpenAPI extension on tags, allowing users to explicitly control the display name used in Fern definitions and docs navigation.

Changes Made

  • Added displayName optional field to the OpenAPI IR Tag type and regenerated SDK types
  • Updated generateIr.ts to extract x-displayName from OpenAPI tag objects
  • Updated buildServices.ts fallback chain: group?.summary → irTag?.displayName → irTag?.id
  • Updated DocsDefinitionResolver.ts to pass displayName through openApiTags
  • Updated ApiReferenceNodeConverter.ts to use displayName for tag description page headings
  • Updated existing tests to include the new displayName field
  • Added tag-display-names test fixture with x-displayName examples
  • Added CLI changelog entry (v4.46.3)

Important Review Notes

  • Partial fix: This gives users a workaround via x-displayName, but tags without x-displayName will still go through titleCase, which can mangle names like "WhatsApp" → "Whats App". Addressing the root titleCase behavior is a larger change that may warrant a separate PR.
  • Extension access pattern: Uses (tag as unknown as Record<string, unknown>)["x-displayName"] since the OpenAPI TS types don't expose extension properties. This is a common pattern in the codebase.
  • No IR migration needed: The displayName field is on the OpenAPI IR (openapi-ir), not the main Fern IR, so no IR migration is required.

Testing

  • Existing tests updated to match new type signatures
  • Local compilation verified (pnpm compile passes for all affected packages)
  • Biome lint check passes (pnpm run check)
  • Seed test output not generated for the new fixture (fixture has no generator entries)

Link to Devin session: https://app.devin.ai/sessions/83ca6010faff45f89f5ac888d9389227
Requested by: @jon-fern

Co-Authored-By: jon <jon@buildwithfern.com>
@devin-ai-integration
Copy link
Copy Markdown
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

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

Tip: disable this comment in your organization's Code Review settings.

@github-actions
Copy link
Copy Markdown
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.

@devin-ai-integration
Copy link
Copy Markdown
Contributor

Closing this PR to recreate with correct title format (missing scope). New PR incoming.

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