应该如何为Swagger建模此类以正确解释它?
public myEnum {
alpha,
bravo,
charlie
}
public class myClass {
public List<myEnum> myList { get; set; }
}
我不能简单地这样做:
{
"myClass": {
"id": "myClass",
"properties": {
"myList": {
"type": "string", //??? it isn't a string, it's a List...
"allowableValues": {
"valueType": "LIST",
"values": [
"alpha",
"bravo",
"charlie"
]
}
}
}
}
}
这也没有任何意义:
{
"myEnum": {
"id": "myEnum",
"properties": {
//??? there aren't any...
}
},
"myClass": {
"id": "myClass",
"properties": {
"myList": {
"type": "List",
"items": {
"$ref": "myEnum"
}
}
}
}
}