Modified JavascriptClientGenerator to handle nullable types and indicate them by ?type instead of Nullable<>. Bumped package version to 1.9.4
This commit is contained in:
@@ -50,7 +50,7 @@ namespace MontoyaTech.Rest.Net.Example
|
||||
|
||||
public string[] Array = null;
|
||||
|
||||
public ulong Property { get; set; }
|
||||
public ulong? Property { get; set; }
|
||||
|
||||
public User() { }
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<AssemblyName>MontoyaTech.Rest.Net</AssemblyName>
|
||||
<RootNamespace>MontoyaTech.Rest.Net</RootNamespace>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<Version>1.9.3</Version>
|
||||
<Version>1.9.4</Version>
|
||||
<PackageReleaseNotes></PackageReleaseNotes>
|
||||
<PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon>
|
||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||
|
||||
@@ -186,7 +186,11 @@ namespace MontoyaTech.Rest.Net
|
||||
{
|
||||
var typeCode = Type.GetTypeCode(type);
|
||||
|
||||
if (typeof(Array).IsAssignableFrom(type))
|
||||
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
|
||||
{
|
||||
return $"?{GetTypeFullyResolvedName(Nullable.GetUnderlyingType(type))}";
|
||||
}
|
||||
else if (typeof(Array).IsAssignableFrom(type))
|
||||
{
|
||||
return $"Array<{this.GetTypeFullyResolvedName(type.GetElementType())}>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user