Skip to content

API reference sections ignore collapsed: open-by-default in production (dropped on apiPackage nodes) #16984

Description

@2opremio

Component

Docs

Priority

P2 - Medium (Would be helpful)

Bug Description

API reference sections set to collapsed: open-by-default in docs.yml render collapsed in the published (hosted) docs instead of expanded.

Steps to reproduce:

  1. In docs.yml, add an api reference with sections using collapsed: open-by-default:
    - api: Endpoints
      collapsed: open-by-default
      layout:
        - section: Metrics
          collapsed: open-by-default
          contents:
            - GET /v0/metrics
  2. Publish (fern generate --docs).
  3. Open any endpoint page on the hosted site.

Expected: the sections are expanded on load.

Actual: the sections are collapsed.

In the published RSC payload, the apiPackage nodes carry "collapsed":"$undefined" for every section:

{"type":"apiPackage","id":"api-pkg:api/endpoints/metrics","collapsed":"$undefined", ...}

Running fern docs dev locally renders the same sections expanded, and its nav payload has "collapsed":"open-by-default". So the CLI parses the config correctly; the hosted publish path drops collapsed specifically on the auto-generated apiPackage nodes. collapsed set on the api: node itself is dropped too.

Live example: https://docs.agora.finance/api/endpoints/metrics/get — Auth / Metrics / Accounts / Routes / Transactions all render collapsed.

Environment:

  • OS: macOS 15 (darwin 25.5.0)
  • Reproduced against the hosted docs at docs.agora.finance

Versions

Fern CLI version (from fern.config.json): 5.67.1. Also reproduced on 5.64.3.

Workaround

None found. Upgrading the CLI 5.64.3 → 5.67.1 and republishing did not change the behavior.

Are you interested in contributing a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions