From 4cd252c87854f9afeb942c2bef2d8f3e232d4df4 Mon Sep 17 00:00:00 2001 From: Martin Damgaard Lorensen Date: Fri, 19 Apr 2024 13:59:41 +0200 Subject: [PATCH] Empty templates for annotation of enum and members --- .../Templates/Enum.Annotations.liquid | 1 + .../Templates/Enum.Member.Annotations.liquid | 1 + src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.liquid | 2 ++ 3 files changed, 4 insertions(+) create mode 100644 src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.Annotations.liquid create mode 100644 src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.Member.Annotations.liquid diff --git a/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.Annotations.liquid b/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.Annotations.liquid new file mode 100644 index 000000000..5f282702b --- /dev/null +++ b/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.Annotations.liquid @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.Member.Annotations.liquid b/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.Member.Annotations.liquid new file mode 100644 index 000000000..5f282702b --- /dev/null +++ b/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.Member.Annotations.liquid @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.liquid b/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.liquid index 849187e90..57956c084 100644 --- a/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.liquid +++ b/src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.liquid @@ -7,12 +7,14 @@ {%- if IsEnumAsBitFlags -%} [System.Flags] {%- endif -%} +{%- template Enum.Annotations -%} {{ TypeAccessModifier }} enum {{ Name }}{%- if HasExtendedValueRange %} : long{% endif %} { {%- for enum in Enums %} {%- if IsStringEnum -%} [System.Runtime.Serialization.EnumMember(Value = @"{{ enum.Value | replace: '"', '""' }}")] {%- endif -%} +{%- template Enum.Member.Annotations -%} {%- if IsEnumAsBitFlags -%} {{ enum.Name }} = {{ enum.InternalFlagValue }}, {%- else -%}