Skip to content

Commit 344aa60

Browse files
committed
update csharp template to support implementations on oneOf
1 parent 11d1bd3 commit 344aa60

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/// <summary>
2+
/// {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}}
3+
/// </summary>
4+
public interface {{{classname}}}
5+
{
6+
7+
{{#vendorExtensions}}
8+
{{#x-discriminator-type-getter}}
9+
{{x-discriminator-type}} {{x-discriminator-type-getter}}();
10+
{{/x-discriminator-type-getter}}
11+
{{/vendorExtensions}}
12+
}

src/main/resources/handlebars/csharp/model.mustache

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{>partial_header}}
2+
{{^x-is-composed-model}}
23
using System;
34
using System.Linq;
45
using System.IO;
@@ -27,12 +28,17 @@ using System.ComponentModel;
2728
using System.ComponentModel.DataAnnotations;
2829
{{/netStandard}}
2930
using SwaggerDateConverter = {{packageName}}.Client.SwaggerDateConverter;
30-
31+
{{/x-is-composed-model}}
3132
{{#models}}
3233
{{#model}}
3334
namespace {{packageName}}.{{modelPackage}}
3435
{
36+
{{#isComposedModel}}
37+
{{>interface}}
38+
{{/isComposedModel}}
39+
{{^isComposedModel}}
3540
{{#isEnum}}{{>modelEnum}}{{/isEnum}}{{^isEnum}}{{>modelGeneric}}{{/isEnum}}
41+
{{/isComposedModel}}
3642
{{/model}}
3743
{{/models}}
3844
}

src/main/resources/handlebars/csharp/modelGeneric.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{#generatePropertyChanged}}
1010
[ImplementPropertyChanged]
1111
{{/generatePropertyChanged}}
12-
{{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{#validatable}}, IValidatableObject{{/validatable}}{{/netStandard}}
12+
{{>visibility}} partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}} IEquatable<{{classname}}>{{^netStandard}}{{#validatable}}, IValidatableObject{{/validatable}}{{/netStandard}}{{#interfaceModels}}{{#@first}}, {{/@first}}{{classname}}{{^@last}}, {{/@last}}{{#@last}} {{/@last}}{{/interfaceModels}}
1313
{
1414
{{#vars}}
1515
{{#items.isEnum}}

0 commit comments

Comments
 (0)