Skip to content
Merged
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
6 changes: 0 additions & 6 deletions .github/workflows/check_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.6
- name: Configure sccache env var and set build profile to ephemeral build
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- run: cargo build --all
- run: cargo test --all

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install OpenAPI Generator CLI
run: npm install @openapitools/openapi-generator-cli
- name: Set OpenAPI Generator version
run: ./node_modules/\@openapitools/openapi-generator-cli/main.js version-manager set 7.7.0
run: ./node_modules/\@openapitools/openapi-generator-cli/main.js version-manager set 7.17.0
- name: Set up JDK 20
uses: actions/setup-java@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.7.0
7.17.0
11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ edition = "2021"
serde = { version = "^1.0", features = ["derive"] }
serde_with = { version = "^3.8", default-features = false, features = ["base64", "std", "macros"] }
serde_json = "^1.0"
serde_repr = "^0.1"
url = "^2.5"
uuid = { version = "^1.8", features = ["serde", "v4"] }
reqwest = { version = "^0.12", default-features = false, features = ["json", "cookies", "multipart"] }

[dev-dependencies]
tokio = { version = '1', features = ['macros', 'rt-multi-thread'] }
[features]
default = ["reqwest/default"]
default = ["native-tls"]
native-tls = ["reqwest/native-tls"]
rustls-tls = ["reqwest/rustls-tls"]

[dev-dependencies]
tokio = { version = '1', features = ['macros', 'rt-multi-thread'] }
4 changes: 2 additions & 2 deletions docs/GroupSearchSort.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| Name | Value |
|---- | -----|
| Asc | joinedAt:asc |
| Desc | joinedAt:desc |
| JoinedAtColonAsc | joinedAt:asc |
| JoinedAtColonDesc | joinedAt:desc |


[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
16 changes: 9 additions & 7 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,11 @@ find src -type f -exec sed -i '/^\s*\/\/\/\s*$/d' {} \;

# Cookie storage
sed -i 's/Client::new()/Client::builder().cookie_store(true).build().unwrap()/g' src/apis/configuration.rs
sed -i 's/, features = \["json", "multipart"\]/, default-features = false, features = \["json", "cookies", "multipart"\]/g' Cargo.toml
sed -i 's/, features = \["json", "multipart"\]/, features = \["json", "cookies", "multipart"\]/g' Cargo.toml

#Fix example
printf "\n[dev-dependencies]\ntokio = { version = '1', features = ['macros', 'rt-multi-thread'] }" >> Cargo.toml

#Add feature section to Cargo.toml
printf "\n[features]\ndefault = [\"reqwest/default\"]" >> Cargo.toml


# https://github.com/vrchatapi/specification/issues/241
cat patches/2FA_Current_User.rs >> src/models/current_user.rs
sed -i 's/pub use self::current_user::CurrentUser;/pub use self::current_user::{EitherUserOrTwoFactor, CurrentUser};/g' src/models/mod.rs
Expand All @@ -43,11 +39,17 @@ sed -i 's/Result<models::CurrentUser, Error<GetCurrentUserError>>/Result<models:
sed -i "s/local_var_req_builder = local_var_req_builder.json(&\(.*\));/if let Some(\1) = \1 { \0 }/g" src/apis/files_api.rs

#https://github.com/vrchatapi/vrchatapi-rust/pull/30
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
#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(p_form_file).file_name(filename).mime_str(mime_type)?;\n\tmultipart_form = multipart_form.part("file", part);|g' src/apis/files_api.rs
#perl -0pi -e 's|(fn\s+[^(]*\([^)]*)image:\s+:?:?std::path::PathBuf,?([^)]*)((?:(?!\/\/ TODO: support file upload for '\''image'\'' parameter)[\s\S])*)\/\/ TODO: support file upload for '\''image'\'' parameter|\1image: 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(p_form_image).file_name(filename).mime_str(mime_type)?;\n\tmultipart_form = multipart_form.part("image", part);|g' src/apis/invite_api.rs
#This is basically the multipart handling from above, except put in one regex replace
perl -0pi -e 's|(fn\s+[^(]*\([^)]*)([,\s])([\w]+):\s+(?:::)?std::path::PathBuf,?([^)]*)((?:(?!\/\/ TODO: support file upload for '\''\3'\'' parameter)[\s\S])*)\/\/ TODO: support file upload for '\''\3'\'' parameter|\1\2\3: impl Into<::std::borrow::Cow<'\''static, [u8]>>,\n\tfilename: impl Into<::std::borrow::Cow<'\''static, str>>,\n\tmime_type: &str,\4\5let part = reqwest::multipart::Part::bytes(p_form_\3).file_name(filename).mime_str(mime_type)?;\n\tmultipart_form = multipart_form.part("\3", part);|g' src/apis/files_api.rs src/apis/invite_api.rs src/apis/prints_api.rs

find src/ -type f -name "*.rs" -exec sed -i 's/models::models/models/g' {} +

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' {} +
find src/ -type f -name "*.rs" -exec sed -i 's/multipart_form\.text("data", p_form_data\.to_string())/multipart_form.text("data", serde_json::to_string_pretty(\&p_form_data)?)/g' {} +

#Hide warnings about unused variables and non-rusty type names
sed -i 's/#!\[allow(unused_imports)\]/#![allow(unused_imports)]\n#![allow(non_camel_case_types)]/' src/lib.rs

cargo fmt
cargo build
Expand Down
2 changes: 1 addition & 1 deletion openapitools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.7.0"
"version": "7.17.0"
}
}
Loading
Loading