Bumped package version to 1.9.2. Added default value documentation to function parameters for Javascript to help fix VSCode not displaying them when hovering.
This commit is contained in:
@@ -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.9.1</Version>
|
<Version>1.9.2</Version>
|
||||||
<PackageReleaseNotes></PackageReleaseNotes>
|
<PackageReleaseNotes></PackageReleaseNotes>
|
||||||
<PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon>
|
<PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon>
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
|
@@ -81,8 +81,8 @@ namespace MontoyaTech.Rest.Net
|
|||||||
writer.WriteBreak().WriteLine("/**").Indent();
|
writer.WriteBreak().WriteLine("/**").Indent();
|
||||||
writer.WriteLine("Initializes this api client with a given baseUrl of where to send requests.");
|
writer.WriteLine("Initializes this api client with a given baseUrl of where to send requests.");
|
||||||
writer.WriteLine("@param {string} baseUrl Base url of the server to make requests against.");
|
writer.WriteLine("@param {string} baseUrl Base url of the server to make requests against.");
|
||||||
writer.WriteLine("@param {Function} urlHandler An optional function to process request urls before they are sent. This must return the url.");
|
writer.WriteLine("@param {Function} urlHandler An optional function to process request urls before they are sent. This must return the url. Default is null.");
|
||||||
writer.WriteLine("@param {Function} requestHandler An optional function to process requests before they are sent. This must return the request.");
|
writer.WriteLine("@param {Function} requestHandler An optional function to process requests before they are sent. This must return the request. Default is null.");
|
||||||
writer.Outdent().WriteLine("*/");
|
writer.Outdent().WriteLine("*/");
|
||||||
if (this.NamedParameters)
|
if (this.NamedParameters)
|
||||||
writer.Write("static Init({ baseUrl, urlHandler = null, requestHandler = null } = {}) ");
|
writer.Write("static Init({ baseUrl, urlHandler = null, requestHandler = null } = {}) ");
|
||||||
@@ -116,8 +116,8 @@ namespace MontoyaTech.Rest.Net
|
|||||||
writer.WriteBreak().WriteLine("/**").Indent();
|
writer.WriteBreak().WriteLine("/**").Indent();
|
||||||
writer.WriteLine("Initializes this api client with a given baseUrl of where to send requests.");
|
writer.WriteLine("Initializes this api client with a given baseUrl of where to send requests.");
|
||||||
writer.WriteLine("@param {string} baseUrl Base url of the server to make requests against.");
|
writer.WriteLine("@param {string} baseUrl Base url of the server to make requests against.");
|
||||||
writer.WriteLine("@param {Function} urlHandler An optional function to process request urls before they are sent. This must return the url.");
|
writer.WriteLine("@param {Function} urlHandler An optional function to process request urls before they are sent. This must return the url. Default is null.");
|
||||||
writer.WriteLine("@param {Function} requestHandler An optional function to process requests before they are sent. This must return the request.");
|
writer.WriteLine("@param {Function} requestHandler An optional function to process requests before they are sent. This must return the request. Default is null.");
|
||||||
writer.Outdent().WriteLine("*/");
|
writer.Outdent().WriteLine("*/");
|
||||||
if (this.NamedParameters)
|
if (this.NamedParameters)
|
||||||
writer.Write("constructor({ baseUrl, urlHandler = null, requestHandler = null } = {}) ");
|
writer.Write("constructor({ baseUrl, urlHandler = null, requestHandler = null } = {}) ");
|
||||||
@@ -370,18 +370,22 @@ namespace MontoyaTech.Rest.Net
|
|||||||
foreach (var field in fields)
|
foreach (var field in fields)
|
||||||
{
|
{
|
||||||
if (this.UseJsonNames)
|
if (this.UseJsonNames)
|
||||||
writer.WriteLine($"@param {{{this.GetTypeFullyResolvedName(field.FieldType)}}} {EscapeName(field.GetCustomAttribute<Newtonsoft.Json.JsonPropertyAttribute>()?.PropertyName ?? field.Name)}");
|
writer.Write($"@param {{{this.GetTypeFullyResolvedName(field.FieldType)}}} {EscapeName(field.GetCustomAttribute<Newtonsoft.Json.JsonPropertyAttribute>()?.PropertyName ?? field.Name)}");
|
||||||
else
|
else
|
||||||
writer.WriteLine($"@param {{{this.GetTypeFullyResolvedName(field.FieldType)}}} {EscapeName(field.Name)}");
|
writer.Write($"@param {{{this.GetTypeFullyResolvedName(field.FieldType)}}} {EscapeName(field.Name)}");
|
||||||
|
|
||||||
|
writer.WriteSpacer().Write("Default is ").Write(this.GetTypeDefaultValue(field.FieldType)).WriteLine('.');
|
||||||
}
|
}
|
||||||
|
|
||||||
//Document the properties
|
//Document the properties
|
||||||
foreach (var property in properties)
|
foreach (var property in properties)
|
||||||
{
|
{
|
||||||
if (this.UseJsonNames)
|
if (this.UseJsonNames)
|
||||||
writer.WriteLine($"@param {{{this.GetTypeFullyResolvedName(property.PropertyType)}}} {EscapeName(property.GetCustomAttribute<Newtonsoft.Json.JsonPropertyAttribute>()?.PropertyName ?? property.Name)}");
|
writer.Write($"@param {{{this.GetTypeFullyResolvedName(property.PropertyType)}}} {EscapeName(property.GetCustomAttribute<Newtonsoft.Json.JsonPropertyAttribute>()?.PropertyName ?? property.Name)}");
|
||||||
else
|
else
|
||||||
writer.WriteLine($"@param {{{this.GetTypeFullyResolvedName(property.PropertyType)}}} {EscapeName(property.Name)}");
|
writer.Write($"@param {{{this.GetTypeFullyResolvedName(property.PropertyType)}}} {EscapeName(property.Name)}");
|
||||||
|
|
||||||
|
writer.WriteSpacer().Write("Default is ").Write(this.GetTypeDefaultValue(property.PropertyType)).WriteLine('.');
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.Outdent().WriteLine("*/");
|
writer.Outdent().WriteLine("*/");
|
||||||
|
Reference in New Issue
Block a user