swaggerwcf
swaggerwcf copied to clipboard
Generating a friendly model name for generic dictionary
Some of our classes have properties of type IDictionary<string, string>
. The generated swagger.json file then creates and references the following definition:
System.Collections.Generic.KeyValuePair`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]: {
properties: {
Key: {
type: "string",
uniqueItems: false
},
Value: {
type: "string",
uniqueItems: false
}
},
type: "object",
format: "System.Collections.Generic.KeyValuePair`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]"
}
This, of course, is not rendered very nicely by Swagger UI. Any suggestions on how to provide a friendly name for this?
can't see any way of doing it