In .net core prior to version 3 there when Newtonsof.Json
was used there was a possibility to inherit from StringEnumConverter
to add additional validation or a custom error message for the process of binding a string to enum.
I cannot find it's counterpart in .Net Core 3. There is a JsonStringEnumConverter
but it is sealed. It seems the only option is to write the whole converter myself and I'd like to avoid that.
P.S. I know it is possible to fall back to Newtonsoft.Json
and use it as before, but I want to use the new Microsoft implementation.