Skip to content

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

Merged
salmanbshah merged 4 commits intomainfrom
salmanshah/revert-data-connectors-show-api
Mar 20, 2026
Merged

Fix GET /data_connectors/{id}: correct schema to use present_detail fields#407
salmanbshah merged 4 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.

@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

salmanbshah and others added 3 commits March 20, 2026 09:03
Changelog convention lives in developer-docs, not this repo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@salmanbshah salmanbshah force-pushed the salmanshah/revert-data-connectors-show-api branch from 5245126 to 17117c7 Compare March 20, 2026 09:03
type: string
description: The URL path to fetch execution results for this connector.
example: "/data_connectors/12345/execution_results"
data_connector_detail:
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing enums on data_connector_detail schema

These 9 fields are backed by Rails enums or frozen constant arrays but are documented as freeform type: string:

Field Values
audiences[] users, leads, visitors
execution_type server_side, client_side
configuration_response_type test_response_type, mock_response_type
data_transformation_type full_access, redacted_access, code_block_transformation
data_inputs[].type string, integer, decimal, boolean
data_inputs[].source fin, custom, attribute
response_fields[].type unknown, string, integer, decimal, datetime, boolean
object_mappings[].intercom_object_type conversation, user
attribute_mappings[].mapping_type primitive_mapping, context_mapping
reference_mappings[].intercom_object_type conversation, user

type: string
description: The Intercom conversation ID
required: true
source: conversation
Copy link
Contributor

Choose a reason for hiding this comment

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

source: conversation is not a valid value. It's restricted to fin, custom, attribute. Fin is the common example

Per review: 9 fields backed by Rails enums now have proper enum
constraints. Fixed invalid source: conversation → fin in example.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

🚀

@salmanbshah salmanbshah merged commit 8139e51 into main Mar 20, 2026
3 checks passed
@salmanbshah salmanbshah deleted the salmanshah/revert-data-connectors-show-api branch March 20, 2026 11:59
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