Skip to content

Webhook event: user model is wrong #927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jmini opened this issue Mar 17, 2023 · 1 comment
Closed

Webhook event: user model is wrong #927

jmini opened this issue Mar 17, 2023 · 1 comment

Comments

@jmini
Copy link
Collaborator

jmini commented Mar 17, 2023

In all the webhook events the user is represented as:

{
    "id": 1,
    "name": "Administrator",
    "username": "root",
    "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40\u0026d=identicon",
    "email": "admin@example.com"
}

So not all the attributes that you would get when reading a user get are available.

Example: "Note Hook (comment event)"

It should be something like EventUser that contains only the 5 attributes that are available, otherwise when you read the event like this:

public static void printWebUrl(NoteEvent event) {
	System.out.println(event.getUser().getWebUrl());
}

And this will always return null since the value was not sent by GitLab.

jmini added a commit to jmini/gitlab4j-api that referenced this issue Apr 13, 2023
jmini added a commit to jmini/gitlab4j-api that referenced this issue Apr 13, 2023
jabby pushed a commit that referenced this issue Jun 13, 2023
@jmini
Copy link
Collaborator Author

jmini commented Jun 16, 2023

Fixed with PR #952

@jmini jmini closed this as completed Jun 16, 2023
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

No branches or pull requests

1 participant