From 39456677cdc9768ad0dea76be4fd36735eec3ed2 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 16 May 2018 20:55:01 -0700 Subject: simplify API a bit --- rust/fatcat-api/README.md | 2 +- rust/fatcat-api/api.yaml | 9 ++++----- rust/fatcat-api/api/swagger.yaml | 17 ++++++++--------- rust/fatcat-api/src/models.rs | 26 ++++++++++---------------- rust/fatcat-openapi2.yml | 9 ++++----- 5 files changed, 27 insertions(+), 36 deletions(-) diff --git a/rust/fatcat-api/README.md b/rust/fatcat-api/README.md index 25d89337..2d14b35f 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-16T05:34:17.733Z +- Build date: 2018-05-17T03:54:00.627Z 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 01e0b60c..b5993244 100644 --- a/rust/fatcat-api/api.yaml +++ b/rust/fatcat-api/api.yaml @@ -74,8 +74,6 @@ definitions: <<: *ENTITYPROPS name: type: string - parent: - type: string publisher: type: string issn: @@ -97,13 +95,14 @@ definitions: type: object required: - title + - work properties: <<: *ENTITYPROPS - work: + title: type: string - container: + work_id: type: string - license: + container_id: type: string release_type: type: string diff --git a/rust/fatcat-api/api/swagger.yaml b/rust/fatcat-api/api/swagger.yaml index 3d3c2591..8dddf317 100644 --- a/rust/fatcat-api/api/swagger.yaml +++ b/rust/fatcat-api/api/swagger.yaml @@ -1037,8 +1037,6 @@ definitions: type: "string" publisher: type: "string" - parent: - type: "string" name: type: "string" state: @@ -1058,7 +1056,6 @@ definitions: type: "integer" example: redirect: "redirect" - parent: "parent" editgroup: 6 issn: "issn" ident: "ident" @@ -1104,6 +1101,8 @@ definitions: upperCaseName: "FILE_ENTITY" release_entity: type: "object" + required: + - "title" properties: issue: type: "string" @@ -1115,11 +1114,11 @@ definitions: type: "string" release_type: type: "string" - license: + container_id: type: "string" - container: + work_id: type: "string" - work: + title: type: "string" state: type: "string" @@ -1137,18 +1136,18 @@ definitions: editgroup: type: "integer" example: - container: "container" redirect: "redirect" + work_id: "work_id" editgroup: 6 issue: "issue" - work: "work" ident: "ident" release_type: "release_type" + title: "title" revision: 0 volume: "volume" - license: "license" pages: "pages" state: "wip" + container_id: "container_id" doi: "doi" upperCaseName: "RELEASE_ENTITY" work_entity: diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs index 2b187eaf..82fe7bad 100644 --- a/rust/fatcat-api/src/models.rs +++ b/rust/fatcat-api/src/models.rs @@ -42,10 +42,6 @@ pub struct ContainerEntity { #[serde(skip_serializing_if = "Option::is_none")] pub publisher: Option, - #[serde(rename = "parent")] - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option, - #[serde(rename = "name")] pub name: String, @@ -76,7 +72,6 @@ impl ContainerEntity { ContainerEntity { issn: None, publisher: None, - parent: None, name: name, state: None, ident: None, @@ -275,17 +270,16 @@ pub struct ReleaseEntity { #[serde(skip_serializing_if = "Option::is_none")] pub release_type: Option, - #[serde(rename = "license")] + #[serde(rename = "container_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub license: Option, + pub container_id: Option, - #[serde(rename = "container")] + #[serde(rename = "work_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub container: Option, + pub work_id: Option, - #[serde(rename = "work")] - #[serde(skip_serializing_if = "Option::is_none")] - pub work: Option, + #[serde(rename = "title")] + pub title: String, // Note: inline enums are not fully supported by swagger-codegen #[serde(rename = "state")] @@ -310,16 +304,16 @@ pub struct ReleaseEntity { } impl ReleaseEntity { - pub fn new() -> ReleaseEntity { + pub fn new(title: String) -> ReleaseEntity { ReleaseEntity { issue: None, pages: None, volume: None, doi: None, release_type: None, - license: None, - container: None, - work: None, + container_id: None, + work_id: None, + title: title, state: None, ident: None, revision: None, diff --git a/rust/fatcat-openapi2.yml b/rust/fatcat-openapi2.yml index 01e0b60c..b5993244 100644 --- a/rust/fatcat-openapi2.yml +++ b/rust/fatcat-openapi2.yml @@ -74,8 +74,6 @@ definitions: <<: *ENTITYPROPS name: type: string - parent: - type: string publisher: type: string issn: @@ -97,13 +95,14 @@ definitions: type: object required: - title + - work properties: <<: *ENTITYPROPS - work: + title: type: string - container: + work_id: type: string - license: + container_id: type: string release_type: type: string -- cgit v1.2.3