Skip to content

Commit

Permalink
use json if content type is *
Browse files Browse the repository at this point in the history
  • Loading branch information
afsalthaj committed Nov 4, 2024
1 parent eaeb965 commit be8adf9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/rust/client_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ fn request_body_params(
}
ReferenceOr::Item(body) => {
for (content_type, media_type) in &body.content {
if content_type.starts_with("application/json") {
if content_type.starts_with("application/json") || content_type == "*/*" {
let schema = match &media_type.schema {
None => Err(Error::unimplemented("JSON content without schema.")),
Some(schema) => Ok(schema),
Expand Down Expand Up @@ -368,7 +368,7 @@ fn request_body_params(
kind: ParamKind::Body,
}],
);
} else if content_type == "application/x-yaml" {
} else if content_type.contains("application/x-yaml") {
let schema = match &media_type.schema {
None => Err(Error::unimplemented("YAML content without schema.")),
Some(schema) => Ok(schema),
Expand Down
2 changes: 1 addition & 1 deletion src/rust/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ fn schema_type(
SchemaKind::Not { .. } => Err(Error::unimplemented("Not parameter is not supported.")),
SchemaKind::Any(_) => {
if let Some(content_type) = content_type {
if &content_type == "application/json" {
if &content_type == "application/json" || &content_type == "*/*" {
Ok(DataType::Json)
} else if &content_type == "application/x-yaml" {
Ok(DataType::Yaml)
Expand Down

0 comments on commit be8adf9

Please sign in to comment.