Skip to content

Commit cb183b9

Browse files
committed
Fix generator for multi-form content
1 parent 859321d commit cb183b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

generate.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ sed -i "s/local_var_req_builder = local_var_req_builder.json(&\(.*\));/if let So
4545
#https://github.com/vrchatapi/vrchatapi-rust/pull/30
4646
perl -0pi -e 's|(fn\s+[^(]*\([^)]*)file:\s+:?:?std::path::PathBuf,?([^)]*)((?:(?!\/\/ TODO: support file upload for '\''file'\'' parameter)[\s\S])*)\/\/ TODO: support file upload for '\''file'\'' parameter|\1file: impl Into<::std::borrow::Cow<'\''static, [u8]>>,\n\tfilename: impl Into<::std::borrow::Cow<'\''static, str>>,\n\tmime_type: &str,\2\3let part = reqwest::multipart::Part::bytes(file).file_name(filename).mime_str(mime_type)?;\n\tlocal_var_form = local_var_form.part("file", part);|g' src/apis/files_api.rs
4747

48+
find src/ -type f -name "*.rs" -exec sed -i 's/models::models/models/g' {} +
49+
50+
find src/ -type f -name "*.rs" -exec sed -i 's/local_var_form\.text("data", data\.to_string())/local_var_form.text("data", serde_json::to_string_pretty(\&data)?)/g' {} +
51+
4852
cargo fmt
4953
cargo build
5054
cargo test

0 commit comments

Comments
 (0)