I'm trying to get Swagger to recognize the type returned by my 
Action/Method in my C# Web Api. I've coded my method like this:

    [ResponseType("200", typeof(List<MyCustomType>)), ResponseType("500", 
    public async Task<IHttpActionResult> GetMyCustomsAsync()
        var myList = Mapper.Map<List<MyCustomType>>(await _myService.
        foreach (var thisItem in myList)
            thisItem.Children = Mapper.Map<IList<CustomChildType>>(await 

        return Ok(myList);

Swagger returns this:

Response Class (Status 200)
Inline Model [
 Inline Model 1
]Inline Model 1 {
 children (Array[CustomChildType], optional)
}CustomChildType {
 childId (integer),
 name (string, optional)

I've tried IList instead of List, but receive the same result.

Am I defining the list incorrectly? How can I get it to report the correct 

You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to swagger-swaggersocket+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to