mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2026-03-24 06:49:03 +00:00
[Rust Server] Support multipart/form_data request bodies (#2846)
[Rust Server] Support multipart/form_data - Support multipart/form_data in the Rust Server - Add a new test API to test the change. - Update the examples to match
This commit is contained in:
committed by
GitHub
parent
86228e9964
commit
6963e5eeb0
@@ -709,6 +709,9 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
consumesPlainText = true;
|
||||
} else if (isMimetypeWwwFormUrlEncoded(mediaType)) {
|
||||
additionalProperties.put("usesUrlEncodedForm", true);
|
||||
} else if (isMimetypeMultipartFormData(mediaType)) {
|
||||
op.vendorExtensions.put("consumesMultipart", true);
|
||||
additionalProperties.put("apiUsesMultipart", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -724,8 +727,8 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
} else {
|
||||
op.bodyParam.vendorExtensions.put("consumesJson", true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (CodegenParameter param : op.bodyParams) {
|
||||
processParam(param, op);
|
||||
|
||||
@@ -789,6 +792,8 @@ public class RustServerCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
codegenParameter.isPrimitiveType = false;
|
||||
codegenParameter.isListContainer = false;
|
||||
codegenParameter.isString = false;
|
||||
codegenParameter.isByteArray = ModelUtils.isByteArraySchema(original_schema);
|
||||
|
||||
|
||||
// This is a model, so should only have an example if explicitly
|
||||
// defined.
|
||||
|
||||
Reference in New Issue
Block a user