Created
December 3, 2019 14:21
-
-
Save mantono/64c56aaba0c6235a4820f64e18d5bb1c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"__typename": "Issue", | |
"number": 4, | |
"databaseId": 461065166, | |
"title": "Send ETAG and Cache-Control headers", | |
"body": "", | |
"url": "https://github.com/owner/my-repo/issues/4", | |
"state": "OPEN", | |
"updatedAt": "2019-07-01T09:50:21Z", | |
"createdAt": "2019-06-26T16:18:41Z", | |
"labels": { | |
"nodes": [] | |
}, | |
"repository": { | |
"nameWithOwner": "owner/my-repo" | |
}, | |
"comments": { | |
"totalCount": 0 | |
}, | |
"reactions": { | |
"totalCount": 0 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use serde::Deserialize; | |
#[derive(Debug, Deserialize)] | |
pub struct Issue { | |
pub url: String, | |
#[serde(alias = "databaseId")] | |
pub id: u64, | |
pub number: u32, | |
pub title: String, | |
#[serde(alias = "bodyText")] | |
pub body: Option<String>, | |
#[serde(alias = "updatedAt")] | |
pub updated_at: String, | |
pub state: ghrs::State, | |
pub comments: u32, | |
pub assignees: Vec<Assignee>, | |
pub labels: Vec<Label>, | |
pub repository: String, // How can I read 'repository -> nameWithOwner' directly? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment