From bf53a8f2cf2a288fec504e328b328ca53ecf4fdb Mon Sep 17 00:00:00 2001 From: Martin Damgaard Lorensen <73821192+martindamgaardlorensen@users.noreply.github.com> Date: Wed, 12 Jun 2024 20:46:57 +0200 Subject: [PATCH] Empty templates for annotation of enum and members (#1693) --- .../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 -%}