Repository navigation
Align the 2.17 and Preview news endpoints with what the API does - #757
Conversation
Switches the lists to page-number paging and documents page and per_page, gives update its own request schema, documents the 400s and 404s the API returns, and adds the accepted OAuth scopes to each operation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
sender_id is required on update, so the request description now limits "keeps its current value when left out" to the optional fields. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
markdennis22
left a comment
There was a problem hiding this comment.
Thanks. I checked the 2.17 spec with Fern (no new errors or warnings), checked that it parses with no new dangling references, and checked each news endpoint's documented behaviour against how the API responds.
A few questions:
- Reaction entries — Should the request
reactionsdescription say "a single Unicode code point" and "at most five" instead of "a single character"? An emoji with a skin tone, a joiner sequence, a flag or ❤️ with its variation selector is rejected with400"Invalid reaction '…'. Only unicode chars allowed", while a single ASCII letter is accepted. A sixth reaction returns400parameter_invalid. This applies to both the create and update request schemas. newsfeed_assignment.published_atgoing back to null — Should it say "Null while the news item isn't live" rather than "has not gone live"? Setting a live item back to draft clears it, so a once-live item returnsnullagain.- Label order — Should
news_item.labelssay "sorted, uppercase before lowercase" (or just "sorted")? The sort is case-sensitive, soZebracomes beforeapple. - Missing 400 examples — Should Create a news item's
400also show "Invalid state. State can either be draft or live", which create returns too? And should create and update show the future-date error thepublished_atdescription now mentions:parameter_invalid"Invalid published_at . Date cannot be in the future. Scheduling is not supported through API"?
Commenting rather than approving until these are settled.
~ Automated via Claude
Applies the same 2.17 changes to the Preview spec, merged operation by operation so Preview-only content stays, such as the `{id}` path parameter name. The next version is cut from Preview, and the Preview SDKs are generated from it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reactions accept at most five entries, each a single Unicode code point. Labels sort with uppercase letters first, and newsfeed_assignment.published_at goes back to null when an item returns to draft. Create now shows the invalid-state 400, and create and update show the future published_at 400. Applied to 2.17 and Preview. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
cathalging
left a comment
There was a problem hiding this comment.
Required: a create with too many reactions still saves a draft
The "Send at most five" reactions text (2.17 L39452 and L39521, plus the Preview copies) suggests a create request with more than five reactions is rejected. In fact the news item is saved as a draft, with no reactions and no cover image, before the 400 is returned, so each retry leaves another draft. Suggested addition:
On create, the news item is still saved as a draft.
Same fix as on the companion PR. Everything else in this PR looks right.
~ Automated via Claude
yasser-aboelgheit-intercom
left a comment
There was a problem hiding this comment.
Thanks Mark. Both specs parse with no dangling refs, and fern check shows 0 errors and the same 317 warnings as main. I checked the changed claims against the API's behaviour, and nearly all of them hold, including the page-number paging, the per_page defaults and cap, the update-clears-fields behaviour, the 404 on a missing sender_id, the feature-off 404 and the scopes.
A few questions:
-
newsfeed.name"Returned HTML-escaped": as far as I can tell, the API returns the name exactly as stored and doesn't escape it. If you saw&, could it be a name that was saved that way? If so, should this sentence go, in both 2.17 and Preview? -
Null reaction 500 (PR description): a
nullinside a request array is dropped before it reaches the API, soreactions: [null]behaves like[]and disables reactions with a 200. The 500 comes from a non-string item such asreactions: [1]. The non-nullable items change is still right. -
cover_image_url"Must end in.pngor.jpg": the check isn't anchored and is case-sensitive, soa.jpg?sig=…passes, and.jpegand.PNGare rejected. Would "must contain.pngor.jpg" be more accurate? -
"Send at most five" reactions: that limit is only enforced on update. On create, the 400 comes back after the news item has already been created. Worth a clause?
I'm holding off on approving until 1 is settled. The Preview SDK changes in the Risks table also need someone to sign off on them.
~ Automated via Claude
A create request with more than five reactions returns a 400 after the news item is already saved as a draft, with no reactions or cover image. The cover image check matches `.png` or `.jpg` anywhere in the URL and is case-sensitive, so the description now says "contain" and names the rejected `.jpeg` and `.PNG`. The response's reactions list also says that an update leaving out `reactions` disables them without clearing the list. Applied to 2.17 and Preview. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks both. I pushed the fixes, with the same edits in 2.17 and Preview.
~ Automated via Claude |
yasser-aboelgheit-intercom
left a comment
There was a problem hiding this comment.
Thanks Mark, and you're right about the escaping. The API's shared JSON rendering does HTML-escape string values under a name key, so R&D comes back as R&D.
At this head both specs parse with no dangling refs, and fern check still shows 0 errors and the same 317 warnings as main. The new sentence about creating with too many reactions holds: the item is saved as a draft before the reactions and cover image are applied.
Approving. The Preview SDK changes are listed in the Risks table.
~ Automated via Claude
Why?
The 2.17 spec for the news endpoints didn't match the API. The lists described cursor paging where the API pages by number and left out
pageandper_page, updates were documented as requiringtitle, and most error responses were missing. The Preview spec had the same problems, and the next version is cut from Preview, so it needs the same fixes.How?
Corrects the news endpoints and schemas to match the API's current behaviour, and adds the OAuth scopes each endpoint accepts to its description. The same changes go into the Preview spec, keeping content that only applies to Preview, such as the
{id}path parameter name.Risks
The Preview SDKs are generated from this spec, so these changes affect generated Preview types:
PaginatedResponse.pagesbecomesPagesLinkinstead ofCursorPagespages.next.starting_afterPaginatedResponseTypeenum goes, andPaginatedResponse.typebecomes the literallistconversation.listlistUpdateNewsItemRequestwhere onlysender_idis required, with a newUpdateNewsItemRequestStateenum, instead ofNewsItemRequesttitle, which the API doesn't require on updateNewsItem.labels,NewsItem.reactionsandNewsItemRequest.reactionsbecomelist<string>instead oflist<optional<string>>nullitemscover_image_urlonNewsItemRequestpageandper_pageon the three lists, and new400and404errorsNotes for reviewers
fern checkshows 0 errors and the same 317 warnings as main. There are no new dangling refs and no operationId changes, and none of the changed Preview types isunknown.Generated with Claude Code