summaryrefslogtreecommitdiffstats
path: root/rust
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-06-28 12:08:32 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-06-28 12:08:34 -0700
commitf30e45c3eae4371cc5f1bee030791187a173c284 (patch)
treedf93d670ab49afbebbaf3d173f820c4b12c4ea81 /rust
parent794aa05969238517d3f21780c5450e1ca5c98a90 (diff)
downloadfatcat-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')
-rw-r--r--rust/fatcat-api/README.md2
-rw-r--r--rust/fatcat-api/api.yaml1
-rw-r--r--rust/fatcat-api/api/swagger.yaml1
-rw-r--r--rust/fatcat-api/src/models.rs7
4 files changed, 5 insertions, 6 deletions
diff --git a/rust/fatcat-api/README.md b/rust/fatcat-api/README.md
index 572bcbc5..fe725d7f 100644
--- a/rust/fatcat-api/README.md
+++ b/rust/fatcat-api/README.md
@@ -13,7 +13,7 @@ To see how to make this your own, look here:
[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md)
- API version: 0.1.0
-- Build date: 2018-06-21T18:49:41.205Z
+- Build date: 2018-06-28T19:08:07.508Z
This autogenerated project defines an API crate `fatcat` which contains:
* An `Api` trait defining the API in Rust.
diff --git a/rust/fatcat-api/api.yaml b/rust/fatcat-api/api.yaml
index 2326f225..eba6b63c 100644
--- a/rust/fatcat-api/api.yaml
+++ b/rust/fatcat-api/api.yaml
@@ -129,7 +129,6 @@ definitions:
type: object
required:
- title
- - work_id
properties:
<<: *ENTITYPROPS
title:
diff --git a/rust/fatcat-api/api/swagger.yaml b/rust/fatcat-api/api/swagger.yaml
index 1a719322..8a328822 100644
--- a/rust/fatcat-api/api/swagger.yaml
+++ b/rust/fatcat-api/api/swagger.yaml
@@ -1710,7 +1710,6 @@ definitions:
type: "object"
required:
- "title"
- - "work_id"
properties:
refs:
type: "array"
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,