Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use super::types::*;

/// Structured error response from the Detail API
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct ApiError {
#[serde(rename = "type")]
error_type: String,
message: String,
#[serde(rename = "statusCode")]
status_code: u16,
}

Expand Down
17 changes: 5 additions & 12 deletions src/api/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,30 +89,27 @@ pub struct BugsResponse {
}

#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Bug {
pub id: BugId,
pub title: String,
pub summary: String,
#[serde(rename = "filePath")]
pub file_path: Option<String>,
#[serde(rename = "createdAt", deserialize_with = "deserialize_timestamp")]
#[serde(deserialize_with = "deserialize_timestamp")]
pub created_at: i64,
pub review: Option<BugReview>,
#[serde(rename = "repoId")]
pub repo_id: RepoId,
#[serde(rename = "commitSha")]
pub commit_sha: Option<String>,
#[serde(rename = "isSecurityVulnerability")]
pub is_security_vulnerability: Option<bool>,
}

#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BugReview {
pub id: BugReviewId,
pub state: BugReviewState,
#[serde(rename = "createdAt", deserialize_with = "deserialize_timestamp")]
#[serde(deserialize_with = "deserialize_timestamp")]
pub created_at: i64,
#[serde(rename = "dismissalReason")]
pub dismissal_reason: Option<BugDismissalReason>,
pub notes: Option<String>,
}
Expand Down Expand Up @@ -171,19 +168,15 @@ pub struct ReposResponse {
}

#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Repo {
pub id: RepoId,
pub name: String,
#[serde(rename = "ownerName")]
pub owner_name: String,
#[serde(rename = "fullName")]
pub full_name: String,
pub visibility: String,
#[serde(rename = "primaryBranch")]
pub primary_branch: String,
#[serde(rename = "orgId")]
pub org_id: OrgId,
#[serde(rename = "orgName")]
pub org_name: String,
}

Expand Down