NJsonSchema icon indicating copy to clipboard operation
NJsonSchema copied to clipboard

Support configuring whether to generate StringEnumConverter

Open lahma opened this issue 1 year ago • 2 comments

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.

lahma avatar Nov 08 '23 09:11 lahma

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

RicoSuter avatar Nov 28 '23 16:11 RicoSuter

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.

lahma avatar Nov 28 '23 18:11 lahma