summaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api/src/models.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-16 23:19:53 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-16 23:19:53 -0700
commit8b0fb02ed2c4368f1c3484757e0b94102144ffe5 (patch)
treed94ff028ee78294c321e5894007f57ff31b711f1 /rust/fatcat-api/src/models.rs
parent52b428c3580a4d5d4e2533a3466b68917b08ef35 (diff)
downloadfatcat-8b0fb02ed2c4368f1c3484757e0b94102144ffe5.tar.gz
fatcat-8b0fb02ed2c4368f1c3484757e0b94102144ffe5.zip
minor tweaks to API spec
Diffstat (limited to 'rust/fatcat-api/src/models.rs')
-rw-r--r--rust/fatcat-api/src/models.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs
index 0186f0a0..24c7ad34 100644
--- a/rust/fatcat-api/src/models.rs
+++ b/rust/fatcat-api/src/models.rs
@@ -342,8 +342,7 @@ pub struct ReleaseEntity {
pub container_id: Option<String>,
#[serde(rename = "work_id")]
- #[serde(skip_serializing_if = "Option::is_none")]
- pub work_id: Option<String>,
+ pub work_id: String,
#[serde(rename = "title")]
pub title: String,
@@ -371,7 +370,7 @@ pub struct ReleaseEntity {
}
impl ReleaseEntity {
- pub fn new(title: String) -> ReleaseEntity {
+ pub fn new(work_id: String, title: String) -> ReleaseEntity {
ReleaseEntity {
issue: None,
pages: None,
@@ -379,7 +378,7 @@ impl ReleaseEntity {
doi: None,
release_type: None,
container_id: None,
- work_id: None,
+ work_id: work_id,
title: title,
state: None,
ident: None,