Skip to content

feat: Update MergeRequestDiscussions to use MergeRequestDiscussionSchema for type consistency#3845

Open
moh3n9595 wants to merge 1 commit into
jdalrymple:mainfrom
moh3n9595:feature/mr-discussion-types
Open

feat: Update MergeRequestDiscussions to use MergeRequestDiscussionSchema for type consistency#3845
moh3n9595 wants to merge 1 commit into
jdalrymple:mainfrom
moh3n9595:feature/mr-discussion-types

Conversation

@moh3n9595
Copy link
Copy Markdown

Changes:

  • Adds a new MergeRequestDiscussionSchema that extends DiscussionSchema with notes?: MergeRequestDiscussionNoteSchema[], so MR-specific note fields (resolved_by, resolved_at, position) are surfaced through the typed API.
  • Updates MergeRequestDiscussions.all, create, resolve, and show (both interface and class) to return MergeRequestDiscussionSchema instead of the generic DiscussionSchema.

Per the GitLab MR Discussions API docs, notes returned from MR discussion endpoints include resolution metadata (resolved_by, resolved_at) and diff position data that aren't present on notes from other discussion resources. The library already modeled this via MergeRequestDiscussionNoteSchema, but the discussion-returning methods still typed their result as DiscussionSchema, so consumers like:

const discussions = await gitlab.MergeRequestDiscussions.all(projectId, mergeRequestIid);

only saw the generic DiscussionNoteSchema on discussions[].notes. This PR threads the MR-specific schema through so the types match the actual response shape.

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