From 8b0fb02ed2c4368f1c3484757e0b94102144ffe5 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 16 May 2018 23:19:53 -0700 Subject: minor tweaks to API spec --- rust/fatcat-api/README.md | 2 +- rust/fatcat-api/api.yaml | 2 +- rust/fatcat-api/api/swagger.yaml | 1 + rust/fatcat-api/src/models.rs | 7 +++---- rust/fatcat-openapi2.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) (limited to 'rust') diff --git a/rust/fatcat-api/README.md b/rust/fatcat-api/README.md index f363f381..6247d176 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-05-17T05:00:05.471Z +- Build date: 2018-05-17T06:11:30.535Z 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 9ec1f1fb..4f8f1b3d 100644 --- a/rust/fatcat-api/api.yaml +++ b/rust/fatcat-api/api.yaml @@ -95,7 +95,7 @@ definitions: type: object required: - title - - work + - work_id properties: <<: *ENTITYPROPS title: diff --git a/rust/fatcat-api/api/swagger.yaml b/rust/fatcat-api/api/swagger.yaml index 009d0e08..3fa3fa02 100644 --- a/rust/fatcat-api/api/swagger.yaml +++ b/rust/fatcat-api/api/swagger.yaml @@ -1112,6 +1112,7 @@ definitions: type: "object" required: - "title" + - "work_id" properties: issue: type: "string" 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, #[serde(rename = "work_id")] - #[serde(skip_serializing_if = "Option::is_none")] - pub work_id: Option, + 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, diff --git a/rust/fatcat-openapi2.yml b/rust/fatcat-openapi2.yml index 9ec1f1fb..4f8f1b3d 100644 --- a/rust/fatcat-openapi2.yml +++ b/rust/fatcat-openapi2.yml @@ -95,7 +95,7 @@ definitions: type: object required: - title - - work + - work_id properties: <<: *ENTITYPROPS title: -- cgit v1.2.3