Repository navigation
Remove Preview SDK request body overrides that point at missing schemas - #750
yasser-aboelgheit-intercom wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
cathalging
left a comment
There was a problem hiding this comment.
Two more overrides point at missing schemas
The four repoints here are right. Each new target is what the Preview spec's own requestBody already uses, so the SDK and the docs now agree for those operations.
Required: data attributes have the same problem
fern/preview-openapi-overrides.yml:8 and :15:
$ref: '#/components/schemas/CreateDataAttributeRequest' # POST /data_attributes
$ref: '#/components/schemas/UpdateDataAttributeRequest' # PUT /data_attributes/{id}Neither schema is defined in descriptions/0 or in the overrides file. The defined ones are create_data_attribute_request and update_data_attribute_request. The generated Preview SDK shows the same symptom as the other four: createDataAttribute(request?: unknown). Repointing these two would make the file fully clean.
| Operation | Current target | Suggested target |
|---|---|---|
| POST /data_attributes | CreateDataAttributeRequest (missing) |
create_data_attribute_request |
| PUT /data_attributes/{id} | UpdateDataAttributeRequest (missing) |
update_data_attribute_request |
@yasser-aboelgheit-intercom, would you rather fold these two into this PR, or merge the four and follow up with data attributes separately?
Optional
- Delete the override blocks instead. Each repointed block now just repeats what the spec already says, so removing it gives the same merged spec. Fern Check reports 0 errors and 317 warnings with or without these broken refs, so a future rename would break a repeated block again without any warning.
- Heads-up for the release notes: each request goes from accepting anything to a named type, which changes the method signature for Preview SDK callers. Fields that become required:
nameandcategoryon ticket types, andphoneon phone call redirects.
~ Automated via Claude (about: https://github.com/intercom/claude-plugins/blob/main/plugins/base/docs/external-message-attribution.md)
cathalging
left a comment
There was a problem hiding this comment.
Approving. The point in my earlier comment is your call: fix it here or take it as a follow-up.
~ Automated via Claude (about: https://github.com/intercom/claude-plugins/blob/main/plugins/base/docs/external-message-attribution.md)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
yasser-aboelgheit-intercom
left a comment
There was a problem hiding this comment.
Thanks for this. I checked it with fern check (0 errors, same warnings as main) and the Fern IR before and after, checked every $ref in the overrides file against the Preview spec, and checked the required fields against how the API behaves. There's no companion docs PR because this only touches the Fern overrides.
- All six removed overrides pointed at schemas that don't exist in the Preview spec. After this PR, every remaining
$refin the file resolves. - In the IR, the six request bodies change from
unknownto named types:CreateArticleRequest,CreateDataAttributeRequest,UpdateDataAttributeRequestBody,CreateOrUpdateCompanyRequest,CreatePhoneSwitchRequestandCreateTicketTypeRequest. The IR'sunknowncount drops by 7. - The API does require the fields the PR mentions. Ticket types need
name, andcategoryon 2.10+ and Preview. Phone call redirects needphone.
A few questions:
- Preview SDK signatures — Six Preview SDK methods change from taking
unknownto taking typed requests with required fields. That's the point of the PR, but it changes method signatures, so callers who passed a loose object may see compile errors. Could someone who owns the SDK release confirm that's fine for a Preview release? - Phone call redirect error shape — If
phoneis missing, the API returns 422 with{"error_key": "caller_phone"}rather than the usualerror.list. That's outside this PR, but worth a follow-up so the documented error matches.
Not approving: this is my own PR, and item 1 needs a human decision.
~ Automated via Claude
cathalging
left a comment
There was a problem hiding this comment.
Re-approving. Removing the blocks is the cleaner fix: each one only repeated the spec's own request body, the two data attribute overrides that pointed at missing schemas are gone with them, and the overrides file no longer has any $ref left to go stale. For the release notes: six Preview request types go from untyped to named types, with name/category (ticket types), phone (phone call redirects) and name/model/data_type (create data attribute) becoming required.
~ Automated via Claude (about: https://github.com/intercom/claude-plugins/blob/main/plugins/base/docs/external-message-attribution.md)
Why?
Six Preview SDK overrides pointed at request schemas that don't exist, so the generated Preview SDK typed those requests as
unknown. This covers creating and updating a data attribute, and creating an article, a company, a phone call redirect and a ticket type.How?
Removes those override blocks so Fern uses the request schemas the Preview spec already defines. Each of these Preview SDK methods now takes a named request type instead of
unknown, so callers will see required fields such asnameandcategoryon ticket types andphoneon phone call redirects.Generated with Claude Code