mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 06:30:52 +00:00
Merge pull request #879 from shoatman/master
Updates to csharp model template to support inheritance
This commit is contained in:
commit
e39ec927a2
@ -13,7 +13,7 @@ namespace {{package}} {
|
||||
/// {{description}}
|
||||
/// </summary>
|
||||
[DataContract]
|
||||
public class {{classname}} {
|
||||
public class {{classname}}{{#parent}} : {{{parent}}}{{/parent}} {
|
||||
{{#vars}}
|
||||
{{#description}}/* {{{description}}} */{{/description}}
|
||||
[DataMember(Name="{{baseName}}", EmitDefaultValue=false)]
|
||||
@ -39,7 +39,7 @@ namespace {{package}} {
|
||||
/// Get the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public string ToJson() {
|
||||
public {{#parent}} new {{/parent}}string ToJson() {
|
||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user