コード例 #1
0
ファイル: SwaggerGen.cs プロジェクト: Tom-Kennedy/Swagger.Net
 /// <summary>
 /// Create an api element 
 /// </summary>
 /// <param name="api">Description of the api via the ApiExplorer</param>
 /// <returns>A resource api</returns>
 public Api CreateApi(ApiDescription api)
 {
     var returnSwaggerType = api.ActionDescriptor.ReturnType.GetSwaggerType();
     return new Api()
     {
         Path = "/" + api.GetCleanRelativePath(),
         Description = api.Documentation,
         Operations = new List<Operation>()
         {
             new Operation()
             {
                 HttpMethod = api.HttpMethod.ToString(),
                 Nickname = api.GetNickname(),
                 Type = returnSwaggerType.Type,
                 Summary = api.Documentation,
                 Notes = _docProvider.GetOperationNotes(api.ActionDescriptor),
                 Parameters = api.ParameterDescriptions.Select(CreateParameter)
             }
         }
     };
 }