Skip to content

Commit

Permalink
Allow attribute annotations to be on a separate line
Browse files Browse the repository at this point in the history
  • Loading branch information
martindamgaardlorensen committed Aug 23, 2024
1 parent 9bf8f69 commit 2acb619
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/NJsonSchema.CodeGeneration.CSharp/Templates/Class.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{%- if IsDeprecated -%}
[System.Obsolete{% if HasDeprecatedMessage %}({{ DeprecatedMessage | literal }}){% endif %}]
{% endif -%}
{%- template Class.Annotations -%}
{%- template Class.Annotations %}
{{ TypeAccessModifier }} {% if IsAbstract %}abstract {% endif %}partial {% if GenerateNativeRecords %}record{% else %}class{% endif %} {{ClassName}} {%- template Class.Inheritance %}
{
{%- if IsTuple -%}
Expand Down Expand Up @@ -94,7 +94,7 @@
{%- if property.IsDeprecated -%}
[System.Obsolete{% if property.HasDeprecatedMessage %}({{ property.DeprecatedMessage | literal }}){% endif %}]
{%- endif -%}
{%- template Class.Property.Annotations -%}
{%- template Class.Property.Annotations %}
public {{ property.Type }} {{ property.PropertyName }}{% if RenderInpc == false and RenderPrism == false %} { get; {% if property.HasSetter and RenderRecord == false %}set; {% elsif RenderRecord and GenerateNativeRecords %}init; {% endif %}}{% if property.HasDefaultValue and RenderRecord == false %} = {{ property.DefaultValue }};{% elsif GenerateNullableReferenceTypes and RenderRecord == false %} = default!;{% endif %}
{% else %}
{
Expand Down
4 changes: 2 additions & 2 deletions src/NJsonSchema.CodeGeneration.CSharp/Templates/Enum.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
{%- if IsEnumAsBitFlags -%}
[System.Flags]
{%- endif -%}
{%- template Enum.Annotations -%}
{%- 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 -%}
{%- template Enum.Member.Annotations %}
{%- if IsEnumAsBitFlags -%}
{{ enum.Name }} = {{ enum.InternalFlagValue }},
{%- else -%}
Expand Down

0 comments on commit 2acb619

Please sign in to comment.