RicoSuter / NJsonSchema

JSON Schema reader, generator and validator for .NET
http://NJsonSchema.org
MIT License
1.37k stars 529 forks source link

Annotations on separate lines? #1704

Open martindamgaardlorensen opened 2 months ago

martindamgaardlorensen commented 2 months ago

In #1693, I introduced annotations for enums and enum members similar to how it was introduced to class and class properties in #516 and #522. I can however see that with the syntax used now:

{%- template Xxx.Annotations -%}

..., any annotation, usually an attribute like:

[Foo] [Bar(Baz = 42)]

... will be placed on the same line as the following declaration like:

[Foo] [Bar(Baz = 42)]public class Bar { ... }

I would say the better option would be to have it as:

{%- template Xxx.Annotations %}

... not stripping whitespace from the right side of the expansion.

However, it seems this has changed back and forth in the past, and I am unable to see any reasoning for this - so before making a PR removing the "-" on the right side in all 4 cases of template Xxx.Annotations, I would like to know if there are good reasoning behind having the dash there?