RicoSuter / NJsonSchema

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

Allow custom attributes on properties #1558

Open boyvanduuren opened 2 years ago

boyvanduuren commented 2 years ago

Hi there,

I'd like to use OpenAPI spec extensions to add attributes to properties in our generated models. I have this working by overriding the https://github.com/RicoSuter/NJsonSchema/blob/master/src/NJsonSchema.CodeGeneration.CSharp/Templates/Class.liquid file.

Would you be open to a pull request to reference a new, empty, template file on https://github.com/RicoSuter/NJsonSchema/blob/master/src/NJsonSchema.CodeGeneration.CSharp/Templates/Class.liquid#L54 so that we can make these types of extensions without having to override the whole Class.liquid file? Similar to for instance the https://github.com/RicoSuter/NJsonSchema/blob/master/src/NJsonSchema.CodeGeneration.CSharp/Templates/Class.Annotations.liquid template.