Skip to content

Conversation

@sbawabe
Copy link
Contributor

@sbawabe sbawabe commented Dec 9, 2025

Fixes FER-8007 (pt3)

Description

Refs: Requested by Sarah Bawabe (@sbawabe)

Webhook responses defined in OpenAPI specs (e.g., 204, 400, 500 status codes) were not being captured in the IR. This PR adds support for extracting and storing webhook responses in the IR.

Link to Devin run: https://app.devin.ai/sessions/f101e52b58ab44b49d44dc2bc1fd5c81

Changes Made

  • Added responses optional field to IR Webhook type definition (webhooks.yml)
  • Reuses existing http.HttpResponse type instead of creating a new type (per PR feedback)
  • Updated WebhookConverter to process operation.responses from OpenAPI specs
  • Added support for wildcard status codes (e.g., 4XX → 400, 5XX → 500) via isWildcardStatusCode field
  • Added responses: undefined to convertWebhookGroup.ts for Fern-defined webhooks (no response source available)
  • Regenerated IR SDK types
  • Updated test snapshots across multiple packages (register, v3-importer-tests, ir-generator-tests, ete-tests)
  • Added IR migration in v62-to-v61/migrateFromV62ToV61.ts to strip responses field and headers from errors for backward compatibility
  • Added changelog entry in versions.yml for version 3.9.0

Updates Since Last Revision

  • Merged main branch after IR version 63 was deleted
  • Moved migration logic from v63-to-v62/migrateFromV63ToV62.ts to v62-to-v61/migrateFromV62ToV61.ts
  • Deleted the v63-to-v62 migration file
  • Migration now also strips headers field from errors for v61 compatibility
  • Bumped changelog version from 3.8.1 to 3.9.0 (changelog validator requires minor version bump for feat type changes, not patch)
  • Resolved merge conflict with main after 3.8.0 was released

Testing

  • Unit tests updated (snapshots updated for webhook fixtures)
  • Lint checks pass
  • Local compilation verified (ir-generator, ir-migrations, and openapi-to-ir compile successfully)

Human Review Checklist

  • Verify the IR schema change is backward compatible (new field is optional, migration strips it for v61)
  • Confirm body: undefined is acceptable for webhook responses (webhooks don't have response bodies like endpoints)
  • Review wildcard status code conversion (4XX → 400, 5XX → 500 with isWildcardStatusCode: true)
  • Note: Response description from OpenAPI is not captured since HttpResponse doesn't have a docs field - confirm this is acceptable
  • Confirm if FDR propagation is needed - currently responses are captured in IR but not yet surfaced in FDR output

- Add responses field to IR Webhook type definition (webhooks.yml)
- Add WebhookResponse type with statusCode and docs fields
- Update WebhookConverter to process operation responses
- Regenerate IR SDK types
- Update test snapshots to include webhook responses (204, 400, 500)

Co-Authored-By: Sarah Bawabe <[email protected]>
@devin-ai-integration
Copy link
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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2025

🌱 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.

@sbawabe sbawabe self-assigned this Dec 10, 2025
@sbawabe sbawabe requested a review from kennyderek December 10, 2025 19:05
devin-ai-integration bot and others added 7 commits December 10, 2025 19:27
Per PR feedback, reuse the existing http.HttpResponse type instead of
creating a new WebhookResponse type. This provides consistency with
the existing HTTP response handling and supports wildcard status codes
(e.g., 4XX, 5XX) via the isWildcardStatusCode field.

Changes:
- Updated webhooks.yml to use http.HttpResponse instead of WebhookResponse
- Regenerated IR SDK types (removed WebhookResponse type)
- Updated WebhookConverter to create HttpResponse objects with proper
  wildcard status code handling
- Updated test snapshots to reflect new response structure

Co-Authored-By: Sarah Bawabe <[email protected]>
Resolve merge conflict in versions.yml - bump webhook responses feature to 3.8.0 since main already has 3.7.0 for default-integer-format feature

Co-Authored-By: Sarah Bawabe <[email protected]>
@sbawabe sbawabe enabled auto-merge (squash) December 10, 2025 22:48
@sbawabe sbawabe merged commit ce2324d into main Dec 10, 2025
502 of 504 checks passed
@sbawabe sbawabe deleted the devin/1765317066-webhook-responses-fix branch December 10, 2025 23:35
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.

3 participants