diff --git a/Cargo.toml b/Cargo.toml index 8c5d873c..266b80fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,5 @@ members = [ "tripactions", "zoom" ] + +resolver = "2" diff --git a/generator/src/main.rs b/generator/src/main.rs index 14adaefd..5d8dfa24 100644 --- a/generator/src/main.rs +++ b/generator/src/main.rs @@ -382,23 +382,9 @@ impl ParameterDataExt for openapiv3::ParameterData { trait ExtractJsonMediaType { fn is_binary(&self) -> Result; - fn content_json(&self) -> Result; } impl ExtractJsonMediaType for openapiv3::Response { - fn content_json(&self) -> Result { - // We do not need to check the length of the content because there might be - // more than one. For example, if xml or some other format is also defined. - if let Some(mt) = self.content.get("application/json") { - Ok(mt.clone()) - } else { - bail!( - "could not find application/json, only found {}", - self.content.keys().next().unwrap() - ); - } - } - fn is_binary(&self) -> Result { if self.content.is_empty() { /* @@ -460,19 +446,6 @@ impl ExtractJsonMediaType for openapiv3::Response { } impl ExtractJsonMediaType for openapiv3::RequestBody { - fn content_json(&self) -> Result { - // We do not need to check the length of the content because there might be - // more than one. For example, if xml or some other format is also defined. - if let Some(mt) = self.content.get("application/json") { - Ok(mt.clone()) - } else { - bail!( - "could not find application/json, only found {}", - self.content.keys().next().unwrap() - ); - } - } - fn is_binary(&self) -> Result { if self.content.is_empty() { /*