I have code similar to the following
[ServiceContract(Namespace="blah")]
[SwaggerWcf("/v1/rest")]
[SwaggerWcfServiceInfo("x", "y")]
public interface IService
{
[OperationContract, WebGet()]
MyEnum GetEnum();
}
[DataContract(Namespace = "blah")]
[Flags]
public enum MyEnum
{
[EnumMember]
One = 1,
[EnumMember]
Two = 2
}
The resulting swagger JSON refers to #definitions/MyEnum as the ref for the method response type, but that definition does not exist in the definition. Thus I have an invalid swagger JSON.
Debugging this, it looks like it makes it into the list of types to include but then is ignored when including in the schema since it's treated as primitive. This is because all enums seem to be treated as type=integer + format=enum and all integers, whether or not they're enums are treated as primitive.
So can we exclude enums from the primitives check in TypeFormat?
I have code similar to the following
The resulting swagger JSON refers to
#definitions/MyEnumas the ref for the method response type, but that definition does not exist in the definition. Thus I have an invalid swagger JSON.Debugging this, it looks like it makes it into the list of types to include but then is ignored when including in the schema since it's treated as primitive. This is because all enums seem to be treated as type=integer + format=enum and all integers, whether or not they're enums are treated as primitive.
So can we exclude enums from the primitives check in TypeFormat?