RicoSuter / NJsonSchema

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

Support configuring whether to generate StringEnumConverter #1646

Open lahma opened 10 months ago

lahma commented 10 months ago

STJ has problems with JsonStringEnumConverter when values come from EnumMemberAttribute. This can be bypassed by configuring serializer setting, but property setting win over them so there needs to be a switch to disable this generation. Defaults to true to work like before.

RicoSuter commented 9 months ago

The client/DTO code should be self-contained and I do not see why this is a problem?

lahma commented 9 months ago

The problem was that if there's attribute present, I cannot configure it more globally on serializer level. If there's attribute on property - it will win. So if I configure serializer to output X it won't happen when there's NJsonSchema generated property present that says it should be Y. The use case is to suppress the property generation and let the serializer use more global defaults.