I'm using ServiceStack v 3.9.71 and the ServiceStack.Text.EnumMemberSerializer
assembly to serialize enums into readable text.
This works great, my enum values are serialized into the name I've specified using the EnumMemberAttribute
.
The problem, though, is Swagger does not use my names. My guess is it just calls the .ToString()
method on the enum values rather than the EnumMemberAttribute
value.
Here is the order in which I setup the serialization. (In AppHost):
new EnumSerializerConfigurator()
.WithEnumTypes(new Type[] { typeof(MyEnum) })
.Configure();
Plugins.Add(new SwaggerFeature());
It doesn't seem to matter if the enum serializer is set before or after the swagger feature is added.