Пример #1
0
 public static ApiSpecification ToApiSpecification(this IApiDescription apiDescription)
 {
     return(new ApiSpecification
     {
         ExternalDocs = new ExternalDocs
         {
             Description = apiDescription.ExternalDocsDescription,
             Url = apiDescription.ExternalDocsUrl
         },
         Info = new Info
         {
             Title = apiDescription.Title,
             Description = apiDescription.Description,
             Contact = new Contact
             {
                 Email = apiDescription.ContactEmail,
                 Name = apiDescription.ContactName,
                 Url = apiDescription.ContactUrl
             },
             Licence = new License
             {
                 Name = apiDescription.LicenseName,
                 Url = apiDescription.LicenseUrl
             },
             TermsOfService = apiDescription.TermsOfService,
             Version = apiDescription.Version
         },
         BasePath = apiDescription.BasePath.StartsWith("/")
             ? apiDescription.BasePath
             : '/' + apiDescription.BasePath
     });
 }
Пример #2
0
 public ApiUpgrade(IApiDescription fromApi, IApiDescription toApi, bool needsManualUpgradation, string documentationUrl)
 {
     FromApi = fromApi;
     ToApi   = toApi;
     NeedsManualUpgradation = needsManualUpgradation;
     DocumentationUrl       = documentationUrl;
 }
 public ApiSpecificationFactory(IRouteCacheProvider routeCacheProvider, IApiDescription apiDescription)
 {
     _routeCacheProvider = routeCacheProvider;
     _apiDescription     = apiDescription;
 }
Пример #4
0
 public static bool IsAlias(this IApiDescription description)
 {
     return(description.GetActionAttributes <UrlAliasAttribute>()
            .Any(a => a.Urls.ContainsUncase(description.RouteTemplate)));
 }