Skip to content

Commit be8adf9

Browse files
committed
use json if content type is *
1 parent eaeb965 commit be8adf9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/rust/client_gen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ fn request_body_params(
337337
}
338338
ReferenceOr::Item(body) => {
339339
for (content_type, media_type) in &body.content {
340-
if content_type.starts_with("application/json") {
340+
if content_type.starts_with("application/json") || content_type == "*/*" {
341341
let schema = match &media_type.schema {
342342
None => Err(Error::unimplemented("JSON content without schema.")),
343343
Some(schema) => Ok(schema),
@@ -368,7 +368,7 @@ fn request_body_params(
368368
kind: ParamKind::Body,
369369
}],
370370
);
371-
} else if content_type == "application/x-yaml" {
371+
} else if content_type.contains("application/x-yaml") {
372372
let schema = match &media_type.schema {
373373
None => Err(Error::unimplemented("YAML content without schema.")),
374374
Some(schema) => Ok(schema),

src/rust/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ fn schema_type(
250250
SchemaKind::Not { .. } => Err(Error::unimplemented("Not parameter is not supported.")),
251251
SchemaKind::Any(_) => {
252252
if let Some(content_type) = content_type {
253-
if &content_type == "application/json" {
253+
if &content_type == "application/json" || &content_type == "*/*" {
254254
Ok(DataType::Json)
255255
} else if &content_type == "application/x-yaml" {
256256
Ok(DataType::Yaml)

0 commit comments

Comments
 (0)