diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-06-28 12:08:32 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-06-28 12:08:34 -0700 |
commit | f30e45c3eae4371cc5f1bee030791187a173c284 (patch) | |
tree | df93d670ab49afbebbaf3d173f820c4b12c4ea81 /rust/fatcat-api/src | |
parent | 794aa05969238517d3f21780c5450e1ca5c98a90 (diff) | |
download | fatcat-f30e45c3eae4371cc5f1bee030791187a173c284.tar.gz fatcat-f30e45c3eae4371cc5f1bee030791187a173c284.zip |
make release_rev.work_id optional in openapi spec
This is to enable auto-creation of works, speeding up bulk insertion.
Diffstat (limited to 'rust/fatcat-api/src')
-rw-r--r-- | rust/fatcat-api/src/models.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs index fd9e8658..60330392 100644 --- a/rust/fatcat-api/src/models.rs +++ b/rust/fatcat-api/src/models.rs @@ -509,7 +509,8 @@ pub struct ReleaseEntity { pub container_id: Option<String>, #[serde(rename = "work_id")] - pub work_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub work_id: Option<String>, #[serde(rename = "title")] pub title: String, @@ -541,7 +542,7 @@ pub struct ReleaseEntity { } impl ReleaseEntity { - pub fn new(work_id: String, title: String) -> ReleaseEntity { + pub fn new(title: String) -> ReleaseEntity { ReleaseEntity { refs: None, contribs: None, @@ -556,7 +557,7 @@ impl ReleaseEntity { release_status: None, release_type: None, container_id: None, - work_id: work_id, + work_id: None, title: title, state: None, ident: None, |