From 01a6c95f4efe357907681edc6ac6bd347017cf74 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 24 May 2018 22:23:01 -0700 Subject: API schema: serde_json::Value Unfortunately, this requires hacking model.rs manually. Might be able to partially mitigate with, eg, sed. --- rust/fatcat-api/README.md | 2 +- rust/fatcat-api/api.yaml | 3 +-- rust/fatcat-api/api/swagger.yaml | 5 +---- rust/fatcat-api/src/models.rs | 3 ++- rust/fatcat-openapi2.yml | 3 +-- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/rust/fatcat-api/README.md b/rust/fatcat-api/README.md index f5cf212e..baf249ca 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-25T00:37:13.827Z +- Build date: 2018-05-25T00:58:40.370Z 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 df828a41..1fe5c8ff 100644 --- a/rust/fatcat-api/api.yaml +++ b/rust/fatcat-api/api.yaml @@ -218,8 +218,7 @@ definitions: # <<: *ENTITYEDITPROPS extra: type: object - additionalProperties: - type: string + additionalProperties: {} changelogentries: type: array items: diff --git a/rust/fatcat-api/api/swagger.yaml b/rust/fatcat-api/api/swagger.yaml index 8db937d4..487c0a4f 100644 --- a/rust/fatcat-api/api/swagger.yaml +++ b/rust/fatcat-api/api/swagger.yaml @@ -1298,11 +1298,8 @@ definitions: type: "string" extra: type: "object" - additionalProperties: - type: "string" example: - extra: - key: "extra" + extra: "{}" description: "description" editor_id: 6 id: 0 diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs index dc9a103f..989c73f2 100644 --- a/rust/fatcat-api/src/models.rs +++ b/rust/fatcat-api/src/models.rs @@ -1,5 +1,6 @@ #![allow(unused_imports, unused_qualifications, unused_extern_crates)] extern crate chrono; +extern crate serde_json; extern crate uuid; use serde::ser::Serializer; @@ -201,7 +202,7 @@ pub struct Editgroup { #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] - pub extra: Option>, + pub extra: Option, } impl Editgroup { diff --git a/rust/fatcat-openapi2.yml b/rust/fatcat-openapi2.yml index df828a41..1fe5c8ff 100644 --- a/rust/fatcat-openapi2.yml +++ b/rust/fatcat-openapi2.yml @@ -218,8 +218,7 @@ definitions: # <<: *ENTITYEDITPROPS extra: type: object - additionalProperties: - type: string + additionalProperties: {} changelogentries: type: array items: -- cgit v1.2.3