3
服務堆棧是否支持Swagger中的模型。 在下面Swagger UI和ServiceStack
[Route("/User", "GET", Summary = "Get all the users available")]
[Route("/User", "POST, PUT", Summary = "Create a new user")]
[Route("/User/{Id}", "GET", Summary = "Get user with a specific id")]
public class User : RequestBase, IReturn<UserResponse>
{
[ApiMember(Name = "Id", Description = "The User Id", ParameterType = "path", DataType = "int", IsRequired = false)]
public int Id { get; set; }
[ApiMember(Name = "UserData", Description = "The User Data", ParameterType = "body", DataType = "complex", IsRequired = false)]
public UserData Entry { get; set; }
}
示例代碼我想的UserData是一個複雜的類型或容器類型。但是,如果我將它定義爲其中的一個,那麼SwaggerUI中的所有內容都是一個文本區域框。我沒有看到我在Petstore示例中看到的Model和ModelSchema鏈接。型「身材」的
http://petstore.swagger.wordnik.com/#!/pet/addPet_post_1