diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-16 20:55:01 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-16 20:55:01 -0700 |
commit | 39456677cdc9768ad0dea76be4fd36735eec3ed2 (patch) | |
tree | 378dbea08ba05030a6ede6ca17233bc18fc6c756 /rust | |
parent | 7476d63f0b9adec8087919a776b1bc4bf14b157d (diff) | |
download | fatcat-39456677cdc9768ad0dea76be4fd36735eec3ed2.tar.gz fatcat-39456677cdc9768ad0dea76be4fd36735eec3ed2.zip |
simplify API a bit
Diffstat (limited to 'rust')
-rw-r--r-- | rust/fatcat-api/README.md | 2 | ||||
-rw-r--r-- | rust/fatcat-api/api.yaml | 9 | ||||
-rw-r--r-- | rust/fatcat-api/api/swagger.yaml | 17 | ||||
-rw-r--r-- | rust/fatcat-api/src/models.rs | 26 | ||||
-rw-r--r-- | 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<String>, - #[serde(rename = "parent")] - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option<String>, - #[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<String>, - #[serde(rename = "license")] + #[serde(rename = "container_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub license: Option<String>, + pub container_id: Option<String>, - #[serde(rename = "container")] + #[serde(rename = "work_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub container: Option<String>, + pub work_id: Option<String>, - #[serde(rename = "work")] - #[serde(skip_serializing_if = "Option::is_none")] - pub work: Option<String>, + #[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 |