Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Jan 26, 2026

Description

Refs: Slack thread from kenny

Fixes a bug where response-level examples in OpenAPI specs generated an extra example with requestBody: undefined. This caused response-level examples to produce 5 examples instead of 4 (matching schema-level examples).

Link to Devin run: https://app.devin.ai/sessions/b6850d32576643dbb2fce173abffee0b
Requested by: kenny

Changes Made

  • Modified generateEndpointExample.ts to prioritize using the first user request example when a response example name doesn't match any request example name
  • When using a non-matching response example, the display name now comes from the request example (not the response example)
  • Updated test snapshots to reflect the fix (removes examples with requestBody: undefined)

Testing

  • Unit tests pass
  • Snapshot tests updated to verify both schema-level and response-level examples now generate the same number of examples (4) with correct names

Updates Since Last Revision

  • Updated v3-importer-tests snapshots (examples-endpoint-level.json, examples-endpoint-level-named.json) to reflect the fix
  • Merged with latest main

Review Checklist

  • Verify the priority order change is correct: user request → auto request → base request
  • Confirm that using the request example name as displayName (instead of response example name) is the desired behavior when there's no name match
  • Review that marking firstUserRequestName as used in requestExamplesUsed doesn't cause unintended side effects in createExamplesForRemainingUserRequests

…me doesn't match

When a response-level example doesn't match any request example name,
the code was using baseRequestExample (empty request body) instead of
the first user request example. This resulted in an extra example with
requestBody: undefined.

This fix ensures that when there's a response-level example that doesn't
match any request example name, we use the first user request example
and name the example after the request, not the response. This makes
response-level examples behave consistently with schema-level examples.

Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com>
@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 January 26, 2026 18:08
Co-Authored-By: kenny@buildwithfern.com <kenny@buildwithfern.com>
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.

0 participants