Skip to content

OpenAPI example summaries are ignored in latest CLI version #9551

@hkosova

Description

@hkosova

Which Fern component?

Fern Docs

How urgent is this?

P2 - Medium (Would be helpful)

What's the issue?

Recent versions of Fern CLI ignore request example names defined using OpenAPI keyword examples.<...>.summary, and instead shows the example names as "Example 1/2/3/..."


Sample OpenAPI spec
openapi: 3.1.0
info:
  title: test
  version: 1.0.0
servers:
  - url: https://httpbin.org/anything
paths:
  /something:
    post:
      summary: Do something
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Foo'
            examples:
              partner_token:
                summary: Partner token
                value:
                  foo: partner
              user_token:
                summary: User token
                value:
                  foo: user
      responses:
        '200':
          description: ok
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Foo'

components:
  schemas:
    Foo:
      type: object
      required: [foo]
      properties:
        foo:
          type: string

Actual result

When using Fern CLI 0.78.0, API reference displays request example names as "Example 1" and "Example 2" instead of the names defined in the spec:

Expected result

Example names should be "Partner token" and "User token", as defined in the OpenAPI spec.

It works fine with Fern CLI 0.58.5 + openapi-parser-v3: false:

Fern CLI & Generator Versions

Fern CLI 0.78.0
Node.js 20.18.0

Workaround

Use x-fern-examples instead of OpenAPI examples.

Are you interested in contributing a fix?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions