Skip to content

Make key and name field on User struct optional #4

@Lilit0x

Description

@Lilit0x

Hello, I encountered a recurring error while using this crate to interface with private Jira repositories. Specifically, I traced the issue to line 254 in the access.rs file. The problem arises because the assignee, reporter, and creator fields in the user struct expected by serde do not contain the key and name fields when interfacing with private Jira instances. These fields are present and correctly parsed in public instances.

Upon further investigation, I found that the response object from the REST API for private instances lacks these fields. Here’s an example response object that led to the parsing error:

 Object {
        "self": String("https://test-XXXXX.atlassian.net/rest/api/2/user?accountId=60b5d585a5be0a0069c3e29a"),
        "accountId": String("60b5d585a5be0a0069c3e29a"),
        "emailAddress": String("XXXXXX@gmail.com"),
        "avatarUrls": Object {
            "48x48": String("https://secure.gravatar.com/avatar/d64a6df37807a7fdb555d153bffc18d3?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FA-6.png"),
            "24x24": String("https://secure.gravatar.com/avatar/d64a6df37807a7fdb555d153bffc18d3?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FA-6.png"),
            "16x16": String("https://secure.gravatar.com/avatar/d64a6df37807a7fdb555d153bffc18d3?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FA-6.png"),
            "32x32": String("https://secure.gravatar.com/avatar/d64a6df37807a7fdb555d153bffc18d3?d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FA-6.png"),
        },
        "displayName": String("XXXXX"),
        "active": Bool(true),
        "timeZone": String("Asia/Calcutta"),
        "accountType": String("atlassian"),
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions