{"id":282316,"date":"2016-12-11T21:25:07","date_gmt":"2016-12-11T18:25:07","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=282316"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2016-12-11T18:25:07","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=282316","title":{"rendered":"\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Swashbuckle (Swagger) \u0434\u043b\u044f WebAPI"},"content":{"rendered":"<p>\u041a\u0442\u043e \u0445\u043e\u0442\u044c \u0440\u0430\u0437 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0432\u043e\u0439 WebAPI \u0437\u043d\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u0435\u043c\u043d\u0442\u044b, \u043a\u0430\u043a Postman \u0438\u043b\u0438 Advanced REST (\u044d\u043a\u0441\u0442\u0435\u043d\u0448\u0435\u043d\u044b \u0434\u043b\u044f Chrome). \u042d\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u0435\u043c\u043d\u0442\u044b \u0432\u0441\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u044b, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435 \u0443\u043c\u0435\u044e\u0442 \u0441\u0430\u043c\u0438 \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 API, \u043a\u0430\u043a\u0438\u0435 \u043e\u0442\u0434\u0430\u0435\u0442 \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430\u0445. \u042d\u0442\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 Swashbuckle, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e Swagger \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 UI. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u00ab\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c\u0438\u00bb \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430\u043c\u0438.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u041f\u0440\u0438\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0435\u043c \u043a \u041f\u0440\u043e\u0435\u043a\u0442\u0443<\/h2>\n<p>  Swashbuckle \u2014 \u044d\u0442\u043e NuGet \u043f\u0430\u043a\u0435\u0442, \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u0432 WebAPI \u0430\u0432\u0442\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0443\u0437\u043b\u0430\u0445 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 <a href=\"https:\/\/www.openapis.org\/\">OpenAPI<\/a>. \u042d\u0442\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0434\u0435\u0444\u0430\u043a\u0442\u043e, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043e\u043c, \u043a\u0430\u043a \u043d\u0435\u043a\u043e\u0433\u0434\u0430 WSDL. \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0448\u0430\u0433\u0430.  <\/p>\n<ol>\n<li>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0438\u0437 NuGet \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>Install-Package Swashbuckle<\/code><\/li>\n<li>\u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c XML \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/li>\n<li>\u0412 \u0444\u0430\u0439\u043b\u0435 <code>SwaggerConfig.cs<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u043f\u0430\u043a\u0435\u0442\u0430, \u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 <code>c.IncludeXmlComments(GetXmlCommentsPath());<\/code><\/li>\n<li>\u0412 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <code>GetXmlCommentsPath()<\/code> \u043f\u0438\u0448\u0435\u043c <code>return string.Format(@&quot;{0}\\bin\\BookStoreApiService.XML&quot;, AppDomain.CurrentDomain.BaseDirectory);<\/code><\/li>\n<\/ol>\n<p>  \u0412\u0441\u0451. \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b API, response codes \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043b\u0435\u0435.<\/p>\n<h3>\u041d\u044e\u0430\u043d\u0441\u044b \u043f\u0440\u0438 \u0414\u0435\u043f\u043b\u043e\u0435 WebAPI<\/h3>\n<p>  \u041f\u0440\u0438 \u0434\u0435\u043f\u043b\u043e\u0435 WebAPI \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e XML \u0444\u0430\u0439\u043b \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u0420\u0435\u043b\u0438\u0437 \u0441\u0431\u043e\u0440\u043a\u0430 \u043d\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u043e\u0431\u043e\u0439\u0442\u0438, \u043f\u043e\u0434\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0432 csproj \u0444\u0430\u0439\u043b. \u041d\u0430\u0434\u043e \u0432 PropertyGroup \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c <code>&lt;ExcludeXmlAssemblyFiles&gt;false&lt;\/ExcludeXmlAssemblyFiles&gt;<\/code> \u0438 \u0444\u0430\u0439\u043b \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 <code>bin\/<\/code>.<\/p>\n<p>  \u0414\u0440\u0443\u0433\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u043e\u0434\u0441\u0442\u0435\u0440\u0435\u0433\u0430\u0435\u0442 \u0442\u0435\u0445, \u043a\u0442\u043e \u043f\u0440\u044f\u0447\u0435\u0442 \u0441\u0432\u043e\u0439 API \u0437\u0430 \u043f\u0440\u043e\u043a\u0441\u0438. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u043c, \u043d\u043e \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u041f\u0440\u043e\u043a\u0441\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0445\u0435\u0434\u0435\u0440\u044b \u043a \u0440\u0435\u043a\u0432\u0435\u0441\u0442\u0443, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u0443\u0437\u043d\u0430\u0451\u043c, \u043a\u0430\u043a\u043e\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c URL \u0435\u043d\u0434\u043f\u043e\u043d\u0438\u0442\u043e\u0432 \u0434\u043b\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u043e\u0432\u0430\u043d\u0438\u044f URL \u0437\u0430 \u043f\u0440\u043e\u043a\u0441\u0438<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">\/\/ \u0432 \u0444\u0430\u0439\u043b\u0435 SwaggerConfig.cs c.RootUrl(req =&gt; ComputeClientHost(req));  \/\/ \u043d\u0438\u0436\u0435 \u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u0435\u0442\u043e\u0434\u0430 public static string ComputeClientHost(HttpRequestMessage req) {     var authority = req.RequestUri.Authority;     var scheme = req.RequestUri.Scheme;     \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0445\u043e\u0441\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0438\u0434\u0438\u0442 \u043a\u043b\u0438\u0435\u043d\u0442     if (req.Headers.Contains(&quot;X-Forwarded-Host&quot;))     {         \/\/ \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0446\u0435\u043f\u043e\u0447\u043a\u043e\u0439 \u043f\u0440\u043e\u043a\u0441\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0437\u044f\u0442\u044c \u0441\u0430\u043c\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u0439         var xForwardedHost = req.Headers.GetValues(&quot;X-Forwarded-Host&quot;).First();         var firstForwardedHost = xForwardedHost.Split(',')[0];         authority = firstForwardedHost;     }     \/\/ \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u043c     if (req.Headers.Contains(&quot;X-Forwarded-Proto&quot;))     {         var xForwardedProto = req.Headers.GetValues(&quot;X-Forwarded-Proto&quot;).First();         xForwardedProto = xForwardedProto.Split(',')[0];         scheme = xForwardedProto;     }\t     return scheme + &quot;:\/\/&quot; + authority; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Response Codes<\/h3>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 HTTP Status Codes \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e XML \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432 \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0443\u0441 \u043a\u043e\u0434\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">\/\/\/ &lt;response code=&quot;404&quot;&gt;Not Found&lt;\/response&gt;  [SwaggerResponse(HttpStatusCode.NotFound, Type = typeof(Model), Description = &quot;Not Found: no such endpoint&quot;)] <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435\u043e\u0431\u0445\u0440\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e XML \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u0435\u0440\u0435\u0434 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b, \u0435\u0441\u043b\u0438 \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u044b \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u043c\u0435\u0442\u043e\u0434\u0430. \u0422\u0430\u043a \u0436\u0435, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f XML \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u0441\u0435 \u043a\u043e\u0434\u0430, \u0432\u043a\u043b\u044e\u0447\u0430\u044f 200 (OK), \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 SwaggerResponse \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0442.\u043a. \u043e\u043d \u043b\u0438\u0448\u0435\u043d \u044d\u0442\u0438\u0445 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432. \u041a\u043e\u0433\u0434\u0430 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u0434, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 201 (Created), \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0433\u043e 200, \u043f\u0435\u0440\u0432\u044b\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <code>[SwaggerResponseRemoveDefaults]<\/code>.<\/p>\n<p>  \u0414\u043b\u044f \u043b\u0435\u043d\u0438\u0432\u044b\u0445 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u043a\u043e\u0434\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 400 (BadRequest) \u0438\u043b\u0438 401 (Unauthorized)) \u0441\u0440\u0430\u0437\u0443 \u043a\u043e \u0432\u0441\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IOperationFilter \u0438 \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e c.OperationFilter&lt;T&gt;();.   <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043c\u0435\u0442\u043e\u0434\u0430 Apply \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u0434\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">HttpStatusCode[] _codes; \/\/ \u043a\u043e\u0434\u044b \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) {     \/\/ \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u044d\u0442\u0430 \u043f\u0440\u043e\u043f\u0435\u0440\u0442\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430     if (operation.responses == null)         operation.responses = new Dictionary&lt;string, Response&gt;();     foreach (var code in _codes) {         var codeNum = ((int)code).ToString();         var codeName = code.ToString();         \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435         if (!operation.responses.ContainsKey(codeNum))             operation.responses.Add(codeNum, new Response { description = codeName });     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h2>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f WebAPI \u0438 Swashbuckle<\/h2>\n<p>  <\/p>\n<blockquote><p>\u0412 \u0442\u0435\u043a\u0441\u0442\u0435 \u043d\u0438\u0436\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Basic \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u043e \u043f\u0430\u043a\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435.<\/p><\/blockquote>\n<p>  \u0415\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f AuthorizeAttribute \u0442\u043e Swashbuckle \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0442 UI, \u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0443\u0442. \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0443\u0442\u0435\u0439 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438:  <\/p>\n<ol>\n<li>\u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0443\u044e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e<\/li>\n<li>\u0447\u0435\u0440\u0435\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442\u0435<\/li>\n<li>\u0447\u0435\u0440\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439<\/li>\n<li>\u0447\u0435\u0440\u0435\u0437 javascript<\/li>\n<\/ol>\n<h3>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u0430\u044f \u0432 \u0411\u0440\u0430\u0443\u0437\u0435\u0440<\/h3>\n<p>  \u0412\u0441\u0442\u0440\u043e\u0435\u043d\u0430\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440:  <\/p>\n<pre><code class=\"cs\">\/\/ Basic Authorization attributes config.Filters.Add(new AuthorizeAttribute()); config.Filters.Add(new BasicAuthenticationFilter()); \/\/ \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f IAuthenticationFilter <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u0432 \u0438\u0445 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 WebAPI, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u0432\u0432\u0435\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u0443\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0442\u0430\u043a \u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e, \u043a\u0430\u043a \u0432\u0432\u0435\u0441\u0442\u0438.<\/p>\n<h3>\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u0430\u044f \u0424\u043e\u0440\u043c\u0430 \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 Swashbuckle<\/h3>\n<p>  \u0414\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u0434\u043e\u0431\u043d\u0435\u0435 \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435, \u0442.\u043a. \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443. \u0427\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 \u043f\u0430\u043a\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<ol>\n<li>\u043a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/li>\n<li>\u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 Swagger \u0440\u0430\u0437\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 <code>c.BasicAuth(&quot;basic&quot;).Description(&quot;Basic HTTP Authentication&quot;);<\/code><\/li>\n<li>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 IOperationFilter, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u044d\u0442\u043e\u043c \u0432 \u0443\u0437\u043b\u044b <code>c.OperationFilter&lt;MarkSecuredMethodsOperationFilter&gt;();<\/code><\/li>\n<\/ol>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 Apply \u044d\u0442\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) {     var filterPipeline = apiDescription.ActionDescriptor.GetFilterPipeline();     \/\/ check if authorization is required     var isAuthorized = filterPipeline         .Select(filterInfo =&gt; filterInfo.Instance)         .Any(filter =&gt; filter is IAuthorizationFilter);     \/\/ check if anonymous access is allowed     var allowAnonymous = apiDescription.ActionDescriptor.GetCustomAttributes&lt;AllowAnonymousAttribute&gt;().Any();     if (isAuthorized && !allowAnonymous)     {         if (operation.security == null)             operation.security = new List&lt;IDictionary&lt;string, IEnumerable&lt;string&gt;&gt;&gt;();         var auth = new Dictionary&lt;string, IEnumerable&lt;string&gt;&gt;         {             {&quot;basic&quot;, Enumerable.Empty&lt;string&gt;()}         };         operation.security.Add(auth);     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0444\u043e\u0440\u043c\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/15e\/f80\/620\/15ef80620ff24dcb93d23a1fedea5de2.png\"\/><\/p>\n<h3>\u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0438 JS \u041a\u043e\u0434\u043e\u043c<\/h3>\n<p>  <\/p>\n<blockquote><p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0441 IOperationFilter \u0438 \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0432\u043e\u0435\u0433\u043e JavaScript.<\/p><\/blockquote>\n<p>  \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 body \u0438 query, \u043d\u043e \u0438 \u0432 header. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0445\u0435\u0448.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">operation.parameters.Add(new Parameter {     name = &quot;Authorization&quot;,     @in = &quot;header&quot;, \/\/ \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0432 \u0445\u0435\u0434\u0435\u0440\u0435     description = &quot;Basic U3dhZ2dlcjpUZXN0&quot;, \/\/ Basic Swagger:Test     required = true, \/\/ \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430     type = &quot;string&quot; }); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0432\u043e\u0435\u0433\u043e JavaScript \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0445\u0435\u0434\u0435\u0440\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:  <\/p>\n<ol>\n<li>\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c JS \u0444\u0430\u0439\u043b, \u043a\u0430\u043a embedded \u0440\u0435\u0441\u0443\u0440\u0441<\/li>\n<li>\u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Swagger \u0440\u0430\u0437\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0438\u043c\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u0430: <code>c.InjectJavaScript(thisAssembly, &quot;assembly.namesapce.swagger-basic-auth.js&quot;);<\/code><\/li>\n<li>\u0432 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a: <code>swaggerUi.api.clientAuthorizations.add(&quot;basic&quot;, new SwaggerClient.ApiKeyAuthorization(&quot;Authorization&quot;, &quot;Basic U3dhZ2dlcjpUZXN0&quot;, &quot;header&quot;));<\/code><\/li>\n<\/ol>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u0445\u0435\u0434\u0435\u0440\u0430 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0443. \u0412\u043e\u043e\u0431\u0449\u0435, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e JS \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0445\u0435\u0434\u0435\u0440\u044b, \u043a\u0430\u043a \u044f \u043f\u043e\u043d\u044f\u043b. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 key, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0432\u0435\u043d \u00abbasic\u00bb \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u0441\u043a\u043e\u0447\u0438\u043b\u0430 JS \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 JS \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u0433\u043e \u0445\u0435\u0434\u0435\u0440\u044b \u0432 Swagger<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">swaggerUi.api.clientAuthorizations.add(&quot;custom1&quot;, new SwaggerClient.ApiKeyAuthorization(&quot;X-Header-1&quot;, &quot;value1&quot;, &quot;header&quot;)); swaggerUi.api.clientAuthorizations.add(&quot;custom2&quot;, new SwaggerClient.ApiKeyAuthorization(&quot;X-Header-2&quot;, &quot;value2&quot;, &quot;header&quot;)); swaggerUi.api.clientAuthorizations.add(&quot;custom3&quot;, new SwaggerClient.ApiKeyAuthorization(&quot;X-Header-3&quot;, &quot;value3&quot;, &quot;header&quot;)); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h3>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0425\u0435\u0434\u0435\u0440\u0430\u043c\u0438<\/h3>\n<p>  \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043d\u0435\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0445\u0435\u0434\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0445\u0435\u0434\u0435\u0440\u044b \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0435. \u041e\u0431\u044b\u0447\u043d\u043e, \u0432 pipeline WebAPI \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f message handler, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442\u0441\u044f DelegatingHandler \u0438 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 WebAPI <code>config.MessageHandlers.Add(new MandatoryHeadersHandler());<\/code>. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Swagger \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u043b\u0438\u0431\u043e, \u0442.\u043a. \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043d\u0435\u043c\u0443 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0443\u0442, \u0442.\u043a. \u0445\u0435\u043d\u0434\u043b\u0435\u0440 \u0438\u0445 \u0437\u0430\u043f\u0440\u0435\u0442\u0438\u0442. \u0418\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u044d\u0442\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432 \u0441\u0432\u043e\u0435\u043c \u0445\u0435\u043d\u0434\u043b\u0435\u0440\u0435. \u0422.\u0435. \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a URL swagger \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e. \u0410 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0445\u0435\u0434\u0435\u0440\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e JS, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u043e\u0441\u044c \u0432\u044b\u0448\u0435.<\/p>\n<h2>\u042d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u0441 \u041f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c\u0438 \u041c\u0435\u0442\u043e\u0434\u0430\u043c\u0438<\/h2>\n<p>  WebAPI \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0448\u043d-\u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430, \u0432\u044b\u0437\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430.  <\/p>\n<pre><code class=\"cs\">[ResponseType(typeof (IList&lt;Model&gt;))] public IHttpActionResult Get() {...}  [ResponseType(typeof (IList&lt;Model&gt;))] public IHttpActionResult Get(int count, bool descending) {...} <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f Swagger \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438 UI \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 500: Not supported by Swagger 2.0: Multiple operations with path &#8216;api\/&lt;URL&gt;&#8217; and method &#8216;&lt;METHOD&gt;&#8217;. See the config setting \u2014 \\\u00abResolveConflictingActions\\\u00bb for a potential workaround.<br \/>  \u041a\u0430\u043a \u0438 \u0441\u043e\u0432\u0435\u0442\u0443\u0435\u0441\u044f \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0438, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0438\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e \u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432:  <\/p>\n<ol>\n<li>\u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434<\/li>\n<li>\u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u043c\u0435\u0442\u043e\u0434 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438<\/li>\n<li>\u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430<\/li>\n<\/ol>\n<p>  \u043f\u0435\u0440\u0432\u044b\u0439 \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 <code>c.ResolveConflictingActions(Func&lt;IEnumerable&lt;ApiDescription&gt;, ApiDescription&gt; conflictingActionsResolver)<\/code>. \u0421\u0443\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e\u0431\u044b \u0432\u0437\u044f\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043e\u0434\u0438\u043d.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u0434\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">return apiDescriptions =&gt; {     var descriptions = apiDescriptions as ApiDescription[] ?? apiDescriptions.ToArray();     var first = descriptions.First(); \/\/ \u0441\u0442\u0440\u043e\u0438\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430     var parameters = descriptions.SelectMany(d =&gt; d.ParameterDescriptions).ToList();      first.ParameterDescriptions.Clear();     \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438 \u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0445 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438     foreach (var parameter in parameters)         if (first.ParameterDescriptions.All(x =&gt; x.Name != parameter.Name))         {             first.ParameterDescriptions.Add(new ApiParameterDescription             {                 Documentation = parameter.Documentation,                 Name = parameter.Name,                 ParameterDescriptor = new OptionalHttpParameterDescriptor((ReflectedHttpParameterDescriptor) parameter.ParameterDescriptor),                 Source = parameter.Source             });         }     return first; };  \/\/ \u044d\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0442.\u043a. IsOptional \u0438\u043c\u0435\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e getter public class OptionalHttpParameterDescriptor : ReflectedHttpParameterDescriptor {     public OptionalHttpParameterDescriptor(ReflectedHttpParameterDescriptor parameterDescriptor)         : base(parameterDescriptor.ActionDescriptor, parameterDescriptor.ParameterInfo)     {     }     public override bool IsOptional =&gt; true; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h3>\u041a\u0440\u0430\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0421\u043f\u043e\u0441\u043e\u0431<\/h3>\n<p>  \u0422\u0440\u0435\u0442\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0431\u043e\u043b\u0435\u0435 \u043a\u0430\u0440\u0434\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435\u043c \u043e\u0442 OpenAPI \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0432\u0441\u0435 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/2b4\/09f\/73c\/2b409f73c00848e985b21a299ae1f16d.png\"\/><br \/>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 Swagger \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e IDocumentFilter \u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u0412 \u0436\u0438\u0437\u043d\u0438 \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0434\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043f\u043d\u0435\u043c \u0435\u0449\u0435 \u0433\u043b\u0443\u0431\u0436\u0435. \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0441\u043f\u043e\u0441\u043e\u0431, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u043e\u0432\u0430\u043b \u0431\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u043c, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Swashbuckle \u2014 \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c SwaggerGenerator. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 <code>c.CustomProvider(defaultProvider =&gt; new NewSwaggerProvider(defaultProvider));<\/code>. \u0427\u0442\u043e \u0431\u044b \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<ol>\n<li>\u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0439 class MySwaggerGenerator: ISwaggerProvider<\/li>\n<li>\u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Swashbuckle \u043d\u0430 GitHub \u043d\u0430\u0439\u0442\u0438 SwaggerGenerator.cs (<a href=\"https:\/\/github.com\/domaindrivendev\/Swashbuckle\/blob\/master\/Swashbuckle.Core\/Swagger\/SwaggerGenerator.cs\">\u043e\u043d \u0442\u0443\u0442<\/a>)<\/li>\n<li>\u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 GetSwagger \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043d\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u0441\u0432\u043e\u0439<\/li>\n<li>\u043f\u0440\u043e\u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430<\/li>\n<li>\u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Swagger<\/li>\n<\/ol>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">private readonly IApiExplorer _apiExplorer; private readonly IDictionary&lt;string, Info&gt; _apiVersions; private readonly JsonSerializerSettings _jsonSerializerSettings; private readonly SwaggerGeneratorOptions _options;  public MultiOperationSwaggerGenerator(ISwaggerProvider sp) {     var sg = (SwaggerGenerator) sp;     var privateFields = sg.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic);     _apiExplorer = privateFields.First(pf =&gt; pf.Name == &quot;_apiExplorer&quot;).GetValue(sg) as IApiExplorer;     _jsonSerializerSettings = privateFields.First(pf =&gt; pf.Name == &quot;_jsonSerializerSettings&quot;).GetValue(sg) as JsonSerializerSettings;     _apiVersions = privateFields.First(pf =&gt; pf.Name == &quot;_apiVersions&quot;).GetValue(sg) as IDictionary&lt;string, Info&gt;;     _options = privateFields.First(pf =&gt; pf.Name == &quot;_options&quot;).GetValue(sg) as SwaggerGeneratorOptions; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u043d\u0430\u0439\u0442\u0438 \u043c\u0435\u0441\u0442\u043e <code>var paths = GetApiDescriptionsFor(apiVersion)....<\/code>. \u042d\u0442\u043e \u0442\u043e \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0443\u0442\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e GroupBy() \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 <code>.GroupBy(apiDesc =&gt; apiDesc.RelativePath)<\/code>.<\/p>\n<h2>\u041b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430<\/h2>\n<p>  <\/p>\n<ol>\n<li><a href=\"http:\/\/petstore.swagger.io\/\">Swagger example<\/a><\/li>\n<li><a href=\"http:\/\/nordicapis.com\/top-specification-formats-for-rest-apis\/\">RESTful Web API specification formats<\/a><\/li>\n<li><a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/app-service-api-dotnet-swashbuckle-customize\/\">Customize Swashbuckle-generated API definitions<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/OAI\/OpenAPI-Specification\/blob\/master\/versions\/2.0.md#schema\">Swagger object schema<\/a><\/li>\n<li><a href=\"https:\/\/www.asp.net\/web-api\/overview\/security\/authentication-filters\">Authentication Filters in ASP.NET Web API 2<\/a><\/li>\n<li><a href=\"https:\/\/weblog.west-wind.com\/posts\/2013\/apr\/18\/a-webapi-basic-authentication-authorization-filter\">A WebAPI Basic Authentication Authorization Filter<\/a><\/li>\n<li><a href=\"http:\/\/stevemichelotti.com\/customize-authentication-header-in-swaggerui-using-swashbuckle\/\">Customize Authentication Header in SwaggerUI using Swashbuckle<\/a><\/li>\n<li><a href=\"https:\/\/www.asp.net\/web-api\/overview\/advanced\/http-message-handlers\">HTTP Message Handlers in ASP.NET Web API<\/a><\/li>\n<li><a href=\"http:\/\/blog.devbot.net\/action-conflicts\/\">Managing Action Conflicts in ASP.Net 5 with Swashbuckle<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/xtrmstep\/SwaggerTutorial\/\">Tutorial Swagger project at GitHub<\/a><\/li>\n<\/ol>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/317338\/\"> https:\/\/habrahabr.ru\/post\/317338\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0442\u043e \u0445\u043e\u0442\u044c \u0440\u0430\u0437 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0432\u043e\u0439 WebAPI \u0437\u043d\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u0435\u043c\u043d\u0442\u044b, \u043a\u0430\u043a Postman \u0438\u043b\u0438 Advanced REST (\u044d\u043a\u0441\u0442\u0435\u043d\u0448\u0435\u043d\u044b \u0434\u043b\u044f Chrome). \u042d\u0442\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u0435\u043c\u043d\u0442\u044b \u0432\u0441\u0435\u043c \u0443\u0434\u043e\u0431\u043d\u044b, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435 \u0443\u043c\u0435\u044e\u0442 \u0441\u0430\u043c\u0438 \u0443\u0437\u043d\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 API, \u043a\u0430\u043a\u0438\u0435 \u043e\u0442\u0434\u0430\u0435\u0442 \u0438 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430\u0445. \u042d\u0442\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u043e \u0440\u0435\u0448\u0430\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 Swashbuckle, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e Swagger \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438 UI. \u041f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0435\u0433\u043e \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0435\u0442\u0430\u043b\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u00ab\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c\u0438\u00bb \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u0430\u043c\u0438.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-282316","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=282316"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282316\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282316"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282316"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}