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
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ namespace {{packageName}}.Client
{{/netStandard}}
{{^netStandard}}
{{^supportsUWP}}
request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType);
request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentLength, param.Value.ContentType);
{{/supportsUWP}}
{{#supportsUWP}}
byte[] paramWriter = null;
param.Value.Writer = delegate (Stream stream) { paramWriter = ToByteArray(stream); };
request.AddFile(param.Value.Name, paramWriter, param.Value.FileName, param.Value.ContentType);
request.AddFile(param.Value.Name, paramWriter, param.Value.FileName, param.Value.ContentLength, param.Value.ContentType);
{{/supportsUWP}}
{{/netStandard}}
}
Expand Down Expand Up @@ -215,7 +215,7 @@ namespace {{packageName}}.Client
{{/supportsUWP}}
{{#supportsUWP}}
// Using async method to perform sync call (uwp-only)
var response = RestClient.ExecuteTaskAsync(request).Result;
var response = RestClient.ExecuteAsync(request).Result;
{{/supportsUWP}}
{{/netStandard}}
InterceptResponse(request, response);
Expand Down Expand Up @@ -565,6 +565,7 @@ namespace {{packageName}}.Client
/// Convert params to key/value pairs.
/// Use collectionFormat to properly format lists and collections.
/// </summary>
/// <param name="collectionFormat">Collection format.</param>
/// <param name="name">Key name.</param>
/// <param name="value">Value object.</param>
/// <returns>A list of KeyValuePairs</returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,22 @@
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.12.0.1\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\Newtonsoft.Json.12.0.3\lib\{{targetFrameworkNuget}}\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="JsonSubTypes">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.5.2\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.5.2\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.5.2\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\JsonSubTypes.1.5.2\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.6.0\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.6.0\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.6.0\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\JsonSubTypes.1.6.0\lib\{{targetFrameworkNuget}}\JsonSubTypes.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.105.1.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\RestSharp.105.1.0\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.106.10.1\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.106.10.1\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.106.10.1\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}\RestSharp.dll</HintPath>
<HintPath Condition="Exists('{{binRelativePath}}')">{{binRelativePath}}\RestSharp.106.10.1\lib\{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}\RestSharp.dll</HintPath>
</Reference>
{{#generatePropertyChanged}}
<Reference Include="PropertyChanged">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
<PackageReference Include="FubarCoder.RestSharp.Portable.HttpClient" Version="4.0.7" />
{{/netStandard}}
{{^netStandard}}
<PackageReference Include="RestSharp" Version="105.1.0" />
<PackageReference Include="RestSharp" Version="106.10.1" />
{{/netStandard}}
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="JsonSubTypes" Version="1.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="JsonSubTypes" Version="1.6.0" />
</ItemGroup>

{{^netStandard}}
Expand All @@ -43,4 +43,4 @@
</ItemGroup>
{{/netStandard}}

</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
<PackageReference Include="FubarCoder.RestSharp.Portable.Core" Version="4.0.7" />
{{/netStandard}}
{{^netStandard}}
<PackageReference Include="RestSharp" Version="105.1.0" />
<PackageReference Include="RestSharp" Version="106.10.1" />
{{/netStandard}}
<PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
<PackageReference Include="JsonSubTypes" Version="1.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="JsonSubTypes" Version="1.6.0" />
</ItemGroup>

{{^netStandard}}
Expand All @@ -46,4 +46,4 @@
<ProjectReference Include="..\{{packageName}}\{{packageName}}.csproj" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="105.1.0" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.2" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="RestSharp" version="106.10.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="JsonSubTypes" version="1.6.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
{{#generatePropertyChanged}}
<package id="Fody" version="1.29.4" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="PropertyChanged.Fody" version="1.51.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.11.0" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}net452{{/isNet40}}" />
<package id="RestSharp" version="105.1.0" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.2" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="RestSharp" version="106.10.1" targetFramework="{{#isNet40}}net4{{/isNet40}}{{^isNet40}}{{targetFrameworkNuget}}{{/isNet40}}" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
<package id="JsonSubTypes" version="1.6.0" targetFramework="{{targetFrameworkNuget}}" developmentDependency="true" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"dependencies": {
"FubarCoder.RestSharp.Portable.Core": "4.0.7",
"FubarCoder.RestSharp.Portable.HttpClient": "4.0.7",
"Newtonsoft.Json": "12.0.1",
"JsonSubTypes": "1.5.2"
"Newtonsoft.Json": "12.0.3",
"JsonSubTypes": "1.6.0"
},
"frameworks": {
"{{targetFrameworkNuget}}": {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.11.0" targetFramework="net452" />
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net45" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.2" targetFramework="net45" developmentDependency="true" />
<package id="RestSharp" version="106.10.1" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" developmentDependency="true" />
<package id="JsonSubTypes" version="1.6.0" targetFramework="net45" developmentDependency="true" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private RestRequest PrepareRequest(
// add file parameter, if any
foreach(var param in fileParams)
{
request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType);
request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentLength, param.Value.ContentType);
}

if (postBody != null) // http body (model or byte[]) parameter
Expand Down Expand Up @@ -500,6 +500,7 @@ public static string SanitizeFilename(string filename)
/// Convert params to key/value pairs.
/// Use collectionFormat to properly format lists and collections.
/// </summary>
/// <param name="collectionFormat">Collection format.</param>
/// <param name="name">Key name.</param>
/// <param name="value">Value object.</param>
/// <returns>A list of KeyValuePairs</returns>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ The version of the OpenAPI document: 1.0.0
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="Newtonsoft.Json">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="JsonSubTypes">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\JsonSubTypes.1.5.2\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\JsonSubTypes.1.6.0\lib\net45\JsonSubTypes.dll</HintPath>
</Reference>
<Reference Include="RestSharp">
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.105.1.0\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('$(SolutionDir)\packages')">$(SolutionDir)\packages\RestSharp.106.10.1\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\packages')">..\packages\RestSharp.106.10.1\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\packages')">..\..\packages\RestSharp.106.10.1\lib\net45\RestSharp.dll</HintPath>
<HintPath Condition="Exists('..\..\vendor')">..\..\vendor\RestSharp.106.10.1\lib\net45\RestSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="RestSharp" version="105.1.0" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net45" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.2" targetFramework="net45" developmentDependency="true" />
<package id="RestSharp" version="106.10.1" targetFramework="net45" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net45" developmentDependency="true" />
<package id="JsonSubTypes" version="1.6.0" targetFramework="net45" developmentDependency="true" />
</packages>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.3.1-SNAPSHOT
4.3.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.11.0" targetFramework="net452" />
<package id="RestSharp" version="105.1.0" targetFramework="net35" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net35" developmentDependency="true" />
<package id="JsonSubTypes" version="1.5.2" targetFramework="net35" developmentDependency="true" />
<package id="RestSharp" version="106.10.1" targetFramework="net35" developmentDependency="true" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net35" developmentDependency="true" />
<package id="JsonSubTypes" version="1.6.0" targetFramework="net35" developmentDependency="true" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private RestRequest PrepareRequest(
// add file parameter, if any
foreach(var param in fileParams)
{
request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentType);
request.AddFile(param.Value.Name, param.Value.Writer, param.Value.FileName, param.Value.ContentLength, param.Value.ContentType);
}

if (postBody != null) // http body (model or byte[]) parameter
Expand Down Expand Up @@ -473,6 +473,7 @@ public static string SanitizeFilename(string filename)
/// Convert params to key/value pairs.
/// Use collectionFormat to properly format lists and collections.
/// </summary>
/// <param name="collectionFormat">Collection format.</param>
/// <param name="name">Key name.</param>
/// <param name="value">Value object.</param>
/// <returns>A list of KeyValuePairs</returns>
Expand Down
Loading