Fixed a minor issue where the request parameter was the same name as the request object in javascript route functions. Bumped package version to 1.8.4

This commit is contained in:
MattMo 2024-03-06 08:14:40 -08:00
parent 51b8ba073c
commit a698e71e4b
2 changed files with 6 additions and 6 deletions

View File

@ -17,7 +17,7 @@
<AssemblyName>MontoyaTech.Rest.Net</AssemblyName> <AssemblyName>MontoyaTech.Rest.Net</AssemblyName>
<RootNamespace>MontoyaTech.Rest.Net</RootNamespace> <RootNamespace>MontoyaTech.Rest.Net</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile> <GenerateDocumentationFile>True</GenerateDocumentationFile>
<Version>1.8.3</Version> <Version>1.8.4</Version>
<PackageReleaseNotes></PackageReleaseNotes> <PackageReleaseNotes></PackageReleaseNotes>
<PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon> <PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon>
</PropertyGroup> </PropertyGroup>

View File

@ -626,7 +626,7 @@ namespace MontoyaTech.Rest.Net
//Generate request doc if any //Generate request doc if any
if (routeRequest != null) if (routeRequest != null)
writer.WriteLine($"@param {{{(routeRequest.Dynamic ? "Any" : this.GetTypeFullyResolvedName(routeRequest.RequestType))}}} request"); writer.WriteLine($"@param {{{(routeRequest.Dynamic ? "Any" : this.GetTypeFullyResolvedName(routeRequest.RequestType))}}} body");
//Generate response doc if any //Generate response doc if any
if (routeResponse != null) if (routeResponse != null)
@ -655,7 +655,7 @@ namespace MontoyaTech.Rest.Net
if (routeRequest != null) if (routeRequest != null)
{ {
writer.WriteSeparator(); writer.WriteSeparator();
writer.Write("request"); writer.Write("body");
} }
if (routeResponse != null && routeResponse.Parameter) if (routeResponse != null && routeResponse.Parameter)
@ -721,16 +721,16 @@ namespace MontoyaTech.Rest.Net
if (routeRequest.RequestType.IsAssignableTo(typeof(Stream))) if (routeRequest.RequestType.IsAssignableTo(typeof(Stream)))
{ {
writer.WriteLine("headers: new Headers({ 'Content-Type': 'application/octet-stream' }),"); writer.WriteLine("headers: new Headers({ 'Content-Type': 'application/octet-stream' }),");
writer.WriteLine("body: request,"); writer.WriteLine("body: body,");
} }
else if (routeRequest.Json) else if (routeRequest.Json)
{ {
writer.WriteLine("body: JSON.stringify(request),"); writer.WriteLine("body: JSON.stringify(body),");
} }
else else
{ {
writer.WriteLine("body: request.toString(),"); writer.WriteLine("body: body.toString(),");
} }
} }