forked from loafle/openapi-generator-original
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}}
|
/// {{description}}
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class {{classname}} {
|
public class {{classname}}{{#parent}} : {{{parent}}}{{/parent}} {
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
{{#description}}/* {{{description}}} */{{/description}}
|
{{#description}}/* {{{description}}} */{{/description}}
|
||||||
[DataMember(Name="{{baseName}}", EmitDefaultValue=false)]
|
[DataMember(Name="{{baseName}}", EmitDefaultValue=false)]
|
||||||
@ -39,11 +39,11 @@ namespace {{package}} {
|
|||||||
/// Get the JSON string presentation of the object
|
/// Get the JSON string presentation of the object
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>JSON string presentation of the object</returns>
|
/// <returns>JSON string presentation of the object</returns>
|
||||||
public string ToJson() {
|
public {{#parent}} new {{/parent}}string ToJson() {
|
||||||
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
return JsonConvert.SerializeObject(this, Formatting.Indented);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
{{/model}}
|
{{/model}}
|
||||||
{{/models}}
|
{{/models}}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user