Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Nov 22, 2025

Description

Closes #9551

Fixes a bug where OpenAPI example summaries were being ignored in the v3 importer, causing example names to display as generic "Example 1", "Example 2", etc. instead of the user-provided summary names like "Partner token" and "User token".

Changes Made

  • Modified AbstractMediaTypeObjectConverter.parseMediaTypeObject() to preserve the full OpenAPI ExampleObject structure (including summary and description fields) instead of extracting only the value field
  • Changed line 89: resolved.value.value ?? resolved.valueresolved.value
  • Changed line 91: example.value ?? exampleexample

Testing

  • Lint checks passed
  • Unit tests added/updated - Reviewer note: No new tests were added. The existing test fixture examples-endpoint-level-named should cover this scenario, but this should be verified.
  • Manual testing completed - Reviewer note: Not tested with a real OpenAPI spec

Review Checklist

Critical items to verify:

  1. Type correctness: Confirm that resolved.value and example are of type OpenAPIV3_1.ExampleObject (not just the raw value). The filter on line 93 expects this type, but worth double-checking the resolver methods.
  2. Downstream compatibility: Verify that consumers of these examples (e.g., convertMediaTypeObjectExamples() at line 142) expect the full ExampleObject structure with summary and description fields, not just the raw value.
  3. Test coverage: Check if existing tests (particularly examples-endpoint-level-named.json snapshot) properly validate that example summaries are preserved through the entire pipeline.
  4. Regression test: Consider whether a specific regression test should be added for this issue.

Session: https://app.devin.ai/sessions/107aa7cf711e4608937bfcad07d6c5b7
Requested by: @dannysheridan ([email protected])

Fixes #9551

The bug was in AbstractMediaTypeObjectConverter.parseMediaTypeObject where
example objects were being reduced to just their values, discarding the
summary and description fields. This caused example names to be lost,
resulting in generic 'Example 1/2/3' labels instead of the user-provided
summary names like 'Partner token' and 'User token'.

The fix preserves the full example object (including summary and description)
instead of extracting only the value field.

Co-Authored-By: [email protected] <[email protected]>
@devin-ai-integration
Copy link
Contributor Author

🤖 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

devin-ai-integration bot and others added 2 commits November 23, 2025 00:06
… displayName

This commit implements the bigger fix to properly convert OpenAPI examples
from the examples field into v2Examples format. The key changes are:

1. Populate convertedResponseBody.examples field when ResponseBodyConverter
   returns examples from the OpenAPI examples field
2. Add convertOpenapiExamplesToFernExamples method to convert OpenAPI
   examples (with summary fields) into Fern example format
3. Use the summary field as the example name (displayName) when available
4. Merge OpenAPI examples with x-fern-examples and x-code-samples examples
5. Set displayName in convertEndpointExamples to preserve example names

This fix ensures that OpenAPI example summaries are properly converted
into v2Examples and displayed in the documentation UI instead of generic
'Example 1', 'Example 2' labels.

Also reverted the previous FDR conversion layer fix since this bigger fix
handles the issue properly at the source (OpenAPI-to-IR conversion).

Co-Authored-By: [email protected] <[email protected]>
@chdeskur chdeskur closed this Nov 26, 2025
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.

OpenAPI example summaries are ignored in latest CLI version

2 participants