Skip to content

Commit

Permalink
Fix path parameters URL encoding (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuki-maruyama authored Sep 24, 2024
1 parent 1f6b288 commit aa3bae5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ done
# Fix username and password encoding
sed -i 's/VRChat.API.Client.ClientUtils.Base64Encode(this.Configuration.Username + \":\" + this.Configuration.Password)/VRChat.API.Client.ClientUtils.Base64Encode(System.Web.HttpUtility.UrlEncode(this.Configuration.Username) + ":" + System.Web.HttpUtility.UrlEncode(this.Configuration.Password))/g' src/VRChat.API/Api/AuthenticationApi.cs

# Disable URL encoding for path parameters
sed -i 's/request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment)/request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment, false)/g' src/VRChat.API/Client/ApiClient.cs

# Fix fields in csproj
sed -i 's/OpenAPI Library/VRChat API Library for .NET/' src/VRChat.API/VRChat.API.csproj
sed -i 's/A library generated from a OpenAPI doc/VRChat API Library for .NET/' src/VRChat.API/VRChat.API.csproj
Expand Down
2 changes: 1 addition & 1 deletion src/VRChat.API/Client/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ private RestRequest NewRequest(
{
foreach (var pathParam in options.PathParameters)
{
request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment);
request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment, false);
}
}

Expand Down

0 comments on commit aa3bae5

Please sign in to comment.