Skip to content

Fix GET /data_connectors/{id}: correct schema to use present_detail fields#407

Open
salmanbshah wants to merge 2 commits intomainfrom
salmanshah/revert-data-connectors-show-api
Open

Fix GET /data_connectors/{id}: correct schema to use present_detail fields#407
salmanbshah wants to merge 2 commits intomainfrom
salmanshah/revert-data-connectors-show-api

Conversation

@salmanbshah
Copy link
Contributor

@salmanbshah salmanbshah commented Mar 16, 2026

Why?

The original documentation for GET /data_connectors/{id} (merged in PR #403) used the wrong response schema — it reflected the list-view fields from DataConnectorPresenter.present rather than the richer present_detail that the show action actually calls. Ellice Nelson flagged this: "The schema updates here don't match the fields returned." Customers relying on the docs to build against this endpoint would see fields like data_inputs, response_fields, and object_mappings in real responses that are completely absent from the spec.

How?

Corrected the path entry to reference a new data_connector_detail schema that matches DataConnectorPresenter.present_detail exactly, and added the optional state_version query parameter (live/draft) that the controller supports.

Decisions

  • New data_connector_detail schema rather than patching the existing data_connector schema — the list endpoint uses the simpler fields intentionally and should stay lightweight.
Implementation Plan

Fix data_connectors schema + Surgical developer-docs PR

Context

PR #778 is wrong — it replaces the entire developer-docs Unstable YAML with the Intercom-OpenAPI copy, causing a +1260/-1400 diff with hundreds of unrelated deletions. The two repos were NEVER true mirrors (2033 lines of diff across 123 chunks before our work). PR #777 also made a huge reformat (+2201/-3249) that #778 predates.

The correct approach: add ONLY the 3 missing path entries surgically to the developer-docs YAML (fin_voice was already added by #777).

Confirmed Gaps

Controller Missing Endpoints
api/v3/data_connectors_controller.rb GET /data_connectors/{id} — schema wrong, needs present_detail fields
api/v3/conversation_parts_controller.rb PUT /conversations/{conversation_id}/conversation_parts/{id}
api/v3/messages_controller.rb GET /messages/whatsapp/status

Backend References

Generated with Claude Code

@salmanbshah salmanbshah enabled auto-merge (squash) March 16, 2026 14:03
Copy link
Contributor

@ellicenelson ellicenelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a corresponding developer-docs PR for these changes?

Also this may conflict with new changes on main.

You can retrieve the full detail of a single data connector by its ID.

The response includes full detail about the connector including its configuration, data inputs, response fields, and object mappings.
The response includes configuration, data inputs, response fields, and object mappings. Pass `state_version=draft` to retrieve the unpublished draft version.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function of state_version is still behind a feature flag and is not yet rolled out. This (and the corresponding 400) should be excluded until that change has GA

@@ -1,3 +1,6 @@
## `GET /data_connectors/{id}` schema corrected
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can be consolidated with the existing data connectors changelog entry and can avoid traces of "missing" and "fixed" since this is expected in the Unstable version

schema:
"$ref": "#/components/schemas/data_connector"
"$ref": "#/components/schemas/data_connector_detail"
'400':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

@salmanbshah salmanbshah force-pushed the salmanshah/revert-data-connectors-show-api branch from 41f03af to 5245126 Compare March 16, 2026 16:20
Copy link
Contributor Author

@salmanbshah salmanbshah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Ellice! I've removed the parameter and the 400 response (feature flag not yet GA), and consolidated the changelog entry.

Copy link
Contributor Author

@salmanbshah salmanbshah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate developer-docs PR created for the data connectors show endpoint: https://github.com/intercom/developer-docs/pull/781

@@ -1,5 +1,5 @@
## `GET /data_connectors/{id}` added
Added missing show endpoint for retrieving a single data connector by ID.
## Data Connectors: `GET /data_connectors/{id}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog convention actually lives in developer-docs. I'd actually drop this file and keep changelog entries in developer-docs only for consistency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants