-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix handle generic template names and improve oop test case
- Loading branch information
Showing
57 changed files
with
181 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
public class HumanMap : Map<Human, Human> | ||
public class HumanMap : Map<HumanType, HumanType> | ||
{ | ||
} | ||
|
4 changes: 2 additions & 2 deletions
4
tests/Generator/resource/csharp/oop/Human.cs → ...enerator/resource/csharp/oop/HumanType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
public class Human | ||
public class HumanType | ||
{ | ||
[JsonPropertyName("firstName")] | ||
public string? FirstName { get; set; } | ||
|
||
[JsonPropertyName("parent")] | ||
public Human? Parent { get; set; } | ||
public HumanType? Parent { get; set; } | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
public class StudentMap : Map<Human, Student> | ||
public class StudentMap : Map<HumanType, Student> | ||
{ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type MyMap struct { | ||
MatricleNumber string `json:"matricleNumber"` | ||
FirstName string `json:"firstName"` | ||
Parent *Human `json:"parent"` | ||
Parent *HumanType `json:"parent"` | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type HumanMap struct { | ||
TotalResults int `json:"totalResults"` | ||
Parent *Human `json:"parent"` | ||
Entries []Human `json:"entries"` | ||
Parent *HumanType `json:"parent"` | ||
Entries []HumanType `json:"entries"` | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type HumanType struct { | ||
FirstName string `json:"firstName"` | ||
Parent *HumanType `json:"parent"` | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type Student struct { | ||
FirstName string `json:"firstName"` | ||
Parent *Human `json:"parent"` | ||
Parent *HumanType `json:"parent"` | ||
MatricleNumber string `json:"matricleNumber"` | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
type StudentMap struct { | ||
TotalResults int `json:"totalResults"` | ||
Parent *Human `json:"parent"` | ||
Parent *HumanType `json:"parent"` | ||
Entries []Student `json:"entries"` | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
<div id="Human" class="psx-object psx-struct"><h1><a class="psx-type-link" data-name="Human">Human</a></h1><pre class="psx-object-json"><span class="psx-object-json-pun">{</span> | ||
<div id="HumanType" class="psx-object psx-struct"><h1><a class="psx-type-link" data-name="HumanType">HumanType</a></h1><pre class="psx-object-json"><span class="psx-object-json-pun">{</span> | ||
<span class="psx-object-json-key">"firstName"</span><span class="psx-object-json-pun">: </span><span class="psx-property-type">String</span><span class="psx-object-json-pun">,</span> | ||
<span class="psx-object-json-key">"parent"</span><span class="psx-object-json-pun">: </span><span class="psx-property-type">Human</span><span class="psx-object-json-pun">,</span> | ||
<span class="psx-object-json-pun">}</span></pre><table class="table psx-object-properties"><colgroup><col width="30%" /><col width="70%" /></colgroup><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><span class="psx-property-name ">firstName</span></td><td><span class="psx-property-type"><a class="psx-type-link" data-name="String">String</a></span><br /><div class="psx-property-description"></div></td></tr><tr><td><span class="psx-property-name ">parent</span></td><td><span class="psx-property-type"><a class="psx-type-link" data-name="Human">Human</a></span><br /><div class="psx-property-description"></div></td></tr></tbody></table></div> | ||
<span class="psx-object-json-key">"parent"</span><span class="psx-object-json-pun">: </span><span class="psx-property-type">Human_Type</span><span class="psx-object-json-pun">,</span> | ||
<span class="psx-object-json-pun">}</span></pre><table class="table psx-object-properties"><colgroup><col width="30%" /><col width="70%" /></colgroup><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><span class="psx-property-name ">firstName</span></td><td><span class="psx-property-type"><a class="psx-type-link" data-name="String">String</a></span><br /><div class="psx-property-description"></div></td></tr><tr><td><span class="psx-property-name ">parent</span></td><td><span class="psx-property-type"><a class="psx-type-link" data-name="Human_Type">Human_Type</a></span><br /><div class="psx-property-description"></div></td></tr></tbody></table></div> | ||
|
||
<div id="Student" class="psx-object psx-struct"><h1><a class="psx-type-link" data-name="Student">Student</a> extends <a class="psx-type-link" data-name="Human">Human</a></h1><pre class="psx-object-json"><span class="psx-object-json-pun">{</span> | ||
|
||
<div id="Student" class="psx-object psx-struct"><h1><a class="psx-type-link" data-name="Student">Student</a> extends <a class="psx-type-link" data-name="Human_Type">Human_Type</a></h1><pre class="psx-object-json"><span class="psx-object-json-pun">{</span> | ||
<span class="psx-object-json-key">"matricleNumber"</span><span class="psx-object-json-pun">: </span><span class="psx-property-type">String</span><span class="psx-object-json-pun">,</span> | ||
<span class="psx-object-json-pun">}</span></pre><table class="table psx-object-properties"><colgroup><col width="30%" /><col width="70%" /></colgroup><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><span class="psx-property-name ">matricleNumber</span></td><td><span class="psx-property-type"><a class="psx-type-link" data-name="String">String</a></span><br /><div class="psx-property-description"></div></td></tr></tbody></table></div> | ||
|
||
|
||
<div id="Map" class="psx-object psx-struct"><h1><a class="psx-type-link" data-name="Map">Map</a><P, T></h1><pre class="psx-object-json"><span class="psx-object-json-pun">{</span> | ||
<span class="psx-object-json-key">"totalResults"</span><span class="psx-object-json-pun">: </span><span class="psx-property-type">Integer</span><span class="psx-object-json-pun">,</span> | ||
<span class="psx-object-json-key">"parent"</span><span class="psx-object-json-pun">: </span><span class="psx-property-type">P</span><span class="psx-object-json-pun">,</span> | ||
<span class="psx-object-json-key">"entries"</span><span class="psx-object-json-pun">: </span><span class="psx-property-type">Array (T)</span><span class="psx-object-json-pun">,</span> | ||
<span class="psx-object-json-pun">}</span></pre><table class="table psx-object-properties"><colgroup><col width="30%" /><col width="70%" /></colgroup><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><span class="psx-property-name ">totalResults</span></td><td><span class="psx-property-type"><a class="psx-type-link" data-name="Integer">Integer</a></span><br /><div class="psx-property-description"></div></td></tr><tr><td><span class="psx-property-name ">parent</span></td><td><span class="psx-property-type"><a class="psx-type-link" data-name="P">P</a></span><br /><div class="psx-property-description"></div></td></tr><tr><td><span class="psx-property-name ">entries</span></td><td><span class="psx-property-type"><a class="psx-type-link" data-name="Array (T)">Array (T)</a></span><br /><div class="psx-property-description"></div></td></tr></tbody></table></div> | ||
|
||
|
||
<div id="StudentMap" class="psx-object psx-struct"><h1><a class="psx-type-link" data-name="StudentMap">StudentMap</a> extends <a class="psx-type-link" data-name="Map">Map</a></h1><pre class="psx-object-json"><span class="psx-object-json-pun">{</span> | ||
<span class="psx-object-json-pun">}</span></pre><table class="table psx-object-properties"><colgroup><col width="30%" /><col width="70%" /></colgroup><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody></tbody></table></div> | ||
|
||
|
||
<div id="HumanMap" class="psx-object psx-struct"><h1><a class="psx-type-link" data-name="HumanMap">HumanMap</a> extends <a class="psx-type-link" data-name="Map">Map</a></h1><pre class="psx-object-json"><span class="psx-object-json-pun">{</span> | ||
<span class="psx-object-json-pun">}</span></pre><table class="table psx-object-properties"><colgroup><col width="30%" /><col width="70%" /></colgroup><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody></tbody></table></div> | ||
|
||
|
||
<div id="RootSchema" class="psx-object psx-struct"><h1><a class="psx-type-link" data-name="RootSchema">RootSchema</a></h1><pre class="psx-object-json"><span class="psx-object-json-pun">{</span> | ||
<span class="psx-object-json-key">"students"</span><span class="psx-object-json-pun">: </span><span class="psx-property-type">StudentMap</span><span class="psx-object-json-pun">,</span> | ||
<span class="psx-object-json-pun">}</span></pre><table class="table psx-object-properties"><colgroup><col width="30%" /><col width="70%" /></colgroup><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><span class="psx-property-name ">students</span></td><td><span class="psx-property-type"><a class="psx-type-link" data-name="StudentMap">StudentMap</a></span><br /><div class="psx-property-description"></div></td></tr></tbody></table></div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
open class HumanMap : Map<Human, Human> { | ||
open class HumanMap : Map<HumanType, HumanType> { | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
open class HumanType { | ||
@JsonProperty("firstName") var firstName: String? = null | ||
@JsonProperty("parent") var parent: HumanType? = null | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
open class Student : Human { | ||
open class Student : HumanType { | ||
@JsonProperty("matricleNumber") var matricleNumber: String? = null | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
open class StudentMap : Map<Human, Student> { | ||
open class StudentMap : Map<HumanType, Student> { | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.