Fix: Allow null for avatar_url in GitLab schemas #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a validation error in the
search_repositories
MCP call whereitems.0.owner.avatar_url
was expected to be a string but receivednull
from the GitLab API.Closes #84
Problem Solved:
The GitLab API can return
null
for a user'savatar_url
if they haven't set one. The existing schemas inschemas.ts
did not account for this, definingavatar_url
strictly asz.string()
, leading to validation errors [1].Changes Made:
The
avatar_url
field has been made nullable in the relevant Zod schemas withinschemas.ts
:GitLabOwnerSchema
(around line 255):[1]
Union type for user object (around line 214):
[1]
GitLabForkParentSchema
owner object (around line 595):[1]
These changes ensure that the schema validation correctly handles
null
values foravatar_url
returned by the GitLab API.Verification:
After applying these changes:
gitlab-mcp
was successfully completed.search_repositories
MCP call was executed again.Invalid arguments: items.0.owner.avatar_url: Expected string, received null
error, confirming the fix.