Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ members = [
"tripactions",
"zoom"
]

resolver = "2"
27 changes: 0 additions & 27 deletions generator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,23 +382,9 @@ impl ParameterDataExt for openapiv3::ParameterData {

trait ExtractJsonMediaType {
fn is_binary(&self) -> Result<bool>;
fn content_json(&self) -> Result<openapiv3::MediaType>;
}

impl ExtractJsonMediaType for openapiv3::Response {
fn content_json(&self) -> Result<openapiv3::MediaType> {
// 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<bool> {
if self.content.is_empty() {
/*
Expand Down Expand Up @@ -460,19 +446,6 @@ impl ExtractJsonMediaType for openapiv3::Response {
}

impl ExtractJsonMediaType for openapiv3::RequestBody {
fn content_json(&self) -> Result<openapiv3::MediaType> {
// 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<bool> {
if self.content.is_empty() {
/*
Expand Down