Skip to content

docs(api): declare collaborators on the track schema in the OpenAPI spec#946

Merged
raymondjacobson merged 1 commit into
mainfrom
claude/collab-swagger-collaborators
Jun 9, 2026
Merged

docs(api): declare collaborators on the track schema in the OpenAPI spec#946
raymondjacobson merged 1 commit into
mainfrom
claude/collab-swagger-collaborators

Conversation

@raymondjacobson

Copy link
Copy Markdown
Member

Makes the SDK-generated collaborators field durable.

Why

The track response already returns collaborators (an array of accepted collaborator users, added in #932). But the embedded swagger spec (api/swagger/swagger-v1.yaml, served at /v1/swagger.yaml) never declared it. The apps SDK is generated from this spec via openapi-generator, and the generated models' FromJSONTyped only copy fields present in the spec — so collaborators was silently dropped during deserialization, and the field never reached the client even though the API returned it.

(The apps PR currently hand-edits the generated Track.ts/SearchTrack.ts to add the field. That works, but the next npm run gen would overwrite it. This PR fixes the root: declare the field in the spec so codegen reproduces it.)

Change

Add collaborators (array of user) to the track and search_track schemas — the two schemas that produce the SDK Track and SearchTrack models the apps adapter consumes. The generated output (collaborators?: Array<User> + the standard array-map in FromJSONTyped/ToJSON) exactly matches the apps hand-edit, so a regen is a no-op for those files.

Not included (deliberately)

  • Notification types (track_collaborator_invite/_accept): the apps SDK notification models are hand-authored as one shared TrackCollaboratorNotification, but generating two swagger schemas would emit two differently-named models — making this a rename + rewire that needs a verified generator run, not a clean spec addition. Tracked separately.
  • /collaboration_invites: no SDK consumer exists yet, so there's nothing for codegen to protect.

Spec validates (YAML OK) and the binary builds (the spec is //go:embed-ed).

🤖 Generated with Claude Code

…I spec

The track response already returns `collaborators` (added in #932), but the
embedded swagger spec didn't declare it — so SDK codegen (which generates from
this spec) silently omits the field and clients that deserialize via the
generated models drop it. Add `collaborators` (array of users) to the `track`
and `search_track` schemas so the generated SDK Track/SearchTrack models include
it, matching the API's actual response.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@raymondjacobson raymondjacobson merged commit ad11aed into main Jun 9, 2026
5 checks passed
@raymondjacobson raymondjacobson deleted the claude/collab-swagger-collaborators branch June 9, 2026 23:26
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.

1 participant