Skip to content

Webhook event: user model is wrong #927

@jmini

Description

@jmini

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions