From b42fb87060d838b0ad0350d26c72b42ad6944d8b Mon Sep 17 00:00:00 2001 From: Ricky Vega Date: Sun, 10 Nov 2019 14:11:41 -0600 Subject: [PATCH 1/3] Updating all nuget modules and created nuget package for Swashbuckle.Core 5.6.1 --- Swashbuckle.Core/Properties/AssemblyInfo.cs | 6 +- Swashbuckle.Core/Swashbuckle.Core.csproj | 35 +++++--- Swashbuckle.Core/app.config | 4 +- Swashbuckle.Core/packages.config | 10 ++- .../Swashbuckle.Dummy.Core.csproj | 27 +++--- Swashbuckle.Dummy.Core/app.config | 8 +- Swashbuckle.Dummy.Core/packages.config | 10 +-- .../Swashbuckle.Dummy.SelfHost.csproj | 24 +++--- Swashbuckle.Dummy.SelfHost/app.config | 8 +- Swashbuckle.Dummy.SelfHost/packages.config | 8 +- .../Swashbuckle.Dummy.WebHost.csproj | 32 ++++---- Swashbuckle.Dummy.WebHost/Web.config | 35 ++++---- Swashbuckle.Dummy.WebHost/packages.config | 8 +- Swashbuckle.Tests/Swashbuckle.Tests.csproj | 82 +++++++++++++------ Swashbuckle.Tests/app.config | 18 ++-- Swashbuckle.Tests/packages.config | 22 +++-- .../Properties/AssemblyInfo.cs | 6 +- .../Swashbuckle.WebHost.csproj | 4 +- Swashbuckle.WebHost/Swashbuckle.nuspec | 2 +- 19 files changed, 205 insertions(+), 144 deletions(-) diff --git a/Swashbuckle.Core/Properties/AssemblyInfo.cs b/Swashbuckle.Core/Properties/AssemblyInfo.cs index 7fb6554f4..d83311630 100644 --- a/Swashbuckle.Core/Properties/AssemblyInfo.cs +++ b/Swashbuckle.Core/Properties/AssemblyInfo.cs @@ -32,6 +32,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] -[assembly: AssemblyInformationalVersion("5.6.0")] \ No newline at end of file +[assembly: AssemblyVersion("5.6.1.0")] +[assembly: AssemblyFileVersion("5.6.1.0")] +[assembly: AssemblyInformationalVersion("5.6.1")] \ No newline at end of file diff --git a/Swashbuckle.Core/Swashbuckle.Core.csproj b/Swashbuckle.Core/Swashbuckle.Core.csproj index d830ccbba..be7a1f649 100644 --- a/Swashbuckle.Core/Swashbuckle.Core.csproj +++ b/Swashbuckle.Core/Swashbuckle.Core.csproj @@ -1,5 +1,5 @@  - + Debug @@ -9,12 +9,14 @@ Properties Swashbuckle Swashbuckle.Core - v4.0 + v4.7.2 512 ..\ true true + + true @@ -43,25 +45,27 @@ - - ..\packages\Newtonsoft.Json.7.0.1\lib\net40\Newtonsoft.Json.dll + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - ..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.dll + + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - - ..\packages\Microsoft.AspNet.WebApi.Client.4.0.20710.0\lib\net40\System.Net.Http.Formatting.dll + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll - - ..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll + + ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + - - ..\packages\Microsoft.AspNet.WebApi.Core.4.0.20710.0\lib\net40\System.Web.Http.dll + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll @@ -137,6 +141,13 @@ + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + - - + + - + - - - - - - - - - + - + - + + + + + + + + + \ No newline at end of file diff --git a/Swashbuckle.Dummy.WebHost/packages.config b/Swashbuckle.Dummy.WebHost/packages.config index 842b4bcdf..cc245d01d 100644 --- a/Swashbuckle.Dummy.WebHost/packages.config +++ b/Swashbuckle.Dummy.WebHost/packages.config @@ -1,7 +1,7 @@  - - - - + + + + \ No newline at end of file diff --git a/Swashbuckle.Tests/Swashbuckle.Tests.csproj b/Swashbuckle.Tests/Swashbuckle.Tests.csproj index 11466eaf6..6033eafaa 100644 --- a/Swashbuckle.Tests/Swashbuckle.Tests.csproj +++ b/Swashbuckle.Tests/Swashbuckle.Tests.csproj @@ -1,5 +1,6 @@  - + + Debug @@ -9,11 +10,13 @@ Properties Swashbuckle.Tests Swashbuckle.Tests - v4.5 + v4.7.2 512 ..\ true + + true @@ -39,27 +42,42 @@ false - - ..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll - True + + ..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll - - ..\packages\Microsoft.Owin.Hosting.3.0.1\lib\net45\Microsoft.Owin.Hosting.dll - True + + ..\packages\Microsoft.Owin.4.0.1\lib\net45\Microsoft.Owin.dll - - ..\packages\Microsoft.Owin.Testing.3.0.1\lib\net45\Microsoft.Owin.Testing.dll - True + + ..\packages\Microsoft.Owin.Hosting.4.0.1\lib\net45\Microsoft.Owin.Hosting.dll - - ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll + + ..\packages\Microsoft.Owin.Testing.4.0.1\lib\net45\Microsoft.Owin.Testing.dll - - ..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll + + ..\packages\Moq.4.13.1\lib\net45\Moq.dll - - ..\packages\NUnit.3.7.1\lib\net45\nunit.framework.dll - True + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\nunit.core.dll + False + + + ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\nunit.core.interfaces.dll + False + + + ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\nunit.framework.dll + + + ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\nunit.util.dll + False + + + ..\packages\NUnitTestAdapter.WithFramework.2.0.0\lib\NUnit.VisualStudio.TestAdapter.dll + False ..\packages\Owin.1.0\lib\net40\Owin.dll @@ -67,21 +85,25 @@ + - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll - True + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.6.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll - True + + ..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll - - ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.3\lib\net45\System.Web.Http.Owin.dll - True + + ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll + + + ..\packages\Microsoft.AspNet.WebApi.Owin.5.2.7\lib\net45\System.Web.Http.Owin.dll @@ -129,6 +151,12 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + + + + + + +
 
+
+ + diff --git a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/screen.css b/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/screen.css new file mode 100644 index 000000000..8280c3597 --- /dev/null +++ b/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/screen.css @@ -0,0 +1,1494 @@ +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ +.swagger-section pre code { + display: block; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section pre code, +.swagger-section pre .subst, +.swagger-section pre .tag .title, +.swagger-section pre .lisp .title, +.swagger-section pre .clojure .built_in, +.swagger-section pre .nginx .title { + color: black; +} +.swagger-section pre .string, +.swagger-section pre .title, +.swagger-section pre .constant, +.swagger-section pre .parent, +.swagger-section pre .tag .value, +.swagger-section pre .rules .value, +.swagger-section pre .rules .value .number, +.swagger-section pre .preprocessor, +.swagger-section pre .ruby .symbol, +.swagger-section pre .ruby .symbol .string, +.swagger-section pre .aggregate, +.swagger-section pre .template_tag, +.swagger-section pre .django .variable, +.swagger-section pre .smalltalk .class, +.swagger-section pre .addition, +.swagger-section pre .flow, +.swagger-section pre .stream, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .apache .cbracket, +.swagger-section pre .tex .command, +.swagger-section pre .tex .special, +.swagger-section pre .erlang_repl .function_or_atom, +.swagger-section pre .markdown .header { + color: #800; +} +.swagger-section pre .comment, +.swagger-section pre .annotation, +.swagger-section pre .template_comment, +.swagger-section pre .diff .header, +.swagger-section pre .chunk, +.swagger-section pre .markdown .blockquote { + color: #888; +} +.swagger-section pre .number, +.swagger-section pre .date, +.swagger-section pre .regexp, +.swagger-section pre .literal, +.swagger-section pre .smalltalk .symbol, +.swagger-section pre .smalltalk .char, +.swagger-section pre .go .constant, +.swagger-section pre .change, +.swagger-section pre .markdown .bullet, +.swagger-section pre .markdown .link_url { + color: #080; +} +.swagger-section pre .label, +.swagger-section pre .javadoc, +.swagger-section pre .ruby .string, +.swagger-section pre .decorator, +.swagger-section pre .filter .argument, +.swagger-section pre .localvars, +.swagger-section pre .array, +.swagger-section pre .attr_selector, +.swagger-section pre .important, +.swagger-section pre .pseudo, +.swagger-section pre .pi, +.swagger-section pre .doctype, +.swagger-section pre .deletion, +.swagger-section pre .envvar, +.swagger-section pre .shebang, +.swagger-section pre .apache .sqbracket, +.swagger-section pre .nginx .built_in, +.swagger-section pre .tex .formula, +.swagger-section pre .erlang_repl .reserved, +.swagger-section pre .prompt, +.swagger-section pre .markdown .link_label, +.swagger-section pre .vhdl .attribute, +.swagger-section pre .clojure .attribute, +.swagger-section pre .coffeescript .property { + color: #88F; +} +.swagger-section pre .keyword, +.swagger-section pre .id, +.swagger-section pre .phpdoc, +.swagger-section pre .title, +.swagger-section pre .built_in, +.swagger-section pre .aggregate, +.swagger-section pre .css .tag, +.swagger-section pre .javadoctag, +.swagger-section pre .phpdoc, +.swagger-section pre .yardoctag, +.swagger-section pre .smalltalk .class, +.swagger-section pre .winutils, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .go .typename, +.swagger-section pre .tex .command, +.swagger-section pre .markdown .strong, +.swagger-section pre .request, +.swagger-section pre .status { + font-weight: bold; +} +.swagger-section pre .markdown .emphasis { + font-style: italic; +} +.swagger-section pre .nginx .built_in { + font-weight: normal; +} +.swagger-section pre .coffeescript .javascript, +.swagger-section pre .javascript .xml, +.swagger-section pre .tex .formula, +.swagger-section pre .xml .javascript, +.swagger-section pre .xml .vbscript, +.swagger-section pre .xml .css, +.swagger-section pre .xml .cdata { + opacity: 0.5; +} +.swagger-section .hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section .hljs, +.swagger-section .hljs-subst { + color: #444; +} +.swagger-section .hljs-keyword, +.swagger-section .hljs-attribute, +.swagger-section .hljs-selector-tag, +.swagger-section .hljs-meta-keyword, +.swagger-section .hljs-doctag, +.swagger-section .hljs-name { + font-weight: bold; +} +.swagger-section .hljs-built_in, +.swagger-section .hljs-literal, +.swagger-section .hljs-bullet, +.swagger-section .hljs-code, +.swagger-section .hljs-addition { + color: #1F811F; +} +.swagger-section .hljs-regexp, +.swagger-section .hljs-symbol, +.swagger-section .hljs-variable, +.swagger-section .hljs-template-variable, +.swagger-section .hljs-link, +.swagger-section .hljs-selector-attr, +.swagger-section .hljs-selector-pseudo { + color: #BC6060; +} +.swagger-section .hljs-type, +.swagger-section .hljs-string, +.swagger-section .hljs-number, +.swagger-section .hljs-selector-id, +.swagger-section .hljs-selector-class, +.swagger-section .hljs-quote, +.swagger-section .hljs-template-tag, +.swagger-section .hljs-deletion { + color: #880000; +} +.swagger-section .hljs-title, +.swagger-section .hljs-section { + color: #880000; + font-weight: bold; +} +.swagger-section .hljs-comment { + color: #888888; +} +.swagger-section .hljs-meta { + color: #2B6EA1; +} +.swagger-section .hljs-emphasis { + font-style: italic; +} +.swagger-section .hljs-strong { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap { + line-height: 1; + font-family: "Droid Sans", sans-serif; + min-width: 760px; + max-width: 960px; + margin-left: auto; + margin-right: auto; + /* JSONEditor specific styling */ +} +.swagger-section .swagger-ui-wrap b, +.swagger-section .swagger-ui-wrap strong { + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap q, +.swagger-section .swagger-ui-wrap blockquote { + quotes: none; +} +.swagger-section .swagger-ui-wrap p { + line-height: 1.4em; + padding: 0 0 10px; + color: #333333; +} +.swagger-section .swagger-ui-wrap q:before, +.swagger-section .swagger-ui-wrap q:after, +.swagger-section .swagger-ui-wrap blockquote:before, +.swagger-section .swagger-ui-wrap blockquote:after { + content: none; +} +.swagger-section .swagger-ui-wrap .heading_with_menu h1, +.swagger-section .swagger-ui-wrap .heading_with_menu h2, +.swagger-section .swagger-ui-wrap .heading_with_menu h3, +.swagger-section .swagger-ui-wrap .heading_with_menu h4, +.swagger-section .swagger-ui-wrap .heading_with_menu h5, +.swagger-section .swagger-ui-wrap .heading_with_menu h6 { + display: block; + clear: none; + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 60%; +} +.swagger-section .swagger-ui-wrap table { + border-collapse: collapse; + border-spacing: 0; +} +.swagger-section .swagger-ui-wrap table thead tr th { + padding: 5px; + font-size: 0.9em; + color: #666666; + border-bottom: 1px solid #999999; +} +.swagger-section .swagger-ui-wrap table tbody tr:last-child td { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap table tbody tr.offset { + background-color: #f0f0f0; +} +.swagger-section .swagger-ui-wrap table tbody tr td { + padding: 6px; + font-size: 0.9em; + border-bottom: 1px solid #cccccc; + vertical-align: top; + line-height: 1.3em; +} +.swagger-section .swagger-ui-wrap ol { + margin: 0px 0 10px; + padding: 0 0 0 18px; + list-style-type: decimal; +} +.swagger-section .swagger-ui-wrap ol li { + padding: 5px 0px; + font-size: 0.9em; + color: #333333; +} +.swagger-section .swagger-ui-wrap ol, +.swagger-section .swagger-ui-wrap ul { + list-style: none; +} +.swagger-section .swagger-ui-wrap h1 a, +.swagger-section .swagger-ui-wrap h2 a, +.swagger-section .swagger-ui-wrap h3 a, +.swagger-section .swagger-ui-wrap h4 a, +.swagger-section .swagger-ui-wrap h5 a, +.swagger-section .swagger-ui-wrap h6 a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap h1 a:hover, +.swagger-section .swagger-ui-wrap h2 a:hover, +.swagger-section .swagger-ui-wrap h3 a:hover, +.swagger-section .swagger-ui-wrap h4 a:hover, +.swagger-section .swagger-ui-wrap h5 a:hover, +.swagger-section .swagger-ui-wrap h6 a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap h1 span.divider, +.swagger-section .swagger-ui-wrap h2 span.divider, +.swagger-section .swagger-ui-wrap h3 span.divider, +.swagger-section .swagger-ui-wrap h4 span.divider, +.swagger-section .swagger-ui-wrap h5 span.divider, +.swagger-section .swagger-ui-wrap h6 span.divider { + color: #aaaaaa; +} +.swagger-section .swagger-ui-wrap a { + color: #547f00; +} +.swagger-section .swagger-ui-wrap a img { + border: none; +} +.swagger-section .swagger-ui-wrap article, +.swagger-section .swagger-ui-wrap aside, +.swagger-section .swagger-ui-wrap details, +.swagger-section .swagger-ui-wrap figcaption, +.swagger-section .swagger-ui-wrap figure, +.swagger-section .swagger-ui-wrap footer, +.swagger-section .swagger-ui-wrap header, +.swagger-section .swagger-ui-wrap hgroup, +.swagger-section .swagger-ui-wrap menu, +.swagger-section .swagger-ui-wrap nav, +.swagger-section .swagger-ui-wrap section, +.swagger-section .swagger-ui-wrap summary { + display: block; +} +.swagger-section .swagger-ui-wrap pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; +} +.swagger-section .swagger-ui-wrap pre code { + line-height: 1.6em; + background: none; +} +.swagger-section .swagger-ui-wrap .content > .content-type > div > label { + clear: both; + display: block; + color: #0F6AB4; + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap .content pre { + font-size: 12px; + margin-top: 5px; + padding: 5px; +} +.swagger-section .swagger-ui-wrap .icon-btn { + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .info_title { + padding-bottom: 10px; + font-weight: bold; + font-size: 25px; +} +.swagger-section .swagger-ui-wrap .footer { + margin-top: 20px; +} +.swagger-section .swagger-ui-wrap p.big, +.swagger-section .swagger-ui-wrap div.big p { + font-size: 1em; + margin-bottom: 10px; +} +.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { + width: 500px !important; +} +.swagger-section .swagger-ui-wrap .info_license { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_tos { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .message-fail { + color: #cc0000; +} +.swagger-section .swagger-ui-wrap .info_url { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_email { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_name { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_description { + padding-bottom: 10px; + font-size: 15px; +} +.swagger-section .swagger-ui-wrap .markdown ol li, +.swagger-section .swagger-ui-wrap .markdown ul li { + padding: 3px 0px; + line-height: 1.4em; + color: #333333; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { + display: block; + padding: 4px; + width: auto; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { + font-size: 1.3em; +} +.swagger-section .swagger-ui-wrap table.fullwidth { + width: 100%; +} +.swagger-section .swagger-ui-wrap .model-signature { + font-family: "Droid Sans", sans-serif; + font-size: 1em; + line-height: 1.5em; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { + text-decoration: none; + color: #AAA; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap .model-signature .propType { + color: #5555aa; +} +.swagger-section .swagger-ui-wrap .model-signature pre:hover { + background-color: #ffffdd; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + font-size: .85em; + line-height: 1.2em; + overflow: auto; + max-height: 200px; + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { + display: block; + min-width: 230px; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { + float: left; + margin: 0 5px 5px 0; + padding: 2px 5px 2px 0; + border-right: 1px solid #ddd; +} +.swagger-section .swagger-ui-wrap .model-signature .propOpt { + color: #555; +} +.swagger-section .swagger-ui-wrap .model-signature .snippet small { + font-size: 0.75em; +} +.swagger-section .swagger-ui-wrap .model-signature .propOptKey { + font-style: italic; +} +.swagger-section .swagger-ui-wrap .model-signature .description .strong { + font-weight: bold; + color: #000; + font-size: .9em; +} +.swagger-section .swagger-ui-wrap .model-signature .description div { + font-size: 0.9em; + line-height: 1.5em; + margin-left: 1em; +} +.swagger-section .swagger-ui-wrap .model-signature .description .stronger { + font-weight: bold; + color: #000; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { + border-spacing: 0; + position: absolute; + background-color: #ffffff; + border: 1px solid #bbbbbb; + display: none; + font-size: 11px; + max-width: 400px; + line-height: 30px; + color: black; + padding: 5px; + margin-left: 10px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { + text-align: center; + background-color: #eeeeee; + border: 1px solid #bbbbbb; + font-size: 11px; + color: #666666; + font-weight: bold; + padding: 5px; + line-height: 15px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { + display: inline; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { + display: block; + content: ''; +} +.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { + margin-right: -3px; +} +.swagger-section .swagger-ui-wrap .model-signature .propName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-container { + clear: both; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 300px; + height: 100px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap .markdown p code, +.swagger-section .swagger-ui-wrap .markdown li code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #f0f0f0; + color: black; + padding: 1px 3px; +} +.swagger-section .swagger-ui-wrap .required { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .editor_holder { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap .editor_holder label { + font-weight: normal!important; + /* JSONEditor uses bold by default for all labels, we revert that back to normal to not give the impression that by default fields are required */ +} +.swagger-section .swagger-ui-wrap .editor_holder label.required { + font-weight: bold!important; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 300px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap h1 { + color: black; + font-size: 1.5em; + line-height: 1.3em; + padding: 10px 0 10px 0; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .heading_with_menu { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap .heading_with_menu ul { + display: block; + clear: none; + float: right; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + margin-top: 10px; +} +.swagger-section .swagger-ui-wrap h2 { + color: black; + font-size: 1.3em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap h2 span.sub { + font-size: 0.7em; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap h2 span.sub a { + color: #777777; +} +.swagger-section .swagger-ui-wrap span.weak { + color: #666666; +} +.swagger-section .swagger-ui-wrap .message-success { + color: #89BF04; +} +.swagger-section .swagger-ui-wrap caption, +.swagger-section .swagger-ui-wrap th, +.swagger-section .swagger-ui-wrap td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +.swagger-section .swagger-ui-wrap .code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { + font-family: "Droid Sans", sans-serif; + height: 250px; + padding: 4px; + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { + display: block; + float: left; + clear: none; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { + display: block; + float: left; + clear: none; + margin: 0 5px 0 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { + color: black; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { + display: block; + clear: both; + width: auto; + padding: 0 0 3px; + color: #666666; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { + padding-left: 3px; + color: #888888; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { + margin-left: 0; + font-style: italic; + font-size: 0.9em; + margin: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap span.blank, +.swagger-section .swagger-ui-wrap span.empty { + color: #888888; + font-style: italic; +} +.swagger-section .swagger-ui-wrap .markdown h3 { + color: #547f00; +} +.swagger-section .swagger-ui-wrap .markdown h4 { + color: #666666; +} +.swagger-section .swagger-ui-wrap .markdown pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; + margin: 0 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown pre code { + line-height: 1.6em; + overflow: auto; +} +.swagger-section .swagger-ui-wrap div.gist { + margin: 20px 0 25px 0 !important; +} +.swagger-section .swagger-ui-wrap ul#resources { + font-family: "Droid Sans", sans-serif; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource { + border-bottom: 1px solid #dddddd; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { + color: #555555; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { + border: 1px solid transparent; + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 14px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; + color: #666666; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { + color: #aaaaaa; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #999999; + padding-left: 0; + display: block; + clear: none; + float: left; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #999999; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0 0 10px; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { + display: block; + clear: none; + float: left; + width: auto; + margin: 0; + padding: 0; + line-height: 1.1em; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { + padding-left: 10px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated { + text-decoration: line-through; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { + text-transform: uppercase; + text-decoration: none; + color: white; + display: inline-block; + width: 50px; + font-size: 0.7em; + text-align: center; + padding: 7px 0 4px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 6px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a .markdown p { + color: inherit; + padding: 0; + line-height: inherit; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + border-top: none; + padding: 10px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -o-border-bottom-left-radius: 6px; + -ms-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -o-border-bottom-right-radius: 6px; + -ms-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + margin: 0 0 20px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { + padding: 4px 0 0 10px; + display: inline-block; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { + display: block; + clear: none; + float: left; + padding: 6px 8px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { + background-image: url('../images/throbber-gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: right; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { + outline: 2px solid black; + outline-color: #cc0000; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] { + max-width: 300px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + padding: 10px; + font-size: 0.9em; + max-height: 400px; + overflow-y: auto; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { + background-color: #f9f2e9; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { + background-color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0e0ca; + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { + background-color: #faf5ee; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #ffd20f; + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { + background-color: #f5e8e8; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #e8c6c7; + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + background-color: #f7eded; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { + color: #c8787a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { + background-color: #e7f6ec; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { + background-color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3e8d1; + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { + background-color: #ebf7f0; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { + background-color: #FCE9E3; + border: 1px solid #F5D5C3; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { + background-color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0cecb; + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { + background-color: #faf0ef; + border: 1px solid #f0cecb; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + border-top: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap p#colophon { + margin: 0 15px 40px 15px; + padding: 10px 0; + font-size: 0.8em; + border-top: 1px solid #dddddd; + font-family: "Droid Sans", sans-serif; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap p#colophon a { + text-decoration: none; + color: #547f00; +} +.swagger-section .swagger-ui-wrap h3 { + color: black; + font-size: 1.1em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown ol, +.swagger-section .swagger-ui-wrap .markdown ul { + font-family: "Droid Sans", sans-serif; + margin: 5px 0 10px; + padding: 0 0 0 18px; + list-style-type: disc; +} +.swagger-section .swagger-ui-wrap form.form_box { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box label { + color: #0f6ab4 !important; +} +.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { + display: block; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box p.weak { + font-size: 0.8em; +} +.swagger-section .swagger-ui-wrap form.form_box p { + font-size: 0.9em; + padding: 0 0 15px; + color: #7e7b6d; +} +.swagger-section .swagger-ui-wrap form.form_box p a { + color: #646257; +} +.swagger-section .swagger-ui-wrap form.form_box p strong { + color: black; +} +.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { + padding-bottom: 0; +} +.swagger-section .title { + font-style: bold; +} +.swagger-section .secondary_form { + display: none; +} +.swagger-section .main_image { + display: block; + margin-left: auto; + margin-right: auto; +} +.swagger-section .oauth_body { + margin-left: 100px; + margin-right: 100px; +} +.swagger-section .oauth_submit { + text-align: center; + display: inline-block; +} +.swagger-section .authorize-wrapper { + margin: 15px 0 10px; +} +.swagger-section .authorize-wrapper_operation { + float: right; +} +.swagger-section .authorize__btn:hover { + text-decoration: underline; + cursor: pointer; +} +.swagger-section .authorize__btn_operation:hover .authorize-scopes { + display: block; +} +.swagger-section .authorize-scopes { + position: absolute; + margin-top: 20px; + background: #FFF; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + max-width: 300px; + line-height: 30px; + color: black; + padding: 5px; +} +.swagger-section .authorize-scopes .authorize__scope { + text-decoration: none; +} +.swagger-section .authorize__btn_operation { + height: 18px; + vertical-align: middle; + display: inline-block; + background: url(../images/explorer_icons-png) no-repeat; +} +.swagger-section .authorize__btn_operation_login { + background-position: 0 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .authorize__btn_operation_logout { + background-position: -30px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section #auth_container { + color: #fff; + display: inline-block; + border: none; + padding: 5px; + width: 87px; + height: 13px; +} +.swagger-section #auth_container .authorize__btn { + color: #fff; +} +.swagger-section .auth_container { + padding: 0 0 10px; + margin-bottom: 5px; + border-bottom: solid 1px #CCC; + font-size: 0.9em; +} +.swagger-section .auth_container .auth__title { + color: #547f00; + font-size: 1.2em; +} +.swagger-section .auth_container .basic_auth__label { + display: inline-block; + width: 60px; +} +.swagger-section .auth_container .auth__description { + color: #999999; + margin-bottom: 5px; +} +.swagger-section .auth_container .auth__button { + margin-top: 10px; + height: 30px; +} +.swagger-section .auth_container .key_auth__field { + margin: 5px 0; +} +.swagger-section .auth_container .key_auth__label { + display: inline-block; + width: 60px; +} +.swagger-section .api-popup-dialog { + position: absolute; + display: none; +} +.swagger-section .api-popup-dialog-wrapper { + z-index: 1000; + width: 500px; + background: #FFF; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 13px; + color: #777; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); +} +.swagger-section .api-popup-dialog-shadow { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0.2; + background-color: gray; + z-index: 900; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .error-msg { + padding-left: 5px; + padding-bottom: 5px; +} +.swagger-section .api-popup-dialog .api-popup-content { + max-height: 500px; + overflow-y: auto; +} +.swagger-section .api-popup-dialog .api-popup-authbtn { + height: 30px; +} +.swagger-section .api-popup-dialog .api-popup-cancel { + height: 30px; +} +.swagger-section .api-popup-scopes { + padding: 10px 20px; +} +.swagger-section .api-popup-scopes li { + padding: 5px 0; + line-height: 20px; +} +.swagger-section .api-popup-scopes li input { + position: relative; + top: 2px; +} +.swagger-section .api-popup-scopes .api-scope-desc { + padding-left: 20px; + font-style: italic; +} +.swagger-section .api-popup-actions { + padding-top: 10px; +} +.swagger-section .access { + float: right; +} +.swagger-section .auth { + float: right; +} +.swagger-section .api-ic { + height: 18px; + vertical-align: middle; + display: inline-block; + background: url(../images/explorer_icons-png) no-repeat; +} +.swagger-section .api-ic .api_information_panel { + position: relative; + margin-top: 20px; + margin-left: -5px; + background: #FFF; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + max-width: 300px; + line-height: 30px; + color: black; + padding: 5px; +} +.swagger-section .api-ic .api_information_panel p .api-msg-enabled { + color: green; +} +.swagger-section .api-ic .api_information_panel p .api-msg-disabled { + color: red; +} +.swagger-section .api-ic:hover .api_information_panel { + position: absolute; + display: block; +} +.swagger-section .ic-info { + background-position: 0 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-warning { + background-position: -60px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-error { + background-position: -30px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-off { + background-position: -90px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section .ic-on { + background-position: -160px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section #header { + background-color: #89bf04; + padding: 9px 14px 19px 14px; + height: 23px; + min-width: 775px; +} +.swagger-section #input_baseUrl { + width: 400px; +} +.swagger-section #api_selector { + display: block; + clear: none; + float: right; +} +.swagger-section #api_selector .input { + display: inline-block; + clear: none; + margin: 0 10px 0 0; +} +.swagger-section #api_selector input { + font-size: 0.9em; + padding: 3px; + margin: 0; +} +.swagger-section #input_apiKey { + width: 200px; +} +.swagger-section #explore, +.swagger-section #auth_container .authorize__btn { + display: block; + text-decoration: none; + font-weight: bold; + padding: 6px 8px; + font-size: 0.9em; + color: white; + background-color: #547f00; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; +} +.swagger-section #explore:hover, +.swagger-section #auth_container .authorize__btn:hover { + background-color: #547f00; +} +.swagger-section #header #logo { + font-size: 1.5em; + font-weight: bold; + text-decoration: none; + color: white; +} +.swagger-section #header #logo .logo__img { + display: block; + float: left; + margin-top: 2px; +} +.swagger-section #header #logo .logo__title { + display: inline-block; + padding: 5px 0 0 10px; +} +.swagger-section #content_message { + margin: 10px 15px; + font-style: italic; + color: #999999; +} +.swagger-section #message-bar { + min-height: 30px; + text-align: center; + padding-top: 10px; +} +.swagger-section .swagger-collapse:before { + content: "-"; +} +.swagger-section .swagger-expand:before { + content: "+"; +} +.swagger-section .error { + outline-color: #cc0000; + background-color: #f2dede; +} diff --git a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/typography.css b/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/typography.css new file mode 100644 index 000000000..03477335c --- /dev/null +++ b/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/typography.css @@ -0,0 +1,14 @@ +/* Google Font's Droid Sans */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 400; + src: local('Droid Sans'), local('DroidSans'), url('../fonts/DroidSans-ttf'), format('truetype'); +} +/* Google Font's Droid Sans Bold */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 700; + src: local('Droid Sans Bold'), local('DroidSans-Bold'), url('../fonts/DroidSans-Bold-ttf'), format('truetype'); +} diff --git a/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetDescriptor.cs b/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetDescriptor.cs new file mode 100644 index 000000000..78f4ef8f9 --- /dev/null +++ b/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetDescriptor.cs @@ -0,0 +1,20 @@ +using System.Reflection; + +namespace Swashbuckle.SwaggerUi +{ + public class EmbeddedAssetDescriptor + { + public EmbeddedAssetDescriptor(Assembly containingAssembly, string name, bool isTemplate) + { + Assembly = containingAssembly; + Name = name; + IsTemplate = isTemplate; + } + + public Assembly Assembly { get; private set; } + + public string Name { get; private set; } + + public bool IsTemplate { get; private set; } + } +} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetProvider.cs b/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetProvider.cs new file mode 100644 index 000000000..c41bbfd1d --- /dev/null +++ b/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetProvider.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +namespace Swashbuckle.SwaggerUi +{ + public class EmbeddedAssetProvider : IAssetProvider + { + private readonly IDictionary _pathToAssetMap; + private readonly IDictionary _templateParams; + + public EmbeddedAssetProvider( + IDictionary pathToAssetMap, + IDictionary templateParams) + { + _pathToAssetMap = pathToAssetMap; + _templateParams = templateParams; + } + + public Asset GetAsset(string rootUrl, string path) + { + if (!_pathToAssetMap.ContainsKey(path)) + throw new AssetNotFound(String.Format("Mapping not found - {0}", path)); + + var resourceDescriptor = _pathToAssetMap[path]; + return new Asset( + GetEmbeddedResourceStreamFor(resourceDescriptor, rootUrl), + InferMediaTypeFrom(resourceDescriptor.Name) + ); + } + + private Stream GetEmbeddedResourceStreamFor(EmbeddedAssetDescriptor resourceDescriptor, string rootUrl) + { + var stream = resourceDescriptor.Assembly.GetManifestResourceStream(resourceDescriptor.Name); + if (stream == null) + throw new AssetNotFound(String.Format("Embedded resource not found - {0}", resourceDescriptor.Name)); + + if (resourceDescriptor.IsTemplate) + { + var templateParams = _templateParams + .Union(new[] { new KeyValuePair("%(RootUrl)", rootUrl) }) + .ToDictionary(entry => entry.Key, entry => entry.Value); + + return stream.FindAndReplace(templateParams); + } + + return stream; + } + + private static string InferMediaTypeFrom(string path) + { + var extension = path.Split('.').Last(); + + switch (extension) + { + case "css": + return "text/css"; + case "js": + return "text/javascript"; + case "gif": + return "image/gif"; + case "png": + return "image/png"; + case "eot": + return "application/vnd.ms-fontobject"; + case "woff": + return "application/font-woff"; + case "woff2": + return "application/font-woff2"; + case "otf": + return "application/font-sfnt"; // formerly "font/opentype" + case "ttf": + return "application/font-sfnt"; // formerly "font/truetype" + case "svg": + return "image/svg+xml"; + default: + return "text/html"; + } + } + } +} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/SwaggerUi/IAssetProvider.cs b/Swashbuckle.Core.Lib/SwaggerUi/IAssetProvider.cs new file mode 100644 index 000000000..e6386caf6 --- /dev/null +++ b/Swashbuckle.Core.Lib/SwaggerUi/IAssetProvider.cs @@ -0,0 +1,30 @@ +using System; +using System.IO; + +namespace Swashbuckle.SwaggerUi +{ + public interface IAssetProvider + { + Asset GetAsset(string rootUrl, string assetPath); + } + + public class Asset + { + public Asset(Stream stream, string mediaType) + { + Stream = stream; + MediaType = mediaType; + } + + public Stream Stream { get; private set; } + + public string MediaType { get; private set; } + } + + public class AssetNotFound : Exception + { + public AssetNotFound(string message) + : base(message) + {} + } +} diff --git a/Swashbuckle.Core.Lib/SwaggerUi/StreamExtensions.cs b/Swashbuckle.Core.Lib/SwaggerUi/StreamExtensions.cs new file mode 100644 index 000000000..150c52622 --- /dev/null +++ b/Swashbuckle.Core.Lib/SwaggerUi/StreamExtensions.cs @@ -0,0 +1,22 @@ +using System.Collections.Generic; +using System.IO; +using System.Text; + +namespace Swashbuckle.SwaggerUi +{ + public static class StreamExtensions + { + public static Stream FindAndReplace(this Stream stream, IDictionary replacements) + { + var originalText = new StreamReader(stream).ReadToEnd(); + var outputBuilder = new StringBuilder(originalText); + + foreach (var replacement in replacements) + { + outputBuilder.Replace(replacement.Key, replacement.Value); + } + + return new MemoryStream(Encoding.UTF8.GetBytes(outputBuilder.ToString())); + } + } +} diff --git a/Swashbuckle.Core.Lib/Swashbuckle.Core.Lib.csproj b/Swashbuckle.Core.Lib/Swashbuckle.Core.Lib.csproj new file mode 100644 index 000000000..8d181e861 --- /dev/null +++ b/Swashbuckle.Core.Lib/Swashbuckle.Core.Lib.csproj @@ -0,0 +1,30 @@ + + + + net452;net461;net472 + Swashbuckle.Core.Lib + 5.6.2 + + Library + + true + + + + + + + + + + + + + + + + + + + + diff --git a/Swashbuckle.Core.Lib/app.config b/Swashbuckle.Core.Lib/app.config new file mode 100644 index 000000000..8ddcd8843 --- /dev/null +++ b/Swashbuckle.Core.Lib/app.config @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/Swashbuckle.sln b/Swashbuckle.sln index 7dcf5e17a..e4461e5cd 100644 --- a/Swashbuckle.sln +++ b/Swashbuckle.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.30501.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29503.13 MinimumVisualStudioVersion = 10.0.40219.1 Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "swagger-ui", "http://localhost:55139", "{DDE07B02-DD45-4ABF-96D3-A4FBB144BBA1}" ProjectSection(WebsiteProperties) = preProject @@ -54,6 +54,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Swashbuckle.Core.Lib", "Swashbuckle.Core.Lib\Swashbuckle.Core.Lib.csproj", "{348BFDEC-F453-4E6E-843C-7963B0D379DA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -87,6 +89,10 @@ Global {2D1F2F73-5828-413C-9FD0-6F81A964C82D}.Debug|Any CPU.Build.0 = Debug|Any CPU {2D1F2F73-5828-413C-9FD0-6F81A964C82D}.Release|Any CPU.ActiveCfg = Release|Any CPU {2D1F2F73-5828-413C-9FD0-6F81A964C82D}.Release|Any CPU.Build.0 = Release|Any CPU + {348BFDEC-F453-4E6E-843C-7963B0D379DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {348BFDEC-F453-4E6E-843C-7963B0D379DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {348BFDEC-F453-4E6E-843C-7963B0D379DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {348BFDEC-F453-4E6E-843C-7963B0D379DA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -97,4 +103,7 @@ Global {2DFE3931-747F-48C6-8530-B74710988095} = {6A2C69FA-6824-44F3-A1A5-1313050FA567} {2D1F2F73-5828-413C-9FD0-6F81A964C82D} = {6A2C69FA-6824-44F3-A1A5-1313050FA567} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7773D097-FD5F-4E08-AAB2-54F48C6FA684} + EndGlobalSection EndGlobal From 94f6a849bf87ebeac1306e99014d937d968d42ac Mon Sep 17 00:00:00 2001 From: Ricky Vega Date: Mon, 11 Nov 2019 00:10:54 -0600 Subject: [PATCH 3/3] Migrated .Core to be completely multi targeted --- .../Application/ContactBuilder.cs | 41 - .../HttpConfigurationExtensions.cs | 105 -- .../HttpRouteDirectionConstraint.cs | 29 - .../Application/InfoBuilder.cs | 58 - .../Application/LicenseBuilder.cs | 33 - .../Application/RedirectHandler.cs | 32 - .../Application/SecuritySchemeBuilder.cs | 122 -- .../Application/SwaggerDocsConfig.cs | 325 ---- .../Application/SwaggerDocsHandler.cs | 73 - .../Application/SwaggerUiConfig.cs | 173 -- .../Application/SwaggerUiHandler.cs | 56 - .../Application/VendorExtensionsConverter.cs | 57 - .../Application/VersionInfoBuilder.cs | 29 - .../Properties/AssemblyInfo.cs | 37 - .../ApplySwaggerOperationAttributes.cs | 24 - .../ApplySwaggerOperationFilterAttributes.cs | 19 - .../ApplySwaggerResponseAttributes.cs | 41 - .../ApplySwaggerSchemaFilterAttributes.cs | 20 - .../Annotations/SwaggerOperationAttribute.cs | 20 - .../SwaggerOperationFilterAttribute.cs | 15 - .../Annotations/SwaggerResponseAttribute.cs | 39 - .../SwaggerResponseRemoveDefaultsAttribute.cs | 10 - .../SwaggerSchemaFilterAttribute.cs | 15 - .../Swagger/ApiDescriptionExtensions.cs | 82 - .../FromUriParams/HandleFromUriParams.cs | 93 - .../Swagger/IDocumentFilter.cs | 9 - Swashbuckle.Core.Lib/Swagger/IModelFilter.cs | 29 - .../Swagger/IOperationFilter.cs | 9 - Swashbuckle.Core.Lib/Swagger/ISchemaFilter.cs | 9 - .../Swagger/ISwaggerProvider.cs | 16 - .../Swagger/JsonContractExtensions.cs | 33 - .../Swagger/JsonPropertyExtensions.cs | 42 - .../Swagger/SchemaExtensions.cs | 79 - .../Swagger/SchemaRegistry.cs | 302 ---- .../Swagger/StringExtensions.cs | 11 - .../Swagger/SwaggerDocument.cs | 318 ---- .../Swagger/SwaggerGenerator.cs | 209 --- .../Swagger/SwaggerGeneratorOptions.cs | 102 -- .../Swagger/TypeExtensions.cs | 54 - .../XmlComments/ApplyXmlActionComments.cs | 110 -- .../XmlComments/ApplyXmlTypeComments.cs | 66 - .../XmlComments/XPathNavigatorExtensions.cs | 41 - .../XmlComments/XmlCommentsIdHelper.cs | 102 -- .../Swagger/XmlComments/XmlTextHelper.cs | 82 - .../CustomAssets/discoveryUrlSelector.js | 33 - .../SwaggerUi/CustomAssets/index.html | 153 -- .../SwaggerUi/CustomAssets/screen.css | 1494 ----------------- .../SwaggerUi/CustomAssets/typography.css | 14 - .../SwaggerUi/EmbeddedAssetDescriptor.cs | 20 - .../SwaggerUi/EmbeddedAssetProvider.cs | 82 - .../SwaggerUi/IAssetProvider.cs | 30 - .../SwaggerUi/StreamExtensions.cs | 22 - .../Swashbuckle.Core.Lib.csproj | 30 - Swashbuckle.Core.Lib/app.config | 11 - Swashbuckle.Core/Swashbuckle.Core.csproj | 170 +- Swashbuckle.Core/Swashbuckle.Core.nuspec | 20 - Swashbuckle.Core/Swashbuckle.Core.snk | Bin 596 -> 0 bytes Swashbuckle.Core/packages.config | 9 - Swashbuckle.sln | 8 +- 59 files changed, 22 insertions(+), 5245 deletions(-) delete mode 100644 Swashbuckle.Core.Lib/Application/ContactBuilder.cs delete mode 100644 Swashbuckle.Core.Lib/Application/HttpConfigurationExtensions.cs delete mode 100644 Swashbuckle.Core.Lib/Application/HttpRouteDirectionConstraint.cs delete mode 100644 Swashbuckle.Core.Lib/Application/InfoBuilder.cs delete mode 100644 Swashbuckle.Core.Lib/Application/LicenseBuilder.cs delete mode 100644 Swashbuckle.Core.Lib/Application/RedirectHandler.cs delete mode 100644 Swashbuckle.Core.Lib/Application/SecuritySchemeBuilder.cs delete mode 100644 Swashbuckle.Core.Lib/Application/SwaggerDocsConfig.cs delete mode 100644 Swashbuckle.Core.Lib/Application/SwaggerDocsHandler.cs delete mode 100644 Swashbuckle.Core.Lib/Application/SwaggerUiConfig.cs delete mode 100644 Swashbuckle.Core.Lib/Application/SwaggerUiHandler.cs delete mode 100644 Swashbuckle.Core.Lib/Application/VendorExtensionsConverter.cs delete mode 100644 Swashbuckle.Core.Lib/Application/VersionInfoBuilder.cs delete mode 100644 Swashbuckle.Core.Lib/Properties/AssemblyInfo.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerOperationAttributes.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerOperationFilterAttributes.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerResponseAttributes.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerSchemaFilterAttributes.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerOperationAttribute.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerOperationFilterAttribute.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerResponseAttribute.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerResponseRemoveDefaultsAttribute.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerSchemaFilterAttribute.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/ApiDescriptionExtensions.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/FromUriParams/HandleFromUriParams.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/IDocumentFilter.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/IModelFilter.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/IOperationFilter.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/ISchemaFilter.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/ISwaggerProvider.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/JsonContractExtensions.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/JsonPropertyExtensions.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/SchemaExtensions.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/SchemaRegistry.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/StringExtensions.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/SwaggerDocument.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/SwaggerGenerator.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/SwaggerGeneratorOptions.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/TypeExtensions.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/XmlComments/ApplyXmlActionComments.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/XmlComments/ApplyXmlTypeComments.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/XmlComments/XPathNavigatorExtensions.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/XmlComments/XmlCommentsIdHelper.cs delete mode 100644 Swashbuckle.Core.Lib/Swagger/XmlComments/XmlTextHelper.cs delete mode 100644 Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/discoveryUrlSelector.js delete mode 100644 Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/index.html delete mode 100644 Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/screen.css delete mode 100644 Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/typography.css delete mode 100644 Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetDescriptor.cs delete mode 100644 Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetProvider.cs delete mode 100644 Swashbuckle.Core.Lib/SwaggerUi/IAssetProvider.cs delete mode 100644 Swashbuckle.Core.Lib/SwaggerUi/StreamExtensions.cs delete mode 100644 Swashbuckle.Core.Lib/Swashbuckle.Core.Lib.csproj delete mode 100644 Swashbuckle.Core.Lib/app.config delete mode 100644 Swashbuckle.Core/Swashbuckle.Core.nuspec delete mode 100644 Swashbuckle.Core/Swashbuckle.Core.snk delete mode 100644 Swashbuckle.Core/packages.config diff --git a/Swashbuckle.Core.Lib/Application/ContactBuilder.cs b/Swashbuckle.Core.Lib/Application/ContactBuilder.cs deleted file mode 100644 index 7bedd6393..000000000 --- a/Swashbuckle.Core.Lib/Application/ContactBuilder.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Swashbuckle.Swagger; - -namespace Swashbuckle.Application -{ - public class ContactBuilder - { - private string _name; - private string _url; - private string _email; - - public ContactBuilder Name(string name) - { - _name = name; - return this; - } - - public ContactBuilder Url(string url) - { - _url = url; - return this; - } - - public ContactBuilder Email(string email) - { - _email = email; - return this; - } - - internal Contact Build() - { - if ((_name ?? _url ?? _email) == null) return null; - - return new Contact - { - name = _name, - url = _url, - email = _email - }; - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Application/HttpConfigurationExtensions.cs b/Swashbuckle.Core.Lib/Application/HttpConfigurationExtensions.cs deleted file mode 100644 index 489b87110..000000000 --- a/Swashbuckle.Core.Lib/Application/HttpConfigurationExtensions.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Linq; -using System.Web.Http; -using Newtonsoft.Json.Serialization; -using Swashbuckle.Application; -using System.Net.Http; -using System.Collections.Generic; -using System.Web.Http.Routing; -using Newtonsoft.Json; - -namespace Swashbuckle.Application -{ - public static class HttpConfigurationExtensions - { - private static readonly string DefaultRouteTemplate = "swagger/docs/{apiVersion}"; - - public static SwaggerEnabledConfiguration EnableSwagger( - this HttpConfiguration httpConfig, - Action configure = null) - { - return EnableSwagger(httpConfig, DefaultRouteTemplate, configure); - } - - public static SwaggerEnabledConfiguration EnableSwagger( - this HttpConfiguration httpConfig, - string routeTemplate, - Action configure = null) - { - var config = new SwaggerDocsConfig(); - if (configure != null) configure(config); - - httpConfig.Routes.MapHttpRoute( - name: "swagger_docs" + routeTemplate, - routeTemplate: routeTemplate, - defaults: null, - constraints: new { apiVersion = @".+" }, - handler: new SwaggerDocsHandler(config) - ); - - return new SwaggerEnabledConfiguration( - httpConfig, - config.GetRootUrl, - config.GetApiVersions().Select(version => routeTemplate.Replace("{apiVersion}", version))); - } - - internal static JsonSerializerSettings SerializerSettingsOrDefault(this HttpConfiguration httpConfig) - { - var formatter = httpConfig.Formatters.JsonFormatter; - if (formatter != null) - return formatter.SerializerSettings; - - return new JsonSerializerSettings(); - } - } - - public class SwaggerEnabledConfiguration - { - private static readonly string DefaultRouteTemplate = "swagger/ui/{*assetPath}"; - - private readonly HttpConfiguration _httpConfig; - private readonly Func _rootUrlResolver; - private readonly IEnumerable _discoveryPaths; - - public SwaggerEnabledConfiguration( - HttpConfiguration httpConfig, - Func rootUrlResolver, - IEnumerable discoveryPaths) - { - _httpConfig = httpConfig; - _rootUrlResolver = rootUrlResolver; - _discoveryPaths = discoveryPaths; - } - - public void EnableSwaggerUi(Action configure = null) - { - EnableSwaggerUi(DefaultRouteTemplate, configure); - } - - public void EnableSwaggerUi( - string routeTemplate, - Action configure = null) - { - var config = new SwaggerUiConfig(_discoveryPaths, _rootUrlResolver); - if (configure != null) configure(config); - - _httpConfig.Routes.MapHttpRoute( - name: "swagger_ui" + routeTemplate, - routeTemplate: routeTemplate, - defaults: null, - constraints: new { assetPath = @".+" }, - handler: new SwaggerUiHandler(config) - ); - - if (routeTemplate == DefaultRouteTemplate) - { - _httpConfig.Routes.MapHttpRoute( - name: "swagger_ui_shortcut", - routeTemplate: "swagger", - defaults: null, - constraints: new { uriResolution = new HttpRouteDirectionConstraint(HttpRouteDirection.UriResolution) }, - handler: new RedirectHandler(_rootUrlResolver, "swagger/ui/index")); - } - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Application/HttpRouteDirectionConstraint.cs b/Swashbuckle.Core.Lib/Application/HttpRouteDirectionConstraint.cs deleted file mode 100644 index ea2014e68..000000000 --- a/Swashbuckle.Core.Lib/Application/HttpRouteDirectionConstraint.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; -using System.Web.Http.Routing; - -namespace Swashbuckle.Application -{ - public class HttpRouteDirectionConstraint : IHttpRouteConstraint - { - private readonly HttpRouteDirection _allowedDirection; - - public HttpRouteDirectionConstraint(HttpRouteDirection allowedDirection) - { - _allowedDirection = allowedDirection; - } - - public bool Match( - HttpRequestMessage request, - IHttpRoute route, - string parameterName, - IDictionary values, - HttpRouteDirection routeDirection) - { - return routeDirection == _allowedDirection; - } - } -} diff --git a/Swashbuckle.Core.Lib/Application/InfoBuilder.cs b/Swashbuckle.Core.Lib/Application/InfoBuilder.cs deleted file mode 100644 index 036ac25fd..000000000 --- a/Swashbuckle.Core.Lib/Application/InfoBuilder.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using Swashbuckle.Swagger; - -namespace Swashbuckle.Application -{ - public class InfoBuilder - { - private string _version; - private string _title; - private string _description; - private string _termsOfService; - private readonly ContactBuilder _contactBuilder = new ContactBuilder(); - private readonly LicenseBuilder _licenseBuilder = new LicenseBuilder(); - - public InfoBuilder(string version, string title) - { - _version = version; - _title = title; - } - - public InfoBuilder Description(string description) - { - _description = description; - return this; - } - - public InfoBuilder TermsOfService(string termsOfService) - { - _termsOfService = termsOfService; - return this; - } - - public InfoBuilder Contact(Action contact) - { - contact(_contactBuilder); - return this; - } - - public InfoBuilder License(Action license) - { - license(_licenseBuilder); - return this; - } - - internal Info Build() - { - return new Info - { - version = _version, - title = _title, - description = _description, - termsOfService = _termsOfService, - contact = _contactBuilder.Build(), - license = _licenseBuilder.Build() - }; - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Application/LicenseBuilder.cs b/Swashbuckle.Core.Lib/Application/LicenseBuilder.cs deleted file mode 100644 index 54901cf13..000000000 --- a/Swashbuckle.Core.Lib/Application/LicenseBuilder.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Swashbuckle.Swagger; - -namespace Swashbuckle.Application -{ - public class LicenseBuilder - { - private string _name; - private string _url; - - public LicenseBuilder Name(string name) - { - _name = name; - return this; - } - - public LicenseBuilder Url(string url) - { - _url = url; - return this; - } - - internal License Build() - { - if ((_name ?? _url) == null) return null; - - return new License - { - name = _name, - url = _url - }; - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Application/RedirectHandler.cs b/Swashbuckle.Core.Lib/Application/RedirectHandler.cs deleted file mode 100644 index 755449633..000000000 --- a/Swashbuckle.Core.Lib/Application/RedirectHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Net; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; - -namespace Swashbuckle.Application -{ - public class RedirectHandler : HttpMessageHandler - { - private readonly Func _rootUrlResolver; - private readonly string _redirectPath; - - public RedirectHandler(Func rootUrlResolver, string redirectPath) - { - _rootUrlResolver = rootUrlResolver; - _redirectPath = redirectPath; - } - - protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - { - var redirectUrl = _rootUrlResolver(request) + "/" + _redirectPath; - - var response = request.CreateResponse(HttpStatusCode.Moved); - response.Headers.Location = new Uri(redirectUrl); - - var tsc = new TaskCompletionSource(); - tsc.SetResult(response); - return tsc.Task; - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Application/SecuritySchemeBuilder.cs b/Swashbuckle.Core.Lib/Application/SecuritySchemeBuilder.cs deleted file mode 100644 index 014e07573..000000000 --- a/Swashbuckle.Core.Lib/Application/SecuritySchemeBuilder.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Swashbuckle.Swagger; - -namespace Swashbuckle.Application -{ - public abstract class SecuritySchemeBuilder - { - internal abstract SecurityScheme Build(); - } - - public class BasicAuthSchemeBuilder : SecuritySchemeBuilder - { - private string _description; - - public BasicAuthSchemeBuilder Description(string description) - { - _description = description; - return this; - } - - internal override SecurityScheme Build() - { - return new SecurityScheme - { - type = "basic", - description = _description - }; - } - } - - public class ApiKeySchemeBuilder : SecuritySchemeBuilder - { - private string _description; - private string _name; - private string _in; - - public ApiKeySchemeBuilder Description(string description) - { - _description = description; - return this; - } - - public ApiKeySchemeBuilder Name(string name) - { - _name = name; - return this; - } - - public ApiKeySchemeBuilder In(string @in) - { - _in = @in; - return this; - } - - internal override SecurityScheme Build() - { - return new SecurityScheme - { - type = "apiKey", - description = _description, - name = _name, - @in = _in - }; - } - } - - public class OAuth2SchemeBuilder : SecuritySchemeBuilder - { - private string _description; - private string _flow; - private string _authorizationUrl; - private string _tokenUrl; - private IDictionary _scopes = new Dictionary(); - - public OAuth2SchemeBuilder Description(string description) - { - _description = description; - return this; - } - - public OAuth2SchemeBuilder Flow(string flow) - { - _flow = flow; - return this; - } - - public OAuth2SchemeBuilder AuthorizationUrl(string authorizationUrl) - { - _authorizationUrl = authorizationUrl; - return this; - } - - public OAuth2SchemeBuilder TokenUrl(string tokenUrl) - { - _tokenUrl = tokenUrl; - return this; - } - - public OAuth2SchemeBuilder Scopes(Action> configure) - { - configure(_scopes); - return this; - } - - internal override SecurityScheme Build() - { - // TODO: Validate required fields for given flow - - return new SecurityScheme - { - type = "oauth2", - flow = _flow, - authorizationUrl = _authorizationUrl, - tokenUrl = _tokenUrl, - scopes = _scopes, - description = _description, - }; - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Application/SwaggerDocsConfig.cs b/Swashbuckle.Core.Lib/Application/SwaggerDocsConfig.cs deleted file mode 100644 index b8ba39fb1..000000000 --- a/Swashbuckle.Core.Lib/Application/SwaggerDocsConfig.cs +++ /dev/null @@ -1,325 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Net.Http; -using System.Web.Http; -using System.Web.Http.Description; -using System.Xml.XPath; -using Newtonsoft.Json; -using Swashbuckle.Swagger; -using Swashbuckle.Swagger.Annotations; -using Swashbuckle.Swagger.FromUriParams; -using Swashbuckle.Swagger.XmlComments; - -namespace Swashbuckle.Application -{ - public class SwaggerDocsConfig - { - private VersionInfoBuilder _versionInfoBuilder; - private Func _versionSupportResolver; - private IEnumerable _schemes; - private IDictionary _securitySchemeBuilders; - private bool _prettyPrint; - private bool _ignoreObsoleteActions; - private Func _groupingKeySelector; - private IComparer _groupingKeyComparer; - private readonly IDictionary> _customSchemaMappings; - private readonly IList> _schemaFilters; - private readonly IList> _modelFilters; - private Func _schemaIdSelector; - private bool _ignoreObsoleteProperties; - private bool _describeAllEnumsAsStrings; - private bool _describeStringEnumsInCamelCase; - private bool _applyFiltersToAllSchemas; - private readonly IList> _operationFilters; - private readonly IList> _documentFilters; - private readonly IList> _xmlDocFactories; - private Func, ApiDescription> _conflictingActionsResolver; - private Func _rootUrlResolver; - - private Func _customProviderFactory; - - public SwaggerDocsConfig() - { - _versionInfoBuilder = new VersionInfoBuilder(); - _securitySchemeBuilders = new Dictionary(); - _prettyPrint = false; - _ignoreObsoleteActions = false; - _customSchemaMappings = new Dictionary>(); - _schemaFilters = new List>(); - _modelFilters = new List>(); - _ignoreObsoleteProperties = false; - _describeAllEnumsAsStrings = false; - _describeStringEnumsInCamelCase = false; - _applyFiltersToAllSchemas = false; - _operationFilters = new List>(); - _documentFilters = new List>(); - _xmlDocFactories = new List>(); - _rootUrlResolver = DefaultRootUrlResolver; - - SchemaFilter(); - - OperationFilter(); - OperationFilter(); - OperationFilter(); - OperationFilter(); - } - - public InfoBuilder SingleApiVersion(string version, string title) - { - _versionSupportResolver = null; - _versionInfoBuilder = new VersionInfoBuilder(); - return _versionInfoBuilder.Version(version, title); - } - - public void MultipleApiVersions( - Func versionSupportResolver, - Action configure) - { - _versionSupportResolver = versionSupportResolver; - _versionInfoBuilder = new VersionInfoBuilder(); - configure(_versionInfoBuilder); - } - - public void Schemes(IEnumerable schemes) - { - _schemes = schemes; - } - - public BasicAuthSchemeBuilder BasicAuth(string name) - { - var schemeBuilder = new BasicAuthSchemeBuilder(); - _securitySchemeBuilders[name] = schemeBuilder; - return schemeBuilder; - } - - public ApiKeySchemeBuilder ApiKey(string name) - { - var schemeBuilder = new ApiKeySchemeBuilder(); - _securitySchemeBuilders[name] = schemeBuilder; - return schemeBuilder; - } - - public OAuth2SchemeBuilder OAuth2(string name) - { - var schemeBuilder = new OAuth2SchemeBuilder(); - _securitySchemeBuilders[name] = schemeBuilder; - return schemeBuilder; - } - - public void PrettyPrint() - { - _prettyPrint = true; - } - - public void IgnoreObsoleteActions() - { - _ignoreObsoleteActions = true; - } - - public void GroupActionsBy(Func keySelector) - { - _groupingKeySelector = keySelector; - } - - public void OrderActionGroupsBy(IComparer keyComparer) - { - _groupingKeyComparer = keyComparer; - } - - public void MapType(Func factory) - { - MapType(typeof(T), factory); - } - - public void MapType(Type type, Func factory) - { - _customSchemaMappings.Add(type, factory); - } - - public void SchemaFilter() - where TFilter : ISchemaFilter, new() - { - SchemaFilter(() => new TFilter()); - } - - public void SchemaFilter(Func factory) - { - _schemaFilters.Add(factory); - } - - // NOTE: In next major version, ModelFilter will completely replace SchemaFilter - internal void ModelFilter() - where TFilter : IModelFilter, new() - { - ModelFilter(() => new TFilter()); - } - - // NOTE: In next major version, ModelFilter will completely replace SchemaFilter - internal void ModelFilter(Func factory) - { - _modelFilters.Add(factory); - } - - public void SchemaId(Func schemaIdStrategy) - { - _schemaIdSelector = schemaIdStrategy; - } - - public void UseFullTypeNameInSchemaIds() - { - _schemaIdSelector = t => t.FriendlyId(true); - } - - public void DescribeAllEnumsAsStrings(bool camelCase = false) - { - _describeAllEnumsAsStrings = true; - _describeStringEnumsInCamelCase = camelCase; - } - - public void IgnoreObsoleteProperties() - { - _ignoreObsoleteProperties = true; - } - - [Obsolete("This will be removed in 6.0.0; it will always be true.")] - public void ApplyFiltersToAllSchemas() - { - _applyFiltersToAllSchemas = true; - } - - public void OperationFilter() - where TFilter : IOperationFilter, new() - { - OperationFilter(() => new TFilter()); - } - - public void OperationFilter(Func factory) - { - _operationFilters.Add(factory); - } - - public void DocumentFilter() - where TFilter : IDocumentFilter, new() - { - DocumentFilter(() => new TFilter()); - } - - public void DocumentFilter(Func factory) - { - _documentFilters.Add(factory); - } - - public void IncludeXmlComments(Func xmlDocFactory) - { - _xmlDocFactories.Add(xmlDocFactory); - } - - public void IncludeXmlComments(string filePath) - { - _xmlDocFactories.Add(() => new XPathDocument(filePath)); - } - - public void ResolveConflictingActions(Func, ApiDescription> conflictingActionsResolver) - { - _conflictingActionsResolver = conflictingActionsResolver; - } - - public void RootUrl(Func rootUrlResolver) - { - _rootUrlResolver = rootUrlResolver; - } - - public void CustomProvider(Func customProviderFactory) - { - _customProviderFactory = customProviderFactory; - } - - internal ISwaggerProvider GetSwaggerProvider(HttpRequestMessage swaggerRequest) - { - var httpConfig = swaggerRequest.GetConfiguration(); - - var securityDefintitions = _securitySchemeBuilders.Any() - ? _securitySchemeBuilders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value.Build()) - : null; - - // NOTE: Instantiate & add the XML comments filters here so they're executed before any - // custom filters AND so they can share the same XPathDocument (perf. optimization) - var modelFilters = _modelFilters.Select(factory => factory()).ToList(); - var operationFilters = _operationFilters.Select(factory => factory()).ToList(); - foreach (var xmlDocFactory in _xmlDocFactories) - { - var xmlDoc = xmlDocFactory(); - modelFilters.Insert(0, new ApplyXmlTypeComments(xmlDoc)); - operationFilters.Insert(0, new ApplyXmlActionComments(xmlDoc)); - } - - var options = new SwaggerGeneratorOptions( - versionSupportResolver: _versionSupportResolver, - schemes: _schemes, - securityDefinitions: securityDefintitions, - ignoreObsoleteActions: _ignoreObsoleteActions, - groupingKeySelector: _groupingKeySelector, - groupingKeyComparer: _groupingKeyComparer, - customSchemaMappings: _customSchemaMappings, - schemaFilters: _schemaFilters.Select(factory => factory()).ToList(), - modelFilters: modelFilters, - ignoreObsoleteProperties: _ignoreObsoleteProperties, - schemaIdSelector: _schemaIdSelector, - describeAllEnumsAsStrings: _describeAllEnumsAsStrings, - describeStringEnumsInCamelCase: _describeStringEnumsInCamelCase, - applyFiltersToAllSchemas: _applyFiltersToAllSchemas, - operationFilters: operationFilters, - documentFilters: _documentFilters.Select(factory => factory()).ToList(), - conflictingActionsResolver: _conflictingActionsResolver - ); - - var defaultProvider = new SwaggerGenerator( - httpConfig.Services.GetApiExplorer(), - httpConfig.SerializerSettingsOrDefault(), - _versionInfoBuilder.Build(), - options); - - return (_customProviderFactory != null) - ? _customProviderFactory(defaultProvider) - : defaultProvider; - } - - internal string GetRootUrl(HttpRequestMessage swaggerRequest) - { - return _rootUrlResolver(swaggerRequest); - } - - internal IEnumerable GetApiVersions() - { - return _versionInfoBuilder.Build().Select(entry => entry.Key); - } - - internal Formatting GetFormatting() - { - return _prettyPrint ? Formatting.Indented : Formatting.None; - } - - public static string DefaultRootUrlResolver(HttpRequestMessage request) - { - var scheme = GetHeaderValue(request, "X-Forwarded-Proto") ?? request.RequestUri.Scheme; - var host = GetHeaderValue(request, "X-Forwarded-Host") ?? request.RequestUri.Host; - var port = GetHeaderValue(request, "X-Forwarded-Port") ?? request.RequestUri.Port.ToString(CultureInfo.InvariantCulture); - var prefix = GetHeaderValue(request, "X-Forwarded-Prefix") ?? string.Empty; - - var httpConfiguration = request.GetConfiguration(); - var virtualPathRoot = httpConfiguration.VirtualPathRoot; - - var urb = new UriBuilder(scheme, host, int.Parse(port), prefix + virtualPathRoot); - - return urb.Uri.AbsoluteUri.TrimEnd('/'); - } - - private static string GetHeaderValue(HttpRequestMessage request, string headerName) - { - IEnumerable list; - return request.Headers.TryGetValues(headerName, out list) ? list.FirstOrDefault() : null; - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Application/SwaggerDocsHandler.cs b/Swashbuckle.Core.Lib/Application/SwaggerDocsHandler.cs deleted file mode 100644 index 613700204..000000000 --- a/Swashbuckle.Core.Lib/Application/SwaggerDocsHandler.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading; -using System.Threading.Tasks; -using System.Web.Http; -using System.Net.Http.Formatting; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using System.Collections.Generic; -using Swashbuckle.Swagger; -using System.Net; - -namespace Swashbuckle.Application -{ - public class SwaggerDocsHandler : HttpMessageHandler - { - private readonly SwaggerDocsConfig _config; - - public SwaggerDocsHandler(SwaggerDocsConfig config) - { - _config = config; - } - - protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - { - var swaggerProvider = _config.GetSwaggerProvider(request); - var rootUrl = _config.GetRootUrl(request); - var apiVersion = request.GetRouteData().Values["apiVersion"].ToString(); - - try - { - var swaggerDoc = swaggerProvider.GetSwagger(rootUrl, apiVersion); - var content = ContentFor(request, swaggerDoc); - return TaskFor(new HttpResponseMessage { Content = content }); - } - catch (UnknownApiVersion ex) - { - return TaskFor(request.CreateErrorResponse(HttpStatusCode.NotFound, ex)); - } - } - - private HttpContent ContentFor(HttpRequestMessage request, SwaggerDocument swaggerDoc) - { - var negotiator = request.GetConfiguration().Services.GetContentNegotiator(); - var result = negotiator.Negotiate(typeof(SwaggerDocument), request, GetSupportedSwaggerFormatters()); - - return new ObjectContent(typeof(SwaggerDocument), swaggerDoc, result.Formatter, result.MediaType); - } - - private IEnumerable GetSupportedSwaggerFormatters() - { - var jsonFormatter = new JsonMediaTypeFormatter - { - SerializerSettings = new JsonSerializerSettings - { - NullValueHandling = NullValueHandling.Ignore, - Formatting = _config.GetFormatting(), - Converters = new[] { new VendorExtensionsConverter() } - } - }; - // NOTE: The custom converter would not be neccessary in Newtonsoft.Json >= 5.0.5 as JsonExtensionData - // provides similar functionality. But, need to stick with older version for WebApi 5.0.0 compatibility - return new[] { jsonFormatter }; - } - - private Task TaskFor(HttpResponseMessage response) - { - var tsc = new TaskCompletionSource(); - tsc.SetResult(response); - return tsc.Task; - } - } -} diff --git a/Swashbuckle.Core.Lib/Application/SwaggerUiConfig.cs b/Swashbuckle.Core.Lib/Application/SwaggerUiConfig.cs deleted file mode 100644 index 79dd4b4d7..000000000 --- a/Swashbuckle.Core.Lib/Application/SwaggerUiConfig.cs +++ /dev/null @@ -1,173 +0,0 @@ -using System; -using System.Net.Http; -using System.Collections.Generic; -using System.Reflection; -using System.Text; -using Newtonsoft.Json; -using Swashbuckle.SwaggerUi; - -namespace Swashbuckle.Application -{ - public class SwaggerUiConfig - { - private readonly Dictionary _pathToAssetMap; - private readonly Dictionary _templateParams; - private readonly Func _rootUrlResolver; - - public SwaggerUiConfig(IEnumerable discoveryPaths, Func rootUrlResolver) - { - _pathToAssetMap = new Dictionary(); - - _templateParams = new Dictionary - { - { "%(DocumentTitle)", "Swagger UI" }, - { "%(StylesheetIncludes)", "" }, - { "%(DiscoveryPaths)", String.Join("|", discoveryPaths) }, - { "%(ValidatorUrl)", "" }, - { "%(CustomScripts)", "" }, - { "%(DocExpansion)", "none" }, - { "%(SupportedSubmitMethods)", "get|put|post|delete|options|head|patch" }, - { "%(OAuth2Enabled)", "false" }, - { "%(OAuth2ClientId)", "" }, - { "%(OAuth2ClientSecret)", "" }, - { "%(OAuth2Realm)", "" }, - { "%(OAuth2AppName)", "" }, - { "%(OAuth2ScopeSeperator)", " " }, - { "%(OAuth2AdditionalQueryStringParams)", "{}" }, - { "%(ApiKeyName)", "api_key" }, - { "%(ApiKeyIn)", "query" } - }; - _rootUrlResolver = rootUrlResolver; - - MapPathsForSwaggerUiAssets(); - - // Use some custom versions to support config and extensionless paths - var thisAssembly = GetType().Assembly; - CustomAsset("index", thisAssembly, "Swashbuckle.SwaggerUi.CustomAssets.index.html", isTemplate: true); - CustomAsset("css/screen-css", thisAssembly, "Swashbuckle.SwaggerUi.CustomAssets.screen.css"); - CustomAsset("css/typography-css", thisAssembly, "Swashbuckle.SwaggerUi.CustomAssets.typography.css"); - } - - public void InjectStylesheet(Assembly resourceAssembly, string resourceName, string media = "screen", bool isTemplate = false) - { - var path = "ext/" + resourceName.Replace(".", "-"); - - var stringBuilder = new StringBuilder(_templateParams["%(StylesheetIncludes)"]); - stringBuilder.AppendLine(""); - _templateParams["%(StylesheetIncludes)"] = stringBuilder.ToString(); - - CustomAsset(path, resourceAssembly, resourceName, isTemplate); - } - - public void DocumentTitle(string title) - { - _templateParams["%(DocumentTitle)"] = title; - } - - public void SetValidatorUrl(string url) - { - _templateParams["%(ValidatorUrl)"] = url; - } - - public void DisableValidator() - { - _templateParams["%(ValidatorUrl)"] = "null"; - } - - public void InjectJavaScript(Assembly resourceAssembly, string resourceName, bool isTemplate = false) - { - var path = "ext/" + resourceName.Replace(".", "-"); - - var stringBuilder = new StringBuilder(_templateParams["%(CustomScripts)"]); - if (stringBuilder.Length > 0) - stringBuilder.Append("|"); - - stringBuilder.Append(path); - _templateParams["%(CustomScripts)"] = stringBuilder.ToString(); - - CustomAsset(path, resourceAssembly, resourceName, isTemplate); - } - - public void DocExpansion(DocExpansion docExpansion) - { - _templateParams["%(DocExpansion)"] = docExpansion.ToString().ToLower(); - } - - public void SupportedSubmitMethods(params string[] methods) - { - _templateParams["%(SupportedSubmitMethods)"] = String.Join("|", methods).ToLower(); - } - - public void CustomAsset(string path, Assembly resourceAssembly, string resourceName, bool isTemplate = false) - { - if (path == "index") isTemplate = true; - _pathToAssetMap[path] = new EmbeddedAssetDescriptor(resourceAssembly, resourceName, isTemplate); - } - - public void EnableDiscoveryUrlSelector() - { - InjectJavaScript(GetType().Assembly, "Swashbuckle.SwaggerUi.CustomAssets.discoveryUrlSelector.js"); - } - - public void EnableOAuth2Support(string clientId, string realm, string appName) - { - EnableOAuth2Support(clientId, "N/A", realm, appName); - } - - public void EnableOAuth2Support( - string clientId, - string clientSecret, - string realm, - string appName, - string scopeSeperator = " ", - Dictionary additionalQueryStringParams = null) - { - _templateParams["%(OAuth2Enabled)"] = "true"; - _templateParams["%(OAuth2ClientId)"] = clientId; - _templateParams["%(OAuth2ClientSecret)"] = clientSecret; - _templateParams["%(OAuth2Realm)"] = realm; - _templateParams["%(OAuth2AppName)"] = appName; - _templateParams["%(OAuth2ScopeSeperator)"] = scopeSeperator; - - if (additionalQueryStringParams != null) - _templateParams["%(OAuth2AdditionalQueryStringParams)"] = JsonConvert.SerializeObject(additionalQueryStringParams); - } - - public void EnableApiKeySupport(string name, string apiKeyIn) { - _templateParams["%(ApiKeyName)"] = name; - _templateParams["%(ApiKeyIn)"] = apiKeyIn; - } - - internal IAssetProvider GetSwaggerUiProvider() - { - return new EmbeddedAssetProvider(_pathToAssetMap, _templateParams); - } - - internal string GetRootUrl(HttpRequestMessage swaggerRequest) - { - return _rootUrlResolver(swaggerRequest); - } - - private void MapPathsForSwaggerUiAssets() - { - var thisAssembly = GetType().Assembly; - foreach (var resourceName in thisAssembly.GetManifestResourceNames()) - { - if (resourceName.Contains("Swashbuckle.SwaggerUi.CustomAssets")) continue; // original assets only - - var path = resourceName - .Replace("\\", "/") - .Replace(".", "-"); // extensionless to avoid RUMMFAR - - _pathToAssetMap[path] = new EmbeddedAssetDescriptor(thisAssembly, resourceName, path == "index"); - } - } - } - - public enum DocExpansion - { - None, - List, - Full - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Application/SwaggerUiHandler.cs b/Swashbuckle.Core.Lib/Application/SwaggerUiHandler.cs deleted file mode 100644 index 9795b32fc..000000000 --- a/Swashbuckle.Core.Lib/Application/SwaggerUiHandler.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Net.Http; -using System.Threading; -using System; -using System.Threading.Tasks; -using System.Net; -using System.Net.Http.Headers; -using Swashbuckle.SwaggerUi; - -namespace Swashbuckle.Application -{ - public class SwaggerUiHandler : HttpMessageHandler - { - private readonly SwaggerUiConfig _config; - - public SwaggerUiHandler(SwaggerUiConfig config) - { - _config = config; - } - - protected override Task SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) - { - var swaggerUiProvider = _config.GetSwaggerUiProvider(); - var rootUrl = _config.GetRootUrl(request); - var assetPath = request.GetRouteData().Values["assetPath"].ToString(); - - try - { - var webAsset = swaggerUiProvider.GetAsset(rootUrl, assetPath); - var content = ContentFor(webAsset); - return TaskFor(new HttpResponseMessage { Content = content, RequestMessage = request }); - } - catch (AssetNotFound ex) - { - return TaskFor(request.CreateErrorResponse(HttpStatusCode.NotFound, ex)); - } - } - - private HttpContent ContentFor(Asset webAsset) - { - int bufferSize = webAsset.Stream.Length > int.MaxValue - ? int.MaxValue - : (int)webAsset.Stream.Length; - - var content = new StreamContent(webAsset.Stream, bufferSize); - content.Headers.ContentType = new MediaTypeHeaderValue(webAsset.MediaType); - return content; - } - - private Task TaskFor(HttpResponseMessage response) - { - var tsc = new TaskCompletionSource(); - tsc.SetResult(response); - return tsc.Task; - } - } -} diff --git a/Swashbuckle.Core.Lib/Application/VendorExtensionsConverter.cs b/Swashbuckle.Core.Lib/Application/VendorExtensionsConverter.cs deleted file mode 100644 index 2fc8f6d0c..000000000 --- a/Swashbuckle.Core.Lib/Application/VendorExtensionsConverter.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using Swashbuckle.Swagger; - -namespace Swashbuckle.Application -{ - public class VendorExtensionsConverter : JsonConverter - { - public override bool CanConvert(Type objectType) - { - return objectType.GetField("vendorExtensions") != null; - } - - public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) - { - throw new NotImplementedException(); - } - - public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) - { - var jsonContract = (JsonObjectContract)serializer.ContractResolver.ResolveContract(value.GetType()); - - writer.WriteStartObject(); - - foreach (var jsonProp in jsonContract.Properties) - { - var propValue = jsonProp.ValueProvider.GetValue(value); - if (propValue == null && serializer.NullValueHandling == NullValueHandling.Ignore) - continue; - - if (jsonProp.PropertyName == "vendorExtensions") - { - var vendorExtensions = (IDictionary)propValue; - if (vendorExtensions.Any()) - { - foreach (var entry in vendorExtensions) - { - writer.WritePropertyName(entry.Key); - serializer.Serialize(writer, entry.Value); - } - } - } - else - { - writer.WritePropertyName(jsonProp.PropertyName); - serializer.Serialize(writer, propValue); - } - } - - writer.WriteEndObject(); - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Application/VersionInfoBuilder.cs b/Swashbuckle.Core.Lib/Application/VersionInfoBuilder.cs deleted file mode 100644 index 39de08377..000000000 --- a/Swashbuckle.Core.Lib/Application/VersionInfoBuilder.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Swashbuckle.Swagger; - -namespace Swashbuckle.Application -{ - public class VersionInfoBuilder - { - private readonly Dictionary _versionInfos; - - public VersionInfoBuilder() - { - _versionInfos = new Dictionary(); - } - - public InfoBuilder Version(string version, string title) - { - var infoBuilder = new InfoBuilder(version, title); - _versionInfos[version] = infoBuilder; - return infoBuilder; - } - - public IDictionary Build() - { - return _versionInfos.ToDictionary(entry => entry.Key, entry => entry.Value.Build()); - } - } -} diff --git a/Swashbuckle.Core.Lib/Properties/AssemblyInfo.cs b/Swashbuckle.Core.Lib/Properties/AssemblyInfo.cs deleted file mode 100644 index d83311630..000000000 --- a/Swashbuckle.Core.Lib/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Swashbuckle.Core")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Swashbuckle.Core")] -[assembly: AssemblyCopyright("Copyright © 2014")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6a5ef762-7172-4bfb-98d2-076c3987fb7c")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.6.1.0")] -[assembly: AssemblyFileVersion("5.6.1.0")] -[assembly: AssemblyInformationalVersion("5.6.1")] \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerOperationAttributes.cs b/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerOperationAttributes.cs deleted file mode 100644 index 23c64b1cd..000000000 --- a/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerOperationAttributes.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Linq; -using System.Web.Http.Description; - -namespace Swashbuckle.Swagger.Annotations -{ - public class ApplySwaggerOperationAttributes : IOperationFilter - { - public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) - { - var attribute = apiDescription.ActionDescriptor.GetCustomAttributes() - .FirstOrDefault(); - if (attribute == null) return; - - if (attribute.OperationId != null) - operation.operationId = attribute.OperationId; - - if (attribute.Tags != null) - operation.tags = attribute.Tags; - - if (attribute.Schemes != null) - operation.schemes = attribute.Schemes; - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerOperationFilterAttributes.cs b/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerOperationFilterAttributes.cs deleted file mode 100644 index c8b7b9e4b..000000000 --- a/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerOperationFilterAttributes.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Web.Http.Description; - -namespace Swashbuckle.Swagger.Annotations -{ - public class ApplySwaggerOperationFilterAttributes : IOperationFilter - { - public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) - { - var attributes = apiDescription.GetControllerAndActionAttributes(); - - foreach (var attribute in attributes) - { - var filter = (IOperationFilter)Activator.CreateInstance(attribute.FilterType); - filter.Apply(operation, schemaRegistry, apiDescription); - } - } - } -} diff --git a/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerResponseAttributes.cs b/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerResponseAttributes.cs deleted file mode 100644 index 64bbe7656..000000000 --- a/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerResponseAttributes.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Web.Http.Description; - -namespace Swashbuckle.Swagger.Annotations -{ - public class ApplySwaggerResponseAttributes : IOperationFilter - { - public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) - { - if (apiDescription.GetControllerAndActionAttributes().Any()) - operation.responses.Clear(); - - var responseAttributes = apiDescription.GetControllerAndActionAttributes() - .OrderBy(attr => attr.StatusCode); - - foreach (var attr in responseAttributes) - { - var statusCode = attr.StatusCode.ToString(); - - operation.responses[statusCode] = new Response - { - description = attr.Description ?? InferDescriptionFrom(statusCode), - schema = (attr.Type != null) ? schemaRegistry.GetOrRegister(attr.Type) : null - }; - } - } - - private string InferDescriptionFrom(string statusCode) - { - HttpStatusCode enumValue; - if (Enum.TryParse(statusCode, true, out enumValue)) - { - return enumValue.ToString(); - } - return null; - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerSchemaFilterAttributes.cs b/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerSchemaFilterAttributes.cs deleted file mode 100644 index fbbff5fe0..000000000 --- a/Swashbuckle.Core.Lib/Swagger/Annotations/ApplySwaggerSchemaFilterAttributes.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Linq; -using System.Web.Http.Description; - -namespace Swashbuckle.Swagger.Annotations -{ - public class ApplySwaggerSchemaFilterAttributes : ISchemaFilter - { - public void Apply(Schema schema, SchemaRegistry schemaRegistry, Type type) - { - var attributes = type.GetCustomAttributes(false).OfType(); - - foreach (var attribute in attributes) - { - var filter = (ISchemaFilter)Activator.CreateInstance(attribute.FilterType); - filter.Apply(schema, schemaRegistry, type); - } - } - } -} diff --git a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerOperationAttribute.cs b/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerOperationAttribute.cs deleted file mode 100644 index 4d25e3971..000000000 --- a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerOperationAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Swashbuckle.Swagger.Annotations -{ - [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] - public class SwaggerOperationAttribute : Attribute - { - public SwaggerOperationAttribute(string operationId = null) - { - OperationId = operationId; - } - - public string OperationId { get; set; } - - public string[] Tags { get; set; } - - public string[] Schemes { get; set; } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerOperationFilterAttribute.cs b/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerOperationFilterAttribute.cs deleted file mode 100644 index f4d07205a..000000000 --- a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerOperationFilterAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Swashbuckle.Swagger.Annotations -{ - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] - public class SwaggerOperationFilterAttribute : Attribute - { - public SwaggerOperationFilterAttribute(Type filterType) - { - FilterType = filterType; - } - - public Type FilterType { get; private set; } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerResponseAttribute.cs b/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerResponseAttribute.cs deleted file mode 100644 index ce5af6610..000000000 --- a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerResponseAttribute.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Net; - -namespace Swashbuckle.Swagger.Annotations -{ - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)] - public class SwaggerResponseAttribute : Attribute - { - public SwaggerResponseAttribute(HttpStatusCode statusCode) - { - StatusCode = (int)statusCode; - } - - public SwaggerResponseAttribute(HttpStatusCode statusCode, string description = null, Type type = null) - : this(statusCode) - { - Description = description; - Type = type; - } - - public SwaggerResponseAttribute(int statusCode) - { - StatusCode = statusCode; - } - - public SwaggerResponseAttribute(int statusCode, string description = null, Type type = null) - : this(statusCode) - { - Description = description; - Type = type; - } - - public int StatusCode { get; private set; } - - public string Description { get; set; } - - public Type Type { get; set; } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerResponseRemoveDefaultsAttribute.cs b/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerResponseRemoveDefaultsAttribute.cs deleted file mode 100644 index 0af693052..000000000 --- a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerResponseRemoveDefaultsAttribute.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; -using System.Net; - -namespace Swashbuckle.Swagger.Annotations -{ - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false)] - public class SwaggerResponseRemoveDefaultsAttribute : Attribute - { - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerSchemaFilterAttribute.cs b/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerSchemaFilterAttribute.cs deleted file mode 100644 index 1f4533afa..000000000 --- a/Swashbuckle.Core.Lib/Swagger/Annotations/SwaggerSchemaFilterAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace Swashbuckle.Swagger.Annotations -{ - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] - public class SwaggerSchemaFilterAttribute : Attribute - { - public SwaggerSchemaFilterAttribute(Type filterType) - { - FilterType = filterType; - } - - public Type FilterType { get; private set; } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/ApiDescriptionExtensions.cs b/Swashbuckle.Core.Lib/Swagger/ApiDescriptionExtensions.cs deleted file mode 100644 index ea108d4ad..000000000 --- a/Swashbuckle.Core.Lib/Swagger/ApiDescriptionExtensions.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using System.Web.Http.Description; - -namespace Swashbuckle.Swagger -{ - public static class ApiDescriptionExtensions - { - public static string FriendlyId(this ApiDescription apiDescription) - { - return String.Format("{0}_{1}", - apiDescription.ActionDescriptor.ControllerDescriptor.ControllerName, - apiDescription.ActionDescriptor.ActionName); - } - - public static IEnumerable Consumes(this ApiDescription apiDescription) - { - return apiDescription.SupportedRequestBodyFormatters - .SelectMany(formatter => formatter.SupportedMediaTypes.Select(mediaType => mediaType.MediaType)) - .Distinct(); - } - - public static IEnumerable Produces(this ApiDescription apiDescription) - { - return apiDescription.SupportedResponseFormatters - .SelectMany(formatter => formatter.SupportedMediaTypes.Select(mediaType => mediaType.MediaType)) - .Distinct(); - } - - public static string RelativePathSansQueryString(this ApiDescription apiDescription) - { - return apiDescription.RelativePath.Split('?').First(); - } - - public static Type ResponseType(this ApiDescription apiDesc) - { - // HACK: The ResponseDescription property was introduced in WebApi 5.0 but Swashbuckle supports >= 4.0. - // The reflection hack below provides support for the ResponseType attribute if the application is running - // against a version of WebApi that supports it. - var apiDescType = typeof(ApiDescription); - - var responseDescPropInfo = apiDescType.GetProperty("ResponseDescription"); - if (responseDescPropInfo != null) - { - var responseDesc = responseDescPropInfo.GetValue(apiDesc, null); - if (responseDesc != null) - { - var responseDescType = responseDesc.GetType(); - - var responseTypePropInfo = responseDescType.GetProperty("ResponseType"); - if (responseTypePropInfo != null) - { - var responseType = responseTypePropInfo.GetValue(responseDesc, null); - if (responseType != null) - return (Type)responseType; - } - } - } - - // Otherwise, it defaults to the declared response type - return apiDesc.ActionDescriptor.ReturnType; - } - - public static bool IsObsolete(this ApiDescription apiDescription) - { - return apiDescription.ActionDescriptor.GetCustomAttributes().Any(); - } - - public static IEnumerable GetControllerAndActionAttributes(this ApiDescription apiDesc) - where TAttribute : class - { - var controllerAttributes = apiDesc.ActionDescriptor.ControllerDescriptor - .GetCustomAttributes(); - - var actionAttributes = apiDesc.ActionDescriptor - .GetCustomAttributes(); - - return controllerAttributes.Concat(actionAttributes); - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/FromUriParams/HandleFromUriParams.cs b/Swashbuckle.Core.Lib/Swagger/FromUriParams/HandleFromUriParams.cs deleted file mode 100644 index 0e0ca1d81..000000000 --- a/Swashbuckle.Core.Lib/Swagger/FromUriParams/HandleFromUriParams.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System.Linq; -using System.Web.Http.Description; -using Swashbuckle.Swagger; -using System.Collections.Generic; - -namespace Swashbuckle.Swagger.FromUriParams -{ - public class HandleFromUriParams : IOperationFilter - { - public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) - { - if (operation.parameters == null) return; - - HandleFromUriArrayParams(operation); - HandleFromUriObjectParams(operation, schemaRegistry, apiDescription); - } - - private static void HandleFromUriArrayParams(Operation operation) - { - var fromUriArrayParams = operation.parameters - .Where(param => param.@in == "query" && param.type == "array") - .ToArray(); - - foreach (var param in fromUriArrayParams) - { - param.collectionFormat = "multi"; - } - } - - private void HandleFromUriObjectParams(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) - { - var fromUriObjectParams = operation.parameters - .Where(param => param.@in == "query" && param.type == null) - .ToArray(); - - foreach (var objectParam in fromUriObjectParams) - { - var type = apiDescription.ParameterDescriptions - .Single(paramDesc => paramDesc.Name == objectParam.name) - .ParameterDescriptor.ParameterType; - - var refSchema = schemaRegistry.GetOrRegister(type); - var schema = schemaRegistry.Definitions[refSchema.@ref.Replace("#/definitions/", "")]; - - var qualifier = string.IsNullOrEmpty(objectParam.name) ? "" : (objectParam.name + "."); - ExtractAndAddQueryParams(schema, qualifier, objectParam.required, schemaRegistry, operation.parameters); - operation.parameters.Remove(objectParam); - } - } - - private void ExtractAndAddQueryParams( - Schema sourceSchema, - string sourceQualifier, - bool? sourceRequired, - SchemaRegistry schemaRegistry, - IList operationParams) - { - foreach (var entry in sourceSchema.properties) - { - var propertySchema = entry.Value; - if (propertySchema.readOnly == true) continue; - - var required = (sourceRequired == true) - && sourceSchema.required != null && sourceSchema.required.Contains(entry.Key); - - if (propertySchema.@ref != null) - { - var schema = schemaRegistry.Definitions[propertySchema.@ref.Replace("#/definitions/", "")]; - ExtractAndAddQueryParams( - schema, - sourceQualifier + entry.Key.ToCamelCase() + ".", - required, - schemaRegistry, - operationParams); - } - else - { - var param = new Parameter - { - name = sourceQualifier + entry.Key.ToCamelCase(), - @in = "query", - required = required, - description = entry.Value.description - }; - param.PopulateFrom(entry.Value); - if (param.type == "array") - param.collectionFormat = "multi"; - operationParams.Add(param); - } - } - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/IDocumentFilter.cs b/Swashbuckle.Core.Lib/Swagger/IDocumentFilter.cs deleted file mode 100644 index 5e069bdf0..000000000 --- a/Swashbuckle.Core.Lib/Swagger/IDocumentFilter.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Web.Http.Description; - -namespace Swashbuckle.Swagger -{ - public interface IDocumentFilter - { - void Apply(SwaggerDocument swaggerDoc, SchemaRegistry schemaRegistry, IApiExplorer apiExplorer); - } -} diff --git a/Swashbuckle.Core.Lib/Swagger/IModelFilter.cs b/Swashbuckle.Core.Lib/Swagger/IModelFilter.cs deleted file mode 100644 index ebda51a3f..000000000 --- a/Swashbuckle.Core.Lib/Swagger/IModelFilter.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using Newtonsoft.Json.Serialization; - -namespace Swashbuckle.Swagger -{ - public interface IModelFilter - { - void Apply(Schema model, ModelFilterContext context); - } - - public class ModelFilterContext - { - public ModelFilterContext( - Type systemType, - JsonObjectContract jsonObjectContract, - SchemaRegistry schemaRegistry) - { - SystemType = systemType; - JsonObjectContract = jsonObjectContract; - SchemaRegistry = schemaRegistry; - } - - public Type SystemType { get; private set; } - - public JsonObjectContract JsonObjectContract { get; private set; } - - public SchemaRegistry SchemaRegistry { get; private set; } - } -} diff --git a/Swashbuckle.Core.Lib/Swagger/IOperationFilter.cs b/Swashbuckle.Core.Lib/Swagger/IOperationFilter.cs deleted file mode 100644 index 06545c321..000000000 --- a/Swashbuckle.Core.Lib/Swagger/IOperationFilter.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Web.Http.Description; - -namespace Swashbuckle.Swagger -{ - public interface IOperationFilter - { - void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription); - } -} diff --git a/Swashbuckle.Core.Lib/Swagger/ISchemaFilter.cs b/Swashbuckle.Core.Lib/Swagger/ISchemaFilter.cs deleted file mode 100644 index eac63be7c..000000000 --- a/Swashbuckle.Core.Lib/Swagger/ISchemaFilter.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; - -namespace Swashbuckle.Swagger -{ - public interface ISchemaFilter - { - void Apply(Schema schema, SchemaRegistry schemaRegistry, Type type); - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/ISwaggerProvider.cs b/Swashbuckle.Core.Lib/Swagger/ISwaggerProvider.cs deleted file mode 100644 index a274782b0..000000000 --- a/Swashbuckle.Core.Lib/Swagger/ISwaggerProvider.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace Swashbuckle.Swagger -{ - public interface ISwaggerProvider - { - SwaggerDocument GetSwagger(string rootUrl, string apiVersion); - } - - public class UnknownApiVersion : Exception - { - public UnknownApiVersion(string apiVersion) - : base(String.Format("Unknown API version - {0}", apiVersion)) - {} - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/JsonContractExtensions.cs b/Swashbuckle.Core.Lib/Swagger/JsonContractExtensions.cs deleted file mode 100644 index 56012fcb6..000000000 --- a/Swashbuckle.Core.Lib/Swagger/JsonContractExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace Swashbuckle.Swagger -{ - public static class JsonContractExtensions - { - private static IEnumerable AmbiguousTypeNames = new[] - { - "System.Object", - "System.Net.Http.HttpRequestMessage", - "System.Net.Http.HttpResponseMessage", - "System.Web.Http.IHttpActionResult" - }; - - public static bool IsSelfReferencing(this JsonDictionaryContract dictionaryContract) - { - return dictionaryContract.UnderlyingType == dictionaryContract.DictionaryValueType; - } - - public static bool IsSelfReferencing(this JsonArrayContract arrayContract) - { - return arrayContract.UnderlyingType == arrayContract.CollectionItemType; - } - - public static bool IsAmbiguous(this JsonObjectContract objectContract) - { - return AmbiguousTypeNames.Contains(objectContract.UnderlyingType.FullName); - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/JsonPropertyExtensions.cs b/Swashbuckle.Core.Lib/Swagger/JsonPropertyExtensions.cs deleted file mode 100644 index 30543ae6d..000000000 --- a/Swashbuckle.Core.Lib/Swagger/JsonPropertyExtensions.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Reflection; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -namespace Swashbuckle.Swagger -{ - public static class JsonPropertyExtensions - { - public static bool IsRequired(this JsonProperty jsonProperty) - { - return jsonProperty.HasAttribute() || jsonProperty.Required == Required.Always; - } - - public static bool IsObsolete(this JsonProperty jsonProperty) - { - return jsonProperty.HasAttribute(); - } - - public static bool HasAttribute(this JsonProperty jsonProperty) - { - var propInfo = jsonProperty.PropertyInfo(); - return propInfo != null && Attribute.IsDefined(propInfo, typeof (T)); - } - - public static PropertyInfo PropertyInfo(this JsonProperty jsonProperty) - { - if (jsonProperty.UnderlyingName == null) return null; - - var metadata = jsonProperty.DeclaringType.GetCustomAttributes(typeof(MetadataTypeAttribute), true) - .FirstOrDefault(); - - var typeToReflect = (metadata != null) - ? ((MetadataTypeAttribute)metadata).MetadataClassType - : jsonProperty.DeclaringType; - - return typeToReflect.GetProperty(jsonProperty.UnderlyingName, jsonProperty.PropertyType); - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/SchemaExtensions.cs b/Swashbuckle.Core.Lib/Swagger/SchemaExtensions.cs deleted file mode 100644 index a1c5c63bd..000000000 --- a/Swashbuckle.Core.Lib/Swagger/SchemaExtensions.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; -using System.ComponentModel.DataAnnotations; -using Newtonsoft.Json.Serialization; - -namespace Swashbuckle.Swagger -{ - public static class SchemaExtensions - { - public static Schema WithValidationProperties(this Schema schema, JsonProperty jsonProperty) - { - var propInfo = jsonProperty.PropertyInfo(); - if (propInfo == null) - return schema; - - foreach (var attribute in propInfo.GetCustomAttributes(false)) - { - var regex = attribute as RegularExpressionAttribute; - if (regex != null) - schema.pattern = regex.Pattern; - - var range = attribute as RangeAttribute; - if (range != null) - { - int maximum; - if (Int32.TryParse(range.Maximum.ToString(), out maximum)) - schema.maximum = maximum; - - int minimum; - if (Int32.TryParse(range.Minimum.ToString(), out minimum)) - schema.minimum = minimum; - } - - var length = attribute as StringLengthAttribute; - if (length != null) - { - schema.maxLength = length.MaximumLength; - schema.minLength = length.MinimumLength; - } - } - - if (!jsonProperty.Writable) - schema.readOnly = true; - - return schema; - } - - public static void PopulateFrom(this PartialSchema partialSchema, Schema schema) - { - if (schema == null) return; - - partialSchema.type = schema.type; - partialSchema.format = schema.format; - partialSchema.vendorExtensions = schema.vendorExtensions; - - if (schema.items != null) - { - // TODO: Handle jagged primitive array and error on jagged object array - partialSchema.items = new PartialSchema(); - partialSchema.items.PopulateFrom(schema.items); - } - - partialSchema.@default = schema.@default; - partialSchema.maximum = schema.maximum; - partialSchema.exclusiveMaximum = schema.exclusiveMaximum; - partialSchema.minimum = schema.minimum; - partialSchema.exclusiveMinimum = schema.exclusiveMinimum; - partialSchema.maxLength = schema.maxLength; - partialSchema.minLength = schema.minLength; - partialSchema.pattern = schema.pattern; - partialSchema.maxItems = schema.maxItems; - partialSchema.minItems = schema.minItems; - partialSchema.uniqueItems = schema.uniqueItems; - partialSchema.@enum = schema.@enum; - partialSchema.multipleOf = schema.multipleOf; - } - } -} diff --git a/Swashbuckle.Core.Lib/Swagger/SchemaRegistry.cs b/Swashbuckle.Core.Lib/Swagger/SchemaRegistry.cs deleted file mode 100644 index 4a37f92e6..000000000 --- a/Swashbuckle.Core.Lib/Swagger/SchemaRegistry.cs +++ /dev/null @@ -1,302 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Dynamic; -using System.Linq; -using System.Net.Http; -using System.Reflection; -using System.Runtime.Serialization; -using System.Text; -using System.Web.Http; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json.Serialization; -using Newtonsoft.Json.Converters; -using System.Net.Http.Formatting; - -namespace Swashbuckle.Swagger -{ - public class SchemaRegistry - { - private readonly JsonSerializerSettings _jsonSerializerSettings; - private readonly IDictionary> _customSchemaMappings; - private readonly IEnumerable _schemaFilters; - private readonly IEnumerable _modelFilters; - private readonly Func _schemaIdSelector; - private readonly bool _ignoreObsoleteProperties; - private readonly bool _describeAllEnumsAsStrings; - private readonly bool _describeStringEnumsInCamelCase; - private readonly bool _applyFiltersToAllSchemas; - - private readonly IContractResolver _contractResolver; - - private IDictionary _workItems; - private class WorkItem - { - public string SchemaId; - public bool InProgress; - public Schema Schema; - } - - public SchemaRegistry( - JsonSerializerSettings jsonSerializerSettings, - IDictionary> customSchemaMappings, - IEnumerable schemaFilters, - IEnumerable modelFilters, - bool ignoreObsoleteProperties, - Func schemaIdSelector, - bool describeAllEnumsAsStrings, - bool describeStringEnumsInCamelCase, - bool applyFiltersToAllSchemas) - { - _jsonSerializerSettings = jsonSerializerSettings; - _customSchemaMappings = customSchemaMappings; - _schemaFilters = schemaFilters; - _modelFilters = modelFilters; - _schemaIdSelector = schemaIdSelector; - _ignoreObsoleteProperties = ignoreObsoleteProperties; - _describeAllEnumsAsStrings = describeAllEnumsAsStrings; - _describeStringEnumsInCamelCase = describeStringEnumsInCamelCase; - _applyFiltersToAllSchemas = applyFiltersToAllSchemas; - - _contractResolver = jsonSerializerSettings.ContractResolver ?? new DefaultContractResolver(); - _workItems = new Dictionary(); - Definitions = new Dictionary(); - } - - public Schema GetOrRegister(Type type) - { - var schema = CreateInlineSchema(type); - - // Iterate outstanding work items (i.e. referenced types) and generate the corresponding definition - while (_workItems.Any(entry => entry.Value.Schema == null && !entry.Value.InProgress)) - { - var typeMapping = _workItems.First(entry => entry.Value.Schema == null && !entry.Value.InProgress); - var workItem = typeMapping.Value; - - workItem.InProgress = true; - workItem.Schema = CreateDefinitionSchema(typeMapping.Key); - Definitions.Add(workItem.SchemaId, workItem.Schema); - workItem.InProgress = false; - } - - return schema; - } - - public IDictionary Definitions { get; private set; } - - private Schema CreateInlineSchema(Type type) - { - var jsonContract = _contractResolver.ResolveContract(type); - - if (_customSchemaMappings.ContainsKey(type)) - return FilterSchema(_customSchemaMappings[type](), jsonContract); - - if (jsonContract is JsonPrimitiveContract) - return FilterSchema(CreatePrimitiveSchema((JsonPrimitiveContract)jsonContract), jsonContract); - - var dictionaryContract = jsonContract as JsonDictionaryContract; - if (dictionaryContract != null) - return dictionaryContract.IsSelfReferencing() - ? CreateRefSchema(type) - : FilterSchema(CreateDictionarySchema(dictionaryContract), jsonContract); - - var arrayContract = jsonContract as JsonArrayContract; - if (arrayContract != null) - return arrayContract.IsSelfReferencing() - ? CreateRefSchema(type) - : FilterSchema(CreateArraySchema(arrayContract), jsonContract); - - var objectContract = jsonContract as JsonObjectContract; - if (objectContract != null && !objectContract.IsAmbiguous()) - return CreateRefSchema(type); - - // Fallback to abstract "object" - return FilterSchema(new Schema { type = "object" }, jsonContract); - } - - private Schema CreateDefinitionSchema(Type type) - { - var jsonContract = _contractResolver.ResolveContract(type); - - if (jsonContract is JsonDictionaryContract) - return FilterSchema(CreateDictionarySchema((JsonDictionaryContract)jsonContract), jsonContract); - - if (jsonContract is JsonArrayContract) - return FilterSchema(CreateArraySchema((JsonArrayContract)jsonContract), jsonContract); - - if (jsonContract is JsonObjectContract) - return FilterSchema(CreateObjectSchema((JsonObjectContract)jsonContract), jsonContract); - - throw new InvalidOperationException( - String.Format("Unsupported type - {0} for Defintitions. Must be Dictionary, Array or Object", type)); - } - - private Schema CreatePrimitiveSchema(JsonPrimitiveContract primitiveContract) - { - var type = Nullable.GetUnderlyingType(primitiveContract.UnderlyingType) ?? primitiveContract.UnderlyingType; - - if (type.IsEnum) - return CreateEnumSchema(primitiveContract, type); - - switch (type.FullName) - { - case "System.Boolean": - return new Schema { type = "boolean" }; - case "System.Byte": - case "System.SByte": - case "System.Int16": - case "System.UInt16": - case "System.Int32": - case "System.UInt32": - return new Schema { type = "integer", format = "int32" }; - case "System.Int64": - case "System.UInt64": - return new Schema { type = "integer", format = "int64" }; - case "System.Single": - return new Schema { type = "number", format = "float" }; - case "System.Double": - case "System.Decimal": - return new Schema { type = "number", format = "double" }; - case "System.Byte[]": - return new Schema { type = "string", format = "byte" }; - case "System.DateTime": - case "System.DateTimeOffset": - return new Schema { type = "string", format = "date-time" }; - case "System.Guid": - return new Schema { type = "string", format = "uuid", example = Guid.Empty }; - default: - return new Schema { type = "string" }; - } - } - - private Schema CreateEnumSchema(JsonPrimitiveContract primitiveContract, Type type) - { - var stringEnumConverter = primitiveContract.Converter as StringEnumConverter - ?? _jsonSerializerSettings.Converters.OfType().FirstOrDefault(); - - if (_describeAllEnumsAsStrings || stringEnumConverter != null) - { - var camelCase = _describeStringEnumsInCamelCase - || (stringEnumConverter != null && stringEnumConverter.CamelCaseText); - - return new Schema - { - type = "string", - @enum = camelCase - ? type.GetEnumNamesForSerialization().Select(name => name.ToCamelCase()).ToArray() - : type.GetEnumNamesForSerialization() - }; - } - - return new Schema - { - type = "integer", - format = "int32", - @enum = type.GetEnumValues().Cast().ToArray() - }; - } - - private Schema CreateDictionarySchema(JsonDictionaryContract dictionaryContract) - { - var keyType = dictionaryContract.DictionaryKeyType ?? typeof(object); - var valueType = dictionaryContract.DictionaryValueType ?? typeof(object); - - if (keyType.IsEnum) - { - return new Schema - { - type = "object", - properties = Enum.GetNames(keyType).ToDictionary( - (name) => dictionaryContract.DictionaryKeyResolver(name), - (name) => CreateInlineSchema(valueType) - ) - }; - } - else - { - return new Schema - { - type = "object", - additionalProperties = CreateInlineSchema(valueType) - }; - } - } - - private Schema CreateArraySchema(JsonArrayContract arrayContract) - { - var itemType = arrayContract.CollectionItemType ?? typeof(object); - return new Schema - { - type = "array", - items = CreateInlineSchema(itemType) - }; - } - - private Schema CreateObjectSchema(JsonObjectContract jsonContract) - { - var properties = jsonContract.Properties - .Where(p => !p.Ignored) - .Where(p => !(_ignoreObsoleteProperties && p.IsObsolete())) - .ToDictionary( - prop => prop.PropertyName, - prop => CreateInlineSchema(prop.PropertyType).WithValidationProperties(prop) - ); - - var required = jsonContract.Properties.Where(prop => prop.IsRequired()) - .Select(propInfo => propInfo.PropertyName) - .ToList(); - - return new Schema - { - required = required.Any() ? required : null, // required can be null but not empty - properties = properties, - type = "object" - }; - } - - private Schema CreateRefSchema(Type type) - { - if (!_workItems.ContainsKey(type)) - { - var schemaId = _schemaIdSelector(type); - if (_workItems.Any(entry => entry.Value.SchemaId == schemaId)) - { - var conflictingType = _workItems.First(entry => entry.Value.SchemaId == schemaId).Key; - throw new InvalidOperationException(String.Format( - "Conflicting schemaIds: Duplicate schemaIds detected for types {0} and {1}. " + - "See the config setting - \"UseFullTypeNameInSchemaIds\" for a potential workaround", - type.FullName, conflictingType.FullName)); - } - - _workItems.Add(type, new WorkItem { SchemaId = schemaId }); - } - - return new Schema { @ref = "#/definitions/" + _workItems[type].SchemaId }; - } - - private Schema FilterSchema(Schema schema, JsonContract jsonContract) - { - if (schema.type == "object" || _applyFiltersToAllSchemas) - { - var jsonObjectContract = jsonContract as JsonObjectContract; - if (jsonObjectContract != null) - { - // NOTE: In next major version, _modelFilters will completely replace _schemaFilters - var modelFilterContext = new ModelFilterContext(jsonObjectContract.UnderlyingType, jsonObjectContract, this); - foreach (var filter in _modelFilters) - { - filter.Apply(schema, modelFilterContext); - } - } - - foreach (var filter in _schemaFilters) - { - filter.Apply(schema, this, jsonContract.UnderlyingType); - } - } - - return schema; - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/StringExtensions.cs b/Swashbuckle.Core.Lib/Swagger/StringExtensions.cs deleted file mode 100644 index 808ee3c57..000000000 --- a/Swashbuckle.Core.Lib/Swagger/StringExtensions.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Swashbuckle.Swagger -{ - internal static class StringExtensions - { - internal static string ToCamelCase(this string value) - { - if (string.IsNullOrEmpty(value)) return value; - return value.Substring(0, 1).ToLowerInvariant() + value.Substring(1); - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/SwaggerDocument.cs b/Swashbuckle.Core.Lib/Swagger/SwaggerDocument.cs deleted file mode 100644 index c1dec6375..000000000 --- a/Swashbuckle.Core.Lib/Swagger/SwaggerDocument.cs +++ /dev/null @@ -1,318 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Newtonsoft.Json; - -namespace Swashbuckle.Swagger -{ - public class SwaggerDocument - { - public readonly string swagger = "2.0"; - - public Info info; - - public string host; - - public string basePath; - - public IList schemes; - - public IList consumes; - - public IList produces; - - public IDictionary paths; - - public IDictionary definitions; - - public IDictionary parameters; - - public IDictionary responses; - - public IDictionary securityDefinitions; - - public IList>> security; - - public IList tags; - - public ExternalDocs externalDocs; - - public Dictionary vendorExtensions = new Dictionary(); - } - - public class Info - { - public string version; - - public string title; - - public string description; - - public string termsOfService; - - public Contact contact; - - public License license; - - public Dictionary vendorExtensions = new Dictionary(); - } - - public class Contact - { - public string name; - - public string url; - - public string email; - } - - public class License - { - public string name; - - public string url; - } - - public class PathItem - { - [JsonProperty("$ref")] - public string @ref; - - public Operation get; - - public Operation put; - - public Operation post; - - public Operation delete; - - public Operation options; - - public Operation head; - - public Operation patch; - - public IList parameters; - - public Dictionary vendorExtensions = new Dictionary(); - } - - public class Operation - { - public IList tags; - - public string summary; - - public string description; - - public ExternalDocs externalDocs; - - public string operationId; - - public IList consumes; - - public IList produces; - - public IList parameters; - - public IDictionary responses; - - public IList schemes; - - public bool? deprecated; - - public IList>> security; - - public Dictionary vendorExtensions = new Dictionary(); - } - - public class Tag - { - public string name; - - public string description; - - public ExternalDocs externalDocs; - - public Dictionary vendorExtensions = new Dictionary(); - } - - public class ExternalDocs - { - public string description; - - public string url; - } - - public class Parameter : PartialSchema - { - [JsonProperty("$ref")] - public string @ref; - - public string name; - - public string @in; - - public string description; - - public bool? required; - - public Schema schema; - } - - public class Schema - { - [JsonProperty("$ref")] - public string @ref; - - public string format; - - public string title; - - public string description; - - public object @default; - - public int? multipleOf; - - public int? maximum; - - public bool? exclusiveMaximum; - - public int? minimum; - - public bool? exclusiveMinimum; - - public int? maxLength; - - public int? minLength; - - public string pattern; - - public int? maxItems; - - public int? minItems; - - public bool? uniqueItems; - - public int? maxProperties; - - public int? minProperties; - - public IList required; - - public IList @enum; - - public string type; - - public Schema items; - - public IList allOf; - - public IDictionary properties; - - public Schema additionalProperties; - - public string discriminator; - - public bool? readOnly; - - public Xml xml; - - public ExternalDocs externalDocs; - - public object example; - - public Dictionary vendorExtensions = new Dictionary(); - } - - public class PartialSchema - { - public string type; - - public string format; - - public PartialSchema items; - - public string collectionFormat; - - public object @default; - - public int? maximum; - - public bool? exclusiveMaximum; - - public int? minimum; - - public bool? exclusiveMinimum; - - public int? maxLength; - - public int? minLength; - - public string pattern; - - public int? maxItems; - - public int? minItems; - - public bool? uniqueItems; - - public IList @enum; - - public int? multipleOf; - - public Dictionary vendorExtensions = new Dictionary(); - } - - public class Response - { - public string description; - - public Schema schema; - - public IDictionary headers; - - public object examples; - - public Dictionary vendorExtensions = new Dictionary(); - } - - public class Header : PartialSchema - { - public string description; - } - - public class Xml - { - public string name; - - public string @namespace; - - public string prefix; - - public bool? attribute; - - public bool? wrapped; - } - - public class SecurityScheme - { - public string type; - - public string description; - - public string name; - - public string @in; - - public string flow; - - public string authorizationUrl; - - public string tokenUrl; - - public IDictionary scopes; - - public Dictionary vendorExtensions = new Dictionary(); - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/SwaggerGenerator.cs b/Swashbuckle.Core.Lib/Swagger/SwaggerGenerator.cs deleted file mode 100644 index 851adfc5d..000000000 --- a/Swashbuckle.Core.Lib/Swagger/SwaggerGenerator.cs +++ /dev/null @@ -1,209 +0,0 @@ -using System.Linq; -using System.Collections.Generic; -using System.Web.Http.Description; -using System; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; -using System.Net.Http.Formatting; -using System.Net.Http; -using System.Threading; - -namespace Swashbuckle.Swagger -{ - public class SwaggerGenerator : ISwaggerProvider - { - private readonly IApiExplorer _apiExplorer; - private readonly JsonSerializerSettings _jsonSerializerSettings; - private readonly IDictionary _apiVersions; - private readonly SwaggerGeneratorOptions _options; - - public SwaggerGenerator( - IApiExplorer apiExplorer, - JsonSerializerSettings jsonSerializerSettings, - IDictionary apiVersions, - SwaggerGeneratorOptions options = null) - { - _apiExplorer = apiExplorer; - _jsonSerializerSettings = jsonSerializerSettings; - _apiVersions = apiVersions; - _options = options ?? new SwaggerGeneratorOptions(); - } - - public SwaggerDocument GetSwagger(string rootUrl, string apiVersion) - { - var schemaRegistry = new SchemaRegistry( - _jsonSerializerSettings, - _options.CustomSchemaMappings, - _options.SchemaFilters, - _options.ModelFilters, - _options.IgnoreObsoleteProperties, - _options.SchemaIdSelector, - _options.DescribeAllEnumsAsStrings, - _options.DescribeStringEnumsInCamelCase, - _options.ApplyFiltersToAllSchemas); - - Info info; - _apiVersions.TryGetValue(apiVersion, out info); - if (info == null) - throw new UnknownApiVersion(apiVersion); - - var paths = GetApiDescriptionsFor(apiVersion) - .Where(apiDesc => !(_options.IgnoreObsoleteActions && apiDesc.IsObsolete())) - .OrderBy(_options.GroupingKeySelector, _options.GroupingKeyComparer) - .GroupBy(apiDesc => apiDesc.RelativePathSansQueryString()) - .ToDictionary(group => "/" + group.Key, group => CreatePathItem(group, schemaRegistry)); - - var rootUri = new Uri(rootUrl); - var port = (!rootUri.IsDefaultPort) ? ":" + rootUri.Port : string.Empty; - - var swaggerDoc = new SwaggerDocument - { - info = info, - host = rootUri.Host + port, - basePath = (rootUri.AbsolutePath != "/") ? rootUri.AbsolutePath : null, - schemes = (_options.Schemes != null) ? _options.Schemes.ToList() : new[] { rootUri.Scheme }.ToList(), - paths = paths, - definitions = schemaRegistry.Definitions, - securityDefinitions = _options.SecurityDefinitions - }; - - foreach(var filter in _options.DocumentFilters) - { - filter.Apply(swaggerDoc, schemaRegistry, _apiExplorer); - } - - return swaggerDoc; - } - - private IEnumerable GetApiDescriptionsFor(string apiVersion) - { - return (_options.VersionSupportResolver == null) - ? _apiExplorer.ApiDescriptions - : _apiExplorer.ApiDescriptions.Where(apiDesc => _options.VersionSupportResolver(apiDesc, apiVersion)); - } - - private PathItem CreatePathItem(IEnumerable apiDescriptions, SchemaRegistry schemaRegistry) - { - var pathItem = new PathItem(); - - // Group further by http method - var perMethodGrouping = apiDescriptions - .GroupBy(apiDesc => apiDesc.HttpMethod.Method.ToLower()); - - foreach (var group in perMethodGrouping) - { - var httpMethod = group.Key; - - var apiDescription = (group.Count() == 1) - ? group.First() - : _options.ConflictingActionsResolver(group); - - switch (httpMethod) - { - case "get": - pathItem.get = CreateOperation(apiDescription, schemaRegistry); - break; - case "put": - pathItem.put = CreateOperation(apiDescription, schemaRegistry); - break; - case "post": - pathItem.post = CreateOperation(apiDescription, schemaRegistry); - break; - case "delete": - pathItem.delete = CreateOperation(apiDescription, schemaRegistry); - break; - case "options": - pathItem.options = CreateOperation(apiDescription, schemaRegistry); - break; - case "head": - pathItem.head = CreateOperation(apiDescription, schemaRegistry); - break; - case "patch": - pathItem.patch = CreateOperation(apiDescription, schemaRegistry); - break; - } - } - - return pathItem; - } - - private Operation CreateOperation(ApiDescription apiDesc, SchemaRegistry schemaRegistry) - { - var parameters = apiDesc.ParameterDescriptions - .Where(paramDesc => - { - var paramDescriptor = paramDesc.ParameterDescriptor; - return (paramDescriptor == null || paramDescriptor.ParameterType != typeof(CancellationToken)); - }) - .Select(paramDesc => - { - string location = GetParameterLocation(apiDesc, paramDesc); - return CreateParameter(location, paramDesc, schemaRegistry); - }) - .ToList(); - - var responses = new Dictionary(); - var responseType = apiDesc.ResponseType(); - if (responseType == null || responseType == typeof(void)) - responses.Add("204", new Response { description = "No Content" }); - else - responses.Add("200", new Response { description = "OK", schema = schemaRegistry.GetOrRegister(responseType) }); - - var operation = new Operation - { - tags = new[] { _options.GroupingKeySelector(apiDesc) }, - operationId = apiDesc.FriendlyId(), - produces = apiDesc.Produces().ToList(), - consumes = apiDesc.Consumes().ToList(), - parameters = parameters.Any() ? parameters : null, // parameters can be null but not empty - responses = responses, - deprecated = apiDesc.IsObsolete() ? true : (bool?) null - }; - - foreach (var filter in _options.OperationFilters) - { - filter.Apply(operation, schemaRegistry, apiDesc); - } - - return operation; - } - - private string GetParameterLocation(ApiDescription apiDesc, ApiParameterDescription paramDesc) - { - if (apiDesc.RelativePathSansQueryString().Contains("{" + paramDesc.Name + "}")) - return "path"; - else if (paramDesc.Source == ApiParameterSource.FromBody) - return "body"; - else - return "query"; - } - - private Parameter CreateParameter(string location, ApiParameterDescription paramDesc, SchemaRegistry schemaRegistry) - { - var parameter = new Parameter - { - @in = location, - name = paramDesc.Name - }; - - // e.g. route parameters - if (paramDesc.ParameterDescriptor == null) - { - parameter.type = "string"; - parameter.required = true; - return parameter; - } - - parameter.required = location == "path" || !paramDesc.ParameterDescriptor.IsOptional; - parameter.@default = paramDesc.ParameterDescriptor.DefaultValue; - - var schema = schemaRegistry.GetOrRegister(paramDesc.ParameterDescriptor.ParameterType); - if (parameter.@in == "body") - parameter.schema = schema; - else - parameter.PopulateFrom(schema); - - return parameter; - } - } -} diff --git a/Swashbuckle.Core.Lib/Swagger/SwaggerGeneratorOptions.cs b/Swashbuckle.Core.Lib/Swagger/SwaggerGeneratorOptions.cs deleted file mode 100644 index df1231b67..000000000 --- a/Swashbuckle.Core.Lib/Swagger/SwaggerGeneratorOptions.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web.Http.Description; - -namespace Swashbuckle.Swagger -{ - public class SwaggerGeneratorOptions - { - public SwaggerGeneratorOptions( - Func versionSupportResolver = null, - IEnumerable schemes = null, - IDictionary securityDefinitions = null, - bool ignoreObsoleteActions = false, - Func groupingKeySelector = null, - IComparer groupingKeyComparer = null, - IDictionary> customSchemaMappings = null, - IEnumerable schemaFilters = null, - IEnumerable modelFilters = null, - bool ignoreObsoleteProperties = false, - Func schemaIdSelector = null, - bool describeAllEnumsAsStrings = false, - bool describeStringEnumsInCamelCase = false, - bool applyFiltersToAllSchemas = false, - IEnumerable operationFilters = null, - IEnumerable documentFilters = null, - Func, ApiDescription> conflictingActionsResolver = null - ) - { - VersionSupportResolver = versionSupportResolver; - Schemes = schemes; - SecurityDefinitions = securityDefinitions; - IgnoreObsoleteActions = ignoreObsoleteActions; - GroupingKeySelector = groupingKeySelector ?? DefaultGroupingKeySelector; - GroupingKeyComparer = groupingKeyComparer ?? Comparer.Default; - CustomSchemaMappings = customSchemaMappings ?? new Dictionary>(); - SchemaFilters = schemaFilters ?? new List(); - ModelFilters = modelFilters ?? new List(); - IgnoreObsoleteProperties = ignoreObsoleteProperties; - SchemaIdSelector = schemaIdSelector ?? DefaultSchemaIdSelector; - DescribeAllEnumsAsStrings = describeAllEnumsAsStrings; - DescribeStringEnumsInCamelCase = describeStringEnumsInCamelCase; - ApplyFiltersToAllSchemas = applyFiltersToAllSchemas; - OperationFilters = operationFilters ?? new List(); - DocumentFilters = documentFilters ?? new List(); - ConflictingActionsResolver = conflictingActionsResolver ?? DefaultConflictingActionsResolver; - } - - public Func VersionSupportResolver { get; private set; } - - public IEnumerable Schemes { get; private set; } - - public IDictionary SecurityDefinitions { get; private set; } - - public bool IgnoreObsoleteActions { get; private set; } - - public Func GroupingKeySelector { get; private set; } - - public IComparer GroupingKeyComparer { get; private set; } - - public IDictionary> CustomSchemaMappings { get; private set; } - - public IEnumerable SchemaFilters { get; private set; } - - public IEnumerable ModelFilters { get; private set; } - - public bool IgnoreObsoleteProperties { get; private set; } - - public Func SchemaIdSelector { get; private set; } - - public bool DescribeAllEnumsAsStrings { get; private set; } - - public bool DescribeStringEnumsInCamelCase { get; private set; } - - public bool ApplyFiltersToAllSchemas { get; private set; } - - public IEnumerable OperationFilters { get; private set; } - - public IEnumerable DocumentFilters { get; private set; } - - public Func, ApiDescription> ConflictingActionsResolver { get; private set; } - - private string DefaultGroupingKeySelector(ApiDescription apiDescription) - { - return apiDescription.ActionDescriptor.ControllerDescriptor.ControllerName; - } - - private static string DefaultSchemaIdSelector(Type type) - { - return type.FriendlyId(); - } - - private ApiDescription DefaultConflictingActionsResolver(IEnumerable apiDescriptions) - { - var first = apiDescriptions.First(); - throw new NotSupportedException(String.Format( - "Not supported by Swagger 2.0: Multiple operations with path '{0}' and method '{1}'. " + - "See the config setting - \"ResolveConflictingActions\" for a potential workaround", - first.RelativePathSansQueryString(), first.HttpMethod)); - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/TypeExtensions.cs b/Swashbuckle.Core.Lib/Swagger/TypeExtensions.cs deleted file mode 100644 index 8e3ed65fa..000000000 --- a/Swashbuckle.Core.Lib/Swagger/TypeExtensions.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Linq; -using System.Reflection; -using System.Runtime.Serialization; -using System.Text; - -namespace Swashbuckle.Swagger -{ - public static class TypeExtensions - { - public static string FriendlyId(this Type type, bool fullyQualified = false) - { - var typeName = fullyQualified - ? type.FullNameSansTypeParameters().Replace("+", ".") - : type.Name; - - if (type.IsGenericType) - { - var genericArgumentIds = type.GetGenericArguments() - .Select(t => t.FriendlyId(fullyQualified)) - .ToArray(); - - return new StringBuilder(typeName) - .Replace(string.Format("`{0}", genericArgumentIds.Count()), string.Empty) - .Append(string.Format("[{0}]", string.Join(",", genericArgumentIds).TrimEnd(','))) - .ToString(); - } - - return typeName; - } - - public static string FullNameSansTypeParameters(this Type type) - { - var fullName = type.FullName; - if (string.IsNullOrEmpty(fullName)) - fullName = type.Name; - var chopIndex = fullName.IndexOf("[["); - return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); - } - - public static string[] GetEnumNamesForSerialization(this Type enumType) - { - return enumType.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static) - .Select(fieldInfo => - { - var memberAttribute = fieldInfo.GetCustomAttributes(false).OfType().FirstOrDefault(); - return (memberAttribute == null || string.IsNullOrWhiteSpace(memberAttribute.Value)) - ? fieldInfo.Name - : memberAttribute.Value; - }) - .ToArray(); - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/XmlComments/ApplyXmlActionComments.cs b/Swashbuckle.Core.Lib/Swagger/XmlComments/ApplyXmlActionComments.cs deleted file mode 100644 index eb9d812bb..000000000 --- a/Swashbuckle.Core.Lib/Swagger/XmlComments/ApplyXmlActionComments.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System.Linq; -using System.Reflection; -using System.Web.Http; -using System.Web.Http.Controllers; -using System.Web.Http.Description; -using System.Xml.XPath; - -namespace Swashbuckle.Swagger.XmlComments -{ - public class ApplyXmlActionComments : IOperationFilter - { - private const string MemberXPath = "/doc/members/member[@name='{0}']"; - private const string SummaryXPath = "summary"; - private const string RemarksXPath = "remarks"; - private const string ParamXPath = "param[@name='{0}']"; - private const string ResponseXPath = "response"; - - private readonly XPathDocument _xmlDoc; - - public ApplyXmlActionComments(string filePath) - : this(new XPathDocument(filePath)) { } - - public ApplyXmlActionComments(XPathDocument xmlDoc) - { - _xmlDoc = xmlDoc; - } - - public void Apply(Operation operation, SchemaRegistry schemaRegistry, ApiDescription apiDescription) - { - var reflectedActionDescriptor = apiDescription.ActionDescriptor as ReflectedHttpActionDescriptor; - if (reflectedActionDescriptor == null) return; - - XPathNavigator navigator; - lock (_xmlDoc) - { - navigator = _xmlDoc.CreateNavigator(); - } - - var commentId = XmlCommentsIdHelper.GetCommentIdForMethod(reflectedActionDescriptor.MethodInfo); - var methodNode = navigator.SelectSingleNode(string.Format(MemberXPath, commentId)); - if (methodNode == null) return; - - var summaryNode = methodNode.SelectSingleNode(SummaryXPath); - if (summaryNode != null) - operation.summary = summaryNode.ExtractContent(); - - var remarksNode = methodNode.SelectSingleNode(RemarksXPath); - if (remarksNode != null) - operation.description = remarksNode.ExtractContent(); - - ApplyParamComments(operation, methodNode, reflectedActionDescriptor.MethodInfo); - - ApplyResponseComments(operation, methodNode); - } - - private static void ApplyParamComments(Operation operation, XPathNavigator methodNode, MethodInfo method) - { - if (operation.parameters == null) return; - - foreach (var parameter in operation.parameters) - { - // Inspect method to find the corresponding action parameter - // NOTE: If a parameter binding is present (e.g. [FromUri(Name..)]), then the lookup needs - // to be against the "bound" name and not the actual parameter name - var actionParameter = method.GetParameters() - .FirstOrDefault(paramInfo => - HasBoundName(paramInfo, parameter.name) || paramInfo.Name == parameter.name - ); - if (actionParameter == null) continue; - - var paramNode = methodNode.SelectSingleNode(string.Format(ParamXPath, actionParameter.Name)); - if (paramNode != null) - parameter.description = paramNode.ExtractContent(); - } - } - - private static void ApplyResponseComments(Operation operation, XPathNavigator methodNode) - { - var responseNodes = methodNode.Select(ResponseXPath); - - if (responseNodes.Count > 0) - { - var successResponse = operation.responses.First().Value; - operation.responses.Clear(); - - while (responseNodes.MoveNext()) - { - var statusCode = responseNodes.Current.GetAttribute("code", ""); - var description = responseNodes.Current.ExtractContent(); - - var response = new Response - { - description = description, - schema = statusCode.StartsWith("2") ? successResponse.schema : null - }; - operation.responses[statusCode] = response; - } - } - } - - private static bool HasBoundName(ParameterInfo paramInfo, string name) - { - var fromUriAttribute = paramInfo.GetCustomAttributes(false) - .OfType() - .FirstOrDefault(); - - return (fromUriAttribute != null && fromUriAttribute.Name == name); - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/XmlComments/ApplyXmlTypeComments.cs b/Swashbuckle.Core.Lib/Swagger/XmlComments/ApplyXmlTypeComments.cs deleted file mode 100644 index feb73d510..000000000 --- a/Swashbuckle.Core.Lib/Swagger/XmlComments/ApplyXmlTypeComments.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Reflection; -using System.Xml.XPath; - -namespace Swashbuckle.Swagger.XmlComments -{ - public class ApplyXmlTypeComments : IModelFilter - { - private const string MemberXPath = "/doc/members/member[@name='{0}']"; - private const string SummaryTag = "summary"; - - private readonly XPathDocument _xmlDoc; - - public ApplyXmlTypeComments(string filePath) - : this(new XPathDocument(filePath)) { } - - public ApplyXmlTypeComments(XPathDocument xmlDoc) - { - _xmlDoc = xmlDoc; - } - - public void Apply(Schema model, ModelFilterContext context) - { - XPathNavigator navigator; - lock (_xmlDoc) - { - navigator = _xmlDoc.CreateNavigator(); - } - - var commentId = XmlCommentsIdHelper.GetCommentIdForType(context.SystemType); - var typeNode = navigator.SelectSingleNode(string.Format(MemberXPath, commentId)); - - if (typeNode != null) - { - var summaryNode = typeNode.SelectSingleNode(SummaryTag); - if (summaryNode != null) - model.description = summaryNode.ExtractContent(); - } - - if (model.properties != null) - { - foreach (var entry in model.properties) - { - var jsonProperty = context.JsonObjectContract.Properties[entry.Key]; - if (jsonProperty == null) continue; - - ApplyPropertyComments(navigator, entry.Value, jsonProperty.PropertyInfo()); - } - } - } - - private static void ApplyPropertyComments(XPathNavigator navigator, Schema propertySchema, PropertyInfo propertyInfo) - { - if (propertyInfo == null) return; - - var commentId = XmlCommentsIdHelper.GetCommentIdForProperty(propertyInfo); - var propertyNode = navigator.SelectSingleNode(string.Format(MemberXPath, commentId)); - if (propertyNode == null) return; - - var propSummaryNode = propertyNode.SelectSingleNode(SummaryTag); - if (propSummaryNode != null) - { - propertySchema.description = propSummaryNode.ExtractContent(); - } - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/Swagger/XmlComments/XPathNavigatorExtensions.cs b/Swashbuckle.Core.Lib/Swagger/XmlComments/XPathNavigatorExtensions.cs deleted file mode 100644 index 5ba9aeb7e..000000000 --- a/Swashbuckle.Core.Lib/Swagger/XmlComments/XPathNavigatorExtensions.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Xml; -using System.Xml.XPath; - -namespace Swashbuckle.Swagger.XmlComments -{ - public static class XPathNavigatorExtensions - { - private static Regex ParamPattern = new Regex(@"<(see|paramref) (name|cref)=""([TPF]{1}:)?(?.+?)"" />"); - private static Regex ConstPattern = new Regex(@"(?.+?)"); - - public static string ExtractContent(this XPathNavigator node) - { - if (node == null) return null; - - return XmlTextHelper.NormalizeIndentation( - ConstPattern.Replace( - ParamPattern.Replace(node.InnerXml, GetParamRefName), - GetConstRefName) - ); - } - - private static string GetConstRefName(Match match) - { - if (match.Groups.Count != 2) return null; - - return match.Groups["display"].Value; - } - - private static string GetParamRefName(Match match) - { - if (match.Groups.Count != 5) return null; - - return "{" + match.Groups["display"].Value + "}"; - } - } -} diff --git a/Swashbuckle.Core.Lib/Swagger/XmlComments/XmlCommentsIdHelper.cs b/Swashbuckle.Core.Lib/Swagger/XmlComments/XmlCommentsIdHelper.cs deleted file mode 100644 index 975ce4b20..000000000 --- a/Swashbuckle.Core.Lib/Swagger/XmlComments/XmlCommentsIdHelper.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.Reflection; -using System.Text; - -namespace Swashbuckle.Swagger.XmlComments -{ - public class XmlCommentsIdHelper - { - public static string GetCommentIdForMethod(MethodInfo methodInfo) - { - var builder = new StringBuilder("M:"); - AppendFullTypeName(methodInfo.DeclaringType, builder); - builder.Append("."); - AppendMethodName(methodInfo, builder); - - return builder.ToString(); - } - - public static string GetCommentIdForType(Type type) - { - var builder = new StringBuilder("T:"); - AppendFullTypeName(type, builder, expandGenericArgs: false); - - return builder.ToString(); - } - - public static string GetCommentIdForProperty(PropertyInfo propertyInfo) - { - var builder = new StringBuilder("P:"); - AppendFullTypeName(propertyInfo.DeclaringType, builder); - builder.Append("."); - AppendPropertyName(propertyInfo, builder); - - return builder.ToString(); - } - - private static void AppendFullTypeName(Type type, StringBuilder builder, bool expandGenericArgs = false) - { - if (type.Namespace != null) - { - builder.Append(type.Namespace); - builder.Append("."); - } - AppendTypeName(type, builder, expandGenericArgs); - } - - private static void AppendTypeName(Type type, StringBuilder builder, bool expandGenericArgs) - { - if (type.IsNested) - { - AppendTypeName(type.DeclaringType, builder, false); - builder.Append("."); - } - - builder.Append(type.Name); - - if (expandGenericArgs) - ExpandGenericArgsIfAny(type, builder); - } - - public static void ExpandGenericArgsIfAny(Type type, StringBuilder builder) - { - if (type.IsGenericType) - { - var genericArgsBuilder = new StringBuilder("{"); - - var genericArgs = type.GetGenericArguments(); - foreach (var argType in genericArgs) - { - AppendFullTypeName(argType, genericArgsBuilder, true); - genericArgsBuilder.Append(","); - } - genericArgsBuilder.Replace(",", "}", genericArgsBuilder.Length - 1, 1); - - builder.Replace(string.Format("`{0}", genericArgs.Length), genericArgsBuilder.ToString()); - } - else if (type.IsArray) - ExpandGenericArgsIfAny(type.GetElementType(), builder); - } - - private static void AppendMethodName(MethodInfo methodInfo, StringBuilder builder) - { - builder.Append(methodInfo.Name); - - var parameters = methodInfo.GetParameters(); - if (parameters.Length == 0) return; - - builder.Append("("); - foreach (var param in parameters) - { - AppendFullTypeName(param.ParameterType, builder, true); - builder.Append(","); - } - builder.Replace(",", ")", builder.Length - 1, 1); - } - - private static void AppendPropertyName(PropertyInfo propertyInfo, StringBuilder builder) - { - builder.Append(propertyInfo.Name); - } - } -} diff --git a/Swashbuckle.Core.Lib/Swagger/XmlComments/XmlTextHelper.cs b/Swashbuckle.Core.Lib/Swagger/XmlComments/XmlTextHelper.cs deleted file mode 100644 index 98f13c790..000000000 --- a/Swashbuckle.Core.Lib/Swagger/XmlComments/XmlTextHelper.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Swashbuckle.Swagger.XmlComments -{ - public static class XmlTextHelper - { - /// - /// Messages text from an XML node produced by Visual Studio into a plainer plain text (leading whitespace normalized) - /// - /// The content of an XML node - could contain other XML elements within the string - /// - public static string NormalizeIndentation(string xmlText) - { - if (null == xmlText) - throw new ArgumentNullException("xmlText"); - - string[] lines = xmlText.Split('\n'); - string padding = GetCommonLeadingWhitespace(lines); - - int padLen = padding == null ? 0 : padding.Length; - - // remove leading padding from each line - for (int i = 0, l = lines.Length; i < l; ++i) - { - string line = lines[i].TrimEnd('\r'); // remove trailing '\r' - - if (padLen != 0 && line.Length >= padLen && line.Substring(0, padLen) == padding) - line = line.Substring(padLen); - - lines[i] = line; - } - - // remove leading empty lines, but not all leading padding - // remove all trailing whitespace, regardless - return string.Join("\r\n", lines.SkipWhile(x => string.IsNullOrWhiteSpace(x))).TrimEnd(); - } - - /// - /// Finds the common padding prefix used on all non-empty lines. - /// - /// - /// The common padding found on all non-blank lines - returns null when no common prefix is found - static string GetCommonLeadingWhitespace(string[] lines) - { - if (null == lines) - throw new ArgumentException("lines"); - - if (lines.Length == 0) - return null; - - string[] nonEmptyLines = lines - .Where(x => !string.IsNullOrWhiteSpace(x)) - .ToArray(); - - if (nonEmptyLines.Length < 1) - return null; - - int padLen = 0; - - // use the first line as a seed, and see what is shared over all nonEmptyLines - string seed = nonEmptyLines[0]; - for (int i = 0, l = seed.Length; i < l; ++i) - { - if (!char.IsWhiteSpace(seed, i)) - break; - - if (nonEmptyLines.Any(line => line[i] != seed[i])) - break; - - ++padLen; - } - - if (padLen > 0) - return seed.Substring(0, padLen); - - return null; - } - } -} diff --git a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/discoveryUrlSelector.js b/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/discoveryUrlSelector.js deleted file mode 100644 index 930dd6157..000000000 --- a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/discoveryUrlSelector.js +++ /dev/null @@ -1,33 +0,0 @@ -(function () { - var DiscoveryUrlSelector = Backbone.View.extend({ - render: function() { - // Don't re-render on subsequent reloads - var defaultVal = this.$el.val() - if (this.$el.prop('tagName') != 'SELECT') { - var select = $(''); - select - .css('margin', '0') - .css('border', '1px solid gray') - .css('padding', '3px') - .css('width', '400px') - .css('font-size', '0.9em'); - - var rootUrl = this.options.rootUrl; - _.each(this.options.discoveryPaths, function(path) { - var option = $(''); - select.append(option); - }); - - select.val(defaultVal); - this.$el.replaceWith(select); - } - return this; - } - }); - - new DiscoveryUrlSelector({ - el: $('#input_baseUrl'), - rootUrl: swashbuckleConfig.rootUrl, - discoveryPaths: swashbuckleConfig.discoveryPaths - }).render(); -})(); \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/index.html b/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/index.html deleted file mode 100644 index 9a60cdc98..000000000 --- a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/index.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - %(DocumentTitle) - - - - - - - - %(StylesheetIncludes) - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
-
- - diff --git a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/screen.css b/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/screen.css deleted file mode 100644 index 8280c3597..000000000 --- a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/screen.css +++ /dev/null @@ -1,1494 +0,0 @@ -/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ -.swagger-section pre code { - display: block; - padding: 0.5em; - background: #F0F0F0; -} -.swagger-section pre code, -.swagger-section pre .subst, -.swagger-section pre .tag .title, -.swagger-section pre .lisp .title, -.swagger-section pre .clojure .built_in, -.swagger-section pre .nginx .title { - color: black; -} -.swagger-section pre .string, -.swagger-section pre .title, -.swagger-section pre .constant, -.swagger-section pre .parent, -.swagger-section pre .tag .value, -.swagger-section pre .rules .value, -.swagger-section pre .rules .value .number, -.swagger-section pre .preprocessor, -.swagger-section pre .ruby .symbol, -.swagger-section pre .ruby .symbol .string, -.swagger-section pre .aggregate, -.swagger-section pre .template_tag, -.swagger-section pre .django .variable, -.swagger-section pre .smalltalk .class, -.swagger-section pre .addition, -.swagger-section pre .flow, -.swagger-section pre .stream, -.swagger-section pre .bash .variable, -.swagger-section pre .apache .tag, -.swagger-section pre .apache .cbracket, -.swagger-section pre .tex .command, -.swagger-section pre .tex .special, -.swagger-section pre .erlang_repl .function_or_atom, -.swagger-section pre .markdown .header { - color: #800; -} -.swagger-section pre .comment, -.swagger-section pre .annotation, -.swagger-section pre .template_comment, -.swagger-section pre .diff .header, -.swagger-section pre .chunk, -.swagger-section pre .markdown .blockquote { - color: #888; -} -.swagger-section pre .number, -.swagger-section pre .date, -.swagger-section pre .regexp, -.swagger-section pre .literal, -.swagger-section pre .smalltalk .symbol, -.swagger-section pre .smalltalk .char, -.swagger-section pre .go .constant, -.swagger-section pre .change, -.swagger-section pre .markdown .bullet, -.swagger-section pre .markdown .link_url { - color: #080; -} -.swagger-section pre .label, -.swagger-section pre .javadoc, -.swagger-section pre .ruby .string, -.swagger-section pre .decorator, -.swagger-section pre .filter .argument, -.swagger-section pre .localvars, -.swagger-section pre .array, -.swagger-section pre .attr_selector, -.swagger-section pre .important, -.swagger-section pre .pseudo, -.swagger-section pre .pi, -.swagger-section pre .doctype, -.swagger-section pre .deletion, -.swagger-section pre .envvar, -.swagger-section pre .shebang, -.swagger-section pre .apache .sqbracket, -.swagger-section pre .nginx .built_in, -.swagger-section pre .tex .formula, -.swagger-section pre .erlang_repl .reserved, -.swagger-section pre .prompt, -.swagger-section pre .markdown .link_label, -.swagger-section pre .vhdl .attribute, -.swagger-section pre .clojure .attribute, -.swagger-section pre .coffeescript .property { - color: #88F; -} -.swagger-section pre .keyword, -.swagger-section pre .id, -.swagger-section pre .phpdoc, -.swagger-section pre .title, -.swagger-section pre .built_in, -.swagger-section pre .aggregate, -.swagger-section pre .css .tag, -.swagger-section pre .javadoctag, -.swagger-section pre .phpdoc, -.swagger-section pre .yardoctag, -.swagger-section pre .smalltalk .class, -.swagger-section pre .winutils, -.swagger-section pre .bash .variable, -.swagger-section pre .apache .tag, -.swagger-section pre .go .typename, -.swagger-section pre .tex .command, -.swagger-section pre .markdown .strong, -.swagger-section pre .request, -.swagger-section pre .status { - font-weight: bold; -} -.swagger-section pre .markdown .emphasis { - font-style: italic; -} -.swagger-section pre .nginx .built_in { - font-weight: normal; -} -.swagger-section pre .coffeescript .javascript, -.swagger-section pre .javascript .xml, -.swagger-section pre .tex .formula, -.swagger-section pre .xml .javascript, -.swagger-section pre .xml .vbscript, -.swagger-section pre .xml .css, -.swagger-section pre .xml .cdata { - opacity: 0.5; -} -.swagger-section .hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - background: #F0F0F0; -} -.swagger-section .hljs, -.swagger-section .hljs-subst { - color: #444; -} -.swagger-section .hljs-keyword, -.swagger-section .hljs-attribute, -.swagger-section .hljs-selector-tag, -.swagger-section .hljs-meta-keyword, -.swagger-section .hljs-doctag, -.swagger-section .hljs-name { - font-weight: bold; -} -.swagger-section .hljs-built_in, -.swagger-section .hljs-literal, -.swagger-section .hljs-bullet, -.swagger-section .hljs-code, -.swagger-section .hljs-addition { - color: #1F811F; -} -.swagger-section .hljs-regexp, -.swagger-section .hljs-symbol, -.swagger-section .hljs-variable, -.swagger-section .hljs-template-variable, -.swagger-section .hljs-link, -.swagger-section .hljs-selector-attr, -.swagger-section .hljs-selector-pseudo { - color: #BC6060; -} -.swagger-section .hljs-type, -.swagger-section .hljs-string, -.swagger-section .hljs-number, -.swagger-section .hljs-selector-id, -.swagger-section .hljs-selector-class, -.swagger-section .hljs-quote, -.swagger-section .hljs-template-tag, -.swagger-section .hljs-deletion { - color: #880000; -} -.swagger-section .hljs-title, -.swagger-section .hljs-section { - color: #880000; - font-weight: bold; -} -.swagger-section .hljs-comment { - color: #888888; -} -.swagger-section .hljs-meta { - color: #2B6EA1; -} -.swagger-section .hljs-emphasis { - font-style: italic; -} -.swagger-section .hljs-strong { - font-weight: bold; -} -.swagger-section .swagger-ui-wrap { - line-height: 1; - font-family: "Droid Sans", sans-serif; - min-width: 760px; - max-width: 960px; - margin-left: auto; - margin-right: auto; - /* JSONEditor specific styling */ -} -.swagger-section .swagger-ui-wrap b, -.swagger-section .swagger-ui-wrap strong { - font-family: "Droid Sans", sans-serif; - font-weight: bold; -} -.swagger-section .swagger-ui-wrap q, -.swagger-section .swagger-ui-wrap blockquote { - quotes: none; -} -.swagger-section .swagger-ui-wrap p { - line-height: 1.4em; - padding: 0 0 10px; - color: #333333; -} -.swagger-section .swagger-ui-wrap q:before, -.swagger-section .swagger-ui-wrap q:after, -.swagger-section .swagger-ui-wrap blockquote:before, -.swagger-section .swagger-ui-wrap blockquote:after { - content: none; -} -.swagger-section .swagger-ui-wrap .heading_with_menu h1, -.swagger-section .swagger-ui-wrap .heading_with_menu h2, -.swagger-section .swagger-ui-wrap .heading_with_menu h3, -.swagger-section .swagger-ui-wrap .heading_with_menu h4, -.swagger-section .swagger-ui-wrap .heading_with_menu h5, -.swagger-section .swagger-ui-wrap .heading_with_menu h6 { - display: block; - clear: none; - float: left; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - width: 60%; -} -.swagger-section .swagger-ui-wrap table { - border-collapse: collapse; - border-spacing: 0; -} -.swagger-section .swagger-ui-wrap table thead tr th { - padding: 5px; - font-size: 0.9em; - color: #666666; - border-bottom: 1px solid #999999; -} -.swagger-section .swagger-ui-wrap table tbody tr:last-child td { - border-bottom: none; -} -.swagger-section .swagger-ui-wrap table tbody tr.offset { - background-color: #f0f0f0; -} -.swagger-section .swagger-ui-wrap table tbody tr td { - padding: 6px; - font-size: 0.9em; - border-bottom: 1px solid #cccccc; - vertical-align: top; - line-height: 1.3em; -} -.swagger-section .swagger-ui-wrap ol { - margin: 0px 0 10px; - padding: 0 0 0 18px; - list-style-type: decimal; -} -.swagger-section .swagger-ui-wrap ol li { - padding: 5px 0px; - font-size: 0.9em; - color: #333333; -} -.swagger-section .swagger-ui-wrap ol, -.swagger-section .swagger-ui-wrap ul { - list-style: none; -} -.swagger-section .swagger-ui-wrap h1 a, -.swagger-section .swagger-ui-wrap h2 a, -.swagger-section .swagger-ui-wrap h3 a, -.swagger-section .swagger-ui-wrap h4 a, -.swagger-section .swagger-ui-wrap h5 a, -.swagger-section .swagger-ui-wrap h6 a { - text-decoration: none; -} -.swagger-section .swagger-ui-wrap h1 a:hover, -.swagger-section .swagger-ui-wrap h2 a:hover, -.swagger-section .swagger-ui-wrap h3 a:hover, -.swagger-section .swagger-ui-wrap h4 a:hover, -.swagger-section .swagger-ui-wrap h5 a:hover, -.swagger-section .swagger-ui-wrap h6 a:hover { - text-decoration: underline; -} -.swagger-section .swagger-ui-wrap h1 span.divider, -.swagger-section .swagger-ui-wrap h2 span.divider, -.swagger-section .swagger-ui-wrap h3 span.divider, -.swagger-section .swagger-ui-wrap h4 span.divider, -.swagger-section .swagger-ui-wrap h5 span.divider, -.swagger-section .swagger-ui-wrap h6 span.divider { - color: #aaaaaa; -} -.swagger-section .swagger-ui-wrap a { - color: #547f00; -} -.swagger-section .swagger-ui-wrap a img { - border: none; -} -.swagger-section .swagger-ui-wrap article, -.swagger-section .swagger-ui-wrap aside, -.swagger-section .swagger-ui-wrap details, -.swagger-section .swagger-ui-wrap figcaption, -.swagger-section .swagger-ui-wrap figure, -.swagger-section .swagger-ui-wrap footer, -.swagger-section .swagger-ui-wrap header, -.swagger-section .swagger-ui-wrap hgroup, -.swagger-section .swagger-ui-wrap menu, -.swagger-section .swagger-ui-wrap nav, -.swagger-section .swagger-ui-wrap section, -.swagger-section .swagger-ui-wrap summary { - display: block; -} -.swagger-section .swagger-ui-wrap pre { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - background-color: #fcf6db; - border: 1px solid #e5e0c6; - padding: 10px; -} -.swagger-section .swagger-ui-wrap pre code { - line-height: 1.6em; - background: none; -} -.swagger-section .swagger-ui-wrap .content > .content-type > div > label { - clear: both; - display: block; - color: #0F6AB4; - font-size: 1.1em; - margin: 0; - padding: 15px 0 5px; -} -.swagger-section .swagger-ui-wrap .content pre { - font-size: 12px; - margin-top: 5px; - padding: 5px; -} -.swagger-section .swagger-ui-wrap .icon-btn { - cursor: pointer; -} -.swagger-section .swagger-ui-wrap .info_title { - padding-bottom: 10px; - font-weight: bold; - font-size: 25px; -} -.swagger-section .swagger-ui-wrap .footer { - margin-top: 20px; -} -.swagger-section .swagger-ui-wrap p.big, -.swagger-section .swagger-ui-wrap div.big p { - font-size: 1em; - margin-bottom: 10px; -} -.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, -.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, -.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, -.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { - width: 500px !important; -} -.swagger-section .swagger-ui-wrap .info_license { - padding-bottom: 5px; -} -.swagger-section .swagger-ui-wrap .info_tos { - padding-bottom: 5px; -} -.swagger-section .swagger-ui-wrap .message-fail { - color: #cc0000; -} -.swagger-section .swagger-ui-wrap .info_url { - padding-bottom: 5px; -} -.swagger-section .swagger-ui-wrap .info_email { - padding-bottom: 5px; -} -.swagger-section .swagger-ui-wrap .info_name { - padding-bottom: 5px; -} -.swagger-section .swagger-ui-wrap .info_description { - padding-bottom: 10px; - font-size: 15px; -} -.swagger-section .swagger-ui-wrap .markdown ol li, -.swagger-section .swagger-ui-wrap .markdown ul li { - padding: 3px 0px; - line-height: 1.4em; - color: #333333; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { - display: block; - padding: 4px; - width: auto; - clear: both; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { - font-size: 1.3em; -} -.swagger-section .swagger-ui-wrap table.fullwidth { - width: 100%; -} -.swagger-section .swagger-ui-wrap .model-signature { - font-family: "Droid Sans", sans-serif; - font-size: 1em; - line-height: 1.5em; -} -.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { - text-decoration: none; - color: #AAA; -} -.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { - text-decoration: underline; - color: black; -} -.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { - color: black; - text-decoration: none; -} -.swagger-section .swagger-ui-wrap .model-signature .propType { - color: #5555aa; -} -.swagger-section .swagger-ui-wrap .model-signature pre:hover { - background-color: #ffffdd; -} -.swagger-section .swagger-ui-wrap .model-signature pre { - font-size: .85em; - line-height: 1.2em; - overflow: auto; - max-height: 200px; - cursor: pointer; -} -.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { - display: block; - min-width: 230px; - margin: 0; - padding: 0; -} -.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { - padding-right: 0; - border-right: none; -} -.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { - float: left; - margin: 0 5px 5px 0; - padding: 2px 5px 2px 0; - border-right: 1px solid #ddd; -} -.swagger-section .swagger-ui-wrap .model-signature .propOpt { - color: #555; -} -.swagger-section .swagger-ui-wrap .model-signature .snippet small { - font-size: 0.75em; -} -.swagger-section .swagger-ui-wrap .model-signature .propOptKey { - font-style: italic; -} -.swagger-section .swagger-ui-wrap .model-signature .description .strong { - font-weight: bold; - color: #000; - font-size: .9em; -} -.swagger-section .swagger-ui-wrap .model-signature .description div { - font-size: 0.9em; - line-height: 1.5em; - margin-left: 1em; -} -.swagger-section .swagger-ui-wrap .model-signature .description .stronger { - font-weight: bold; - color: #000; -} -.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { - border-spacing: 0; - position: absolute; - background-color: #ffffff; - border: 1px solid #bbbbbb; - display: none; - font-size: 11px; - max-width: 400px; - line-height: 30px; - color: black; - padding: 5px; - margin-left: 10px; -} -.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { - text-align: center; - background-color: #eeeeee; - border: 1px solid #bbbbbb; - font-size: 11px; - color: #666666; - font-weight: bold; - padding: 5px; - line-height: 15px; -} -.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { - font-weight: bold; -} -.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, -.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { - display: inline; -} -.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { - display: block; - content: ''; -} -.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { - margin-right: -3px; -} -.swagger-section .swagger-ui-wrap .model-signature .propName { - font-weight: bold; -} -.swagger-section .swagger-ui-wrap .model-signature .signature-container { - clear: both; -} -.swagger-section .swagger-ui-wrap .body-textarea { - width: 300px; - height: 100px; - border: 1px solid #aaa; -} -.swagger-section .swagger-ui-wrap .markdown p code, -.swagger-section .swagger-ui-wrap .markdown li code { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - background-color: #f0f0f0; - color: black; - padding: 1px 3px; -} -.swagger-section .swagger-ui-wrap .required { - font-weight: bold; -} -.swagger-section .swagger-ui-wrap .editor_holder { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - font-size: 0.9em; -} -.swagger-section .swagger-ui-wrap .editor_holder label { - font-weight: normal!important; - /* JSONEditor uses bold by default for all labels, we revert that back to normal to not give the impression that by default fields are required */ -} -.swagger-section .swagger-ui-wrap .editor_holder label.required { - font-weight: bold!important; -} -.swagger-section .swagger-ui-wrap input.parameter { - width: 300px; - border: 1px solid #aaa; -} -.swagger-section .swagger-ui-wrap h1 { - color: black; - font-size: 1.5em; - line-height: 1.3em; - padding: 10px 0 10px 0; - font-family: "Droid Sans", sans-serif; - font-weight: bold; -} -.swagger-section .swagger-ui-wrap .heading_with_menu { - float: none; - clear: both; - overflow: hidden; - display: block; -} -.swagger-section .swagger-ui-wrap .heading_with_menu ul { - display: block; - clear: none; - float: right; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - -ms-box-sizing: border-box; - box-sizing: border-box; - margin-top: 10px; -} -.swagger-section .swagger-ui-wrap h2 { - color: black; - font-size: 1.3em; - padding: 10px 0 10px 0; -} -.swagger-section .swagger-ui-wrap h2 a { - color: black; -} -.swagger-section .swagger-ui-wrap h2 span.sub { - font-size: 0.7em; - color: #999999; - font-style: italic; -} -.swagger-section .swagger-ui-wrap h2 span.sub a { - color: #777777; -} -.swagger-section .swagger-ui-wrap span.weak { - color: #666666; -} -.swagger-section .swagger-ui-wrap .message-success { - color: #89BF04; -} -.swagger-section .swagger-ui-wrap caption, -.swagger-section .swagger-ui-wrap th, -.swagger-section .swagger-ui-wrap td { - text-align: left; - font-weight: normal; - vertical-align: middle; -} -.swagger-section .swagger-ui-wrap .code { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { - font-family: "Droid Sans", sans-serif; - height: 250px; - padding: 4px; - display: block; - clear: both; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { - display: block; - clear: both; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { - float: none; - clear: both; - overflow: hidden; - display: block; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { - display: block; - float: left; - clear: none; - margin: 0; - padding: 0; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { - display: block; - float: left; - clear: none; - margin: 0 5px 0 0; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { - color: black; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { - display: block; - clear: both; - width: auto; - padding: 0 0 3px; - color: #666666; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { - padding-left: 3px; - color: #888888; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { - margin-left: 0; - font-style: italic; - font-size: 0.9em; - margin: 0; -} -.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { - margin: 0; - padding: 0; -} -.swagger-section .swagger-ui-wrap span.blank, -.swagger-section .swagger-ui-wrap span.empty { - color: #888888; - font-style: italic; -} -.swagger-section .swagger-ui-wrap .markdown h3 { - color: #547f00; -} -.swagger-section .swagger-ui-wrap .markdown h4 { - color: #666666; -} -.swagger-section .swagger-ui-wrap .markdown pre { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - background-color: #fcf6db; - border: 1px solid #e5e0c6; - padding: 10px; - margin: 0 0 10px 0; -} -.swagger-section .swagger-ui-wrap .markdown pre code { - line-height: 1.6em; - overflow: auto; -} -.swagger-section .swagger-ui-wrap div.gist { - margin: 20px 0 25px 0 !important; -} -.swagger-section .swagger-ui-wrap ul#resources { - font-family: "Droid Sans", sans-serif; - font-size: 0.9em; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource { - border-bottom: 1px solid #dddddd; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, -.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { - color: black; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, -.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { - color: #555555; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { - border-bottom: none; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { - border: 1px solid transparent; - float: none; - clear: both; - overflow: hidden; - display: block; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { - overflow: hidden; - padding: 0; - display: block; - clear: none; - float: right; - margin: 14px 10px 0 0; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { - float: left; - clear: none; - margin: 0; - padding: 2px 10px; - border-right: 1px solid #dddddd; - color: #666666; - font-size: 0.9em; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { - color: #aaaaaa; - text-decoration: none; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { - text-decoration: underline; - color: black; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { - text-decoration: underline; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { - padding-left: 0; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { - padding-right: 0; - border-right: none; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { - padding-left: 0; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { - color: #999999; - padding-left: 0; - display: block; - clear: none; - float: left; - font-family: "Droid Sans", sans-serif; - font-weight: bold; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { - color: #999999; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { - color: black; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { - float: none; - clear: both; - overflow: hidden; - display: block; - margin: 0 0 10px; - padding: 0; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { - float: none; - clear: both; - overflow: hidden; - display: block; - margin: 0; - padding: 0; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { - display: block; - clear: none; - float: left; - width: auto; - margin: 0; - padding: 0; - line-height: 1.1em; - color: black; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { - padding-left: 10px; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { - color: black; - text-decoration: none; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated { - text-decoration: line-through; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { - text-decoration: underline; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { - text-transform: uppercase; - text-decoration: none; - color: white; - display: inline-block; - width: 50px; - font-size: 0.7em; - text-align: center; - padding: 7px 0 4px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; - -o-border-radius: 2px; - -ms-border-radius: 2px; - -khtml-border-radius: 2px; - border-radius: 2px; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { - margin: 0; - padding: 0; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { - overflow: hidden; - padding: 0; - display: block; - clear: none; - float: right; - margin: 6px 10px 0 0; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { - float: left; - clear: none; - margin: 0; - padding: 2px 10px; - font-size: 0.9em; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { - text-decoration: none; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a .markdown p { - color: inherit; - padding: 0; - line-height: inherit; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { - color: black; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { - border-top: none; - padding: 10px; - -moz-border-radius-bottomleft: 6px; - -webkit-border-bottom-left-radius: 6px; - -o-border-bottom-left-radius: 6px; - -ms-border-bottom-left-radius: 6px; - -khtml-border-bottom-left-radius: 6px; - border-bottom-left-radius: 6px; - -moz-border-radius-bottomright: 6px; - -webkit-border-bottom-right-radius: 6px; - -o-border-bottom-right-radius: 6px; - -ms-border-bottom-right-radius: 6px; - -khtml-border-bottom-right-radius: 6px; - border-bottom-right-radius: 6px; - margin: 0 0 20px; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { - font-size: 1.1em; - margin: 0; - padding: 15px 0 5px; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { - float: none; - clear: both; - overflow: hidden; - display: block; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { - padding: 4px 0 0 10px; - display: inline-block; - font-size: 0.9em; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { - display: block; - clear: none; - float: left; - padding: 6px 8px; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { - background-image: url('../images/throbber-gif'); - width: 128px; - height: 16px; - display: block; - clear: none; - float: right; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { - outline: 2px solid black; - outline-color: #cc0000; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form select[name='parameterContentType'] { - max-width: 300px; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { - font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; - padding: 10px; - font-size: 0.9em; - max-height: 400px; - overflow-y: auto; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { - background-color: #f9f2e9; - border: 1px solid #f0e0ca; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { - background-color: #c5862b; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #f0e0ca; - color: #c5862b; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { - color: #c5862b; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { - background-color: #faf5ee; - border: 1px solid #f0e0ca; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { - color: #c5862b; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { - color: #dcb67f; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { - background-color: #fcffcd; - border: 1px solid black; - border-color: #ffd20f; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { - text-transform: uppercase; - background-color: #ffd20f; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #ffd20f; - color: #ffd20f; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { - color: #ffd20f; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { - background-color: #fcffcd; - border: 1px solid black; - border-color: #ffd20f; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { - color: #ffd20f; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { - color: #6fc992; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { - background-color: #f5e8e8; - border: 1px solid #e8c6c7; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { - text-transform: uppercase; - background-color: #a41e22; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #e8c6c7; - color: #a41e22; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { - color: #a41e22; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { - background-color: #f7eded; - border: 1px solid #e8c6c7; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { - color: #a41e22; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { - color: #c8787a; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { - background-color: #e7f6ec; - border: 1px solid #c3e8d1; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { - background-color: #10a54a; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #c3e8d1; - color: #10a54a; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { - color: #10a54a; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { - background-color: #ebf7f0; - border: 1px solid #c3e8d1; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { - color: #10a54a; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { - color: #6fc992; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { - background-color: #FCE9E3; - border: 1px solid #F5D5C3; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { - background-color: #D38042; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #f0cecb; - color: #D38042; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { - color: #D38042; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { - background-color: #faf0ef; - border: 1px solid #f0cecb; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { - color: #D38042; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { - color: #dcb67f; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { - background-color: #e7f0f7; - border: 1px solid #c3d9ec; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { - background-color: #0f6ab4; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #c3d9ec; - color: #0f6ab4; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { - color: #0f6ab4; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { - background-color: #ebf3f9; - border: 1px solid #c3d9ec; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { - color: #0f6ab4; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { - color: #6fa5d2; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { - background-color: #e7f0f7; - border: 1px solid #c3d9ec; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { - background-color: #0f6ab4; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { - border-right: 1px solid #dddddd; - border-right-color: #c3d9ec; - color: #0f6ab4; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { - color: #0f6ab4; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { - background-color: #ebf3f9; - border: 1px solid #c3d9ec; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { - color: #0f6ab4; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { - color: #6fa5d2; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { - border-top: none; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { - padding-right: 0; - border-right: none; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { - text-decoration: underline; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { - padding-left: 0; -} -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, -.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { - padding-left: 0; -} -.swagger-section .swagger-ui-wrap p#colophon { - margin: 0 15px 40px 15px; - padding: 10px 0; - font-size: 0.8em; - border-top: 1px solid #dddddd; - font-family: "Droid Sans", sans-serif; - color: #999999; - font-style: italic; -} -.swagger-section .swagger-ui-wrap p#colophon a { - text-decoration: none; - color: #547f00; -} -.swagger-section .swagger-ui-wrap h3 { - color: black; - font-size: 1.1em; - padding: 10px 0 10px 0; -} -.swagger-section .swagger-ui-wrap .markdown ol, -.swagger-section .swagger-ui-wrap .markdown ul { - font-family: "Droid Sans", sans-serif; - margin: 5px 0 10px; - padding: 0 0 0 18px; - list-style-type: disc; -} -.swagger-section .swagger-ui-wrap form.form_box { - background-color: #ebf3f9; - border: 1px solid #c3d9ec; - padding: 10px; -} -.swagger-section .swagger-ui-wrap form.form_box label { - color: #0f6ab4 !important; -} -.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { - display: block; - padding: 10px; -} -.swagger-section .swagger-ui-wrap form.form_box p.weak { - font-size: 0.8em; -} -.swagger-section .swagger-ui-wrap form.form_box p { - font-size: 0.9em; - padding: 0 0 15px; - color: #7e7b6d; -} -.swagger-section .swagger-ui-wrap form.form_box p a { - color: #646257; -} -.swagger-section .swagger-ui-wrap form.form_box p strong { - color: black; -} -.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { - padding-bottom: 0; -} -.swagger-section .title { - font-style: bold; -} -.swagger-section .secondary_form { - display: none; -} -.swagger-section .main_image { - display: block; - margin-left: auto; - margin-right: auto; -} -.swagger-section .oauth_body { - margin-left: 100px; - margin-right: 100px; -} -.swagger-section .oauth_submit { - text-align: center; - display: inline-block; -} -.swagger-section .authorize-wrapper { - margin: 15px 0 10px; -} -.swagger-section .authorize-wrapper_operation { - float: right; -} -.swagger-section .authorize__btn:hover { - text-decoration: underline; - cursor: pointer; -} -.swagger-section .authorize__btn_operation:hover .authorize-scopes { - display: block; -} -.swagger-section .authorize-scopes { - position: absolute; - margin-top: 20px; - background: #FFF; - border: 1px solid #ccc; - border-radius: 5px; - display: none; - font-size: 13px; - max-width: 300px; - line-height: 30px; - color: black; - padding: 5px; -} -.swagger-section .authorize-scopes .authorize__scope { - text-decoration: none; -} -.swagger-section .authorize__btn_operation { - height: 18px; - vertical-align: middle; - display: inline-block; - background: url(../images/explorer_icons-png) no-repeat; -} -.swagger-section .authorize__btn_operation_login { - background-position: 0 0; - width: 18px; - margin-top: -6px; - margin-left: 4px; -} -.swagger-section .authorize__btn_operation_logout { - background-position: -30px 0; - width: 18px; - margin-top: -6px; - margin-left: 4px; -} -.swagger-section #auth_container { - color: #fff; - display: inline-block; - border: none; - padding: 5px; - width: 87px; - height: 13px; -} -.swagger-section #auth_container .authorize__btn { - color: #fff; -} -.swagger-section .auth_container { - padding: 0 0 10px; - margin-bottom: 5px; - border-bottom: solid 1px #CCC; - font-size: 0.9em; -} -.swagger-section .auth_container .auth__title { - color: #547f00; - font-size: 1.2em; -} -.swagger-section .auth_container .basic_auth__label { - display: inline-block; - width: 60px; -} -.swagger-section .auth_container .auth__description { - color: #999999; - margin-bottom: 5px; -} -.swagger-section .auth_container .auth__button { - margin-top: 10px; - height: 30px; -} -.swagger-section .auth_container .key_auth__field { - margin: 5px 0; -} -.swagger-section .auth_container .key_auth__label { - display: inline-block; - width: 60px; -} -.swagger-section .api-popup-dialog { - position: absolute; - display: none; -} -.swagger-section .api-popup-dialog-wrapper { - z-index: 1000; - width: 500px; - background: #FFF; - padding: 20px; - border: 1px solid #ccc; - border-radius: 5px; - font-size: 13px; - color: #777; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); -} -.swagger-section .api-popup-dialog-shadow { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - opacity: 0.2; - background-color: gray; - z-index: 900; -} -.swagger-section .api-popup-dialog .api-popup-title { - font-size: 24px; - padding: 10px 0; -} -.swagger-section .api-popup-dialog .api-popup-title { - font-size: 24px; - padding: 10px 0; -} -.swagger-section .api-popup-dialog .error-msg { - padding-left: 5px; - padding-bottom: 5px; -} -.swagger-section .api-popup-dialog .api-popup-content { - max-height: 500px; - overflow-y: auto; -} -.swagger-section .api-popup-dialog .api-popup-authbtn { - height: 30px; -} -.swagger-section .api-popup-dialog .api-popup-cancel { - height: 30px; -} -.swagger-section .api-popup-scopes { - padding: 10px 20px; -} -.swagger-section .api-popup-scopes li { - padding: 5px 0; - line-height: 20px; -} -.swagger-section .api-popup-scopes li input { - position: relative; - top: 2px; -} -.swagger-section .api-popup-scopes .api-scope-desc { - padding-left: 20px; - font-style: italic; -} -.swagger-section .api-popup-actions { - padding-top: 10px; -} -.swagger-section .access { - float: right; -} -.swagger-section .auth { - float: right; -} -.swagger-section .api-ic { - height: 18px; - vertical-align: middle; - display: inline-block; - background: url(../images/explorer_icons-png) no-repeat; -} -.swagger-section .api-ic .api_information_panel { - position: relative; - margin-top: 20px; - margin-left: -5px; - background: #FFF; - border: 1px solid #ccc; - border-radius: 5px; - display: none; - font-size: 13px; - max-width: 300px; - line-height: 30px; - color: black; - padding: 5px; -} -.swagger-section .api-ic .api_information_panel p .api-msg-enabled { - color: green; -} -.swagger-section .api-ic .api_information_panel p .api-msg-disabled { - color: red; -} -.swagger-section .api-ic:hover .api_information_panel { - position: absolute; - display: block; -} -.swagger-section .ic-info { - background-position: 0 0; - width: 18px; - margin-top: -6px; - margin-left: 4px; -} -.swagger-section .ic-warning { - background-position: -60px 0; - width: 18px; - margin-top: -6px; - margin-left: 4px; -} -.swagger-section .ic-error { - background-position: -30px 0; - width: 18px; - margin-top: -6px; - margin-left: 4px; -} -.swagger-section .ic-off { - background-position: -90px 0; - width: 58px; - margin-top: -4px; - cursor: pointer; -} -.swagger-section .ic-on { - background-position: -160px 0; - width: 58px; - margin-top: -4px; - cursor: pointer; -} -.swagger-section #header { - background-color: #89bf04; - padding: 9px 14px 19px 14px; - height: 23px; - min-width: 775px; -} -.swagger-section #input_baseUrl { - width: 400px; -} -.swagger-section #api_selector { - display: block; - clear: none; - float: right; -} -.swagger-section #api_selector .input { - display: inline-block; - clear: none; - margin: 0 10px 0 0; -} -.swagger-section #api_selector input { - font-size: 0.9em; - padding: 3px; - margin: 0; -} -.swagger-section #input_apiKey { - width: 200px; -} -.swagger-section #explore, -.swagger-section #auth_container .authorize__btn { - display: block; - text-decoration: none; - font-weight: bold; - padding: 6px 8px; - font-size: 0.9em; - color: white; - background-color: #547f00; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - -o-border-radius: 4px; - -ms-border-radius: 4px; - -khtml-border-radius: 4px; - border-radius: 4px; -} -.swagger-section #explore:hover, -.swagger-section #auth_container .authorize__btn:hover { - background-color: #547f00; -} -.swagger-section #header #logo { - font-size: 1.5em; - font-weight: bold; - text-decoration: none; - color: white; -} -.swagger-section #header #logo .logo__img { - display: block; - float: left; - margin-top: 2px; -} -.swagger-section #header #logo .logo__title { - display: inline-block; - padding: 5px 0 0 10px; -} -.swagger-section #content_message { - margin: 10px 15px; - font-style: italic; - color: #999999; -} -.swagger-section #message-bar { - min-height: 30px; - text-align: center; - padding-top: 10px; -} -.swagger-section .swagger-collapse:before { - content: "-"; -} -.swagger-section .swagger-expand:before { - content: "+"; -} -.swagger-section .error { - outline-color: #cc0000; - background-color: #f2dede; -} diff --git a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/typography.css b/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/typography.css deleted file mode 100644 index 03477335c..000000000 --- a/Swashbuckle.Core.Lib/SwaggerUi/CustomAssets/typography.css +++ /dev/null @@ -1,14 +0,0 @@ -/* Google Font's Droid Sans */ -@font-face { - font-family: 'Droid Sans'; - font-style: normal; - font-weight: 400; - src: local('Droid Sans'), local('DroidSans'), url('../fonts/DroidSans-ttf'), format('truetype'); -} -/* Google Font's Droid Sans Bold */ -@font-face { - font-family: 'Droid Sans'; - font-style: normal; - font-weight: 700; - src: local('Droid Sans Bold'), local('DroidSans-Bold'), url('../fonts/DroidSans-Bold-ttf'), format('truetype'); -} diff --git a/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetDescriptor.cs b/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetDescriptor.cs deleted file mode 100644 index 78f4ef8f9..000000000 --- a/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetDescriptor.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Reflection; - -namespace Swashbuckle.SwaggerUi -{ - public class EmbeddedAssetDescriptor - { - public EmbeddedAssetDescriptor(Assembly containingAssembly, string name, bool isTemplate) - { - Assembly = containingAssembly; - Name = name; - IsTemplate = isTemplate; - } - - public Assembly Assembly { get; private set; } - - public string Name { get; private set; } - - public bool IsTemplate { get; private set; } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetProvider.cs b/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetProvider.cs deleted file mode 100644 index c41bbfd1d..000000000 --- a/Swashbuckle.Core.Lib/SwaggerUi/EmbeddedAssetProvider.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Swashbuckle.SwaggerUi -{ - public class EmbeddedAssetProvider : IAssetProvider - { - private readonly IDictionary _pathToAssetMap; - private readonly IDictionary _templateParams; - - public EmbeddedAssetProvider( - IDictionary pathToAssetMap, - IDictionary templateParams) - { - _pathToAssetMap = pathToAssetMap; - _templateParams = templateParams; - } - - public Asset GetAsset(string rootUrl, string path) - { - if (!_pathToAssetMap.ContainsKey(path)) - throw new AssetNotFound(String.Format("Mapping not found - {0}", path)); - - var resourceDescriptor = _pathToAssetMap[path]; - return new Asset( - GetEmbeddedResourceStreamFor(resourceDescriptor, rootUrl), - InferMediaTypeFrom(resourceDescriptor.Name) - ); - } - - private Stream GetEmbeddedResourceStreamFor(EmbeddedAssetDescriptor resourceDescriptor, string rootUrl) - { - var stream = resourceDescriptor.Assembly.GetManifestResourceStream(resourceDescriptor.Name); - if (stream == null) - throw new AssetNotFound(String.Format("Embedded resource not found - {0}", resourceDescriptor.Name)); - - if (resourceDescriptor.IsTemplate) - { - var templateParams = _templateParams - .Union(new[] { new KeyValuePair("%(RootUrl)", rootUrl) }) - .ToDictionary(entry => entry.Key, entry => entry.Value); - - return stream.FindAndReplace(templateParams); - } - - return stream; - } - - private static string InferMediaTypeFrom(string path) - { - var extension = path.Split('.').Last(); - - switch (extension) - { - case "css": - return "text/css"; - case "js": - return "text/javascript"; - case "gif": - return "image/gif"; - case "png": - return "image/png"; - case "eot": - return "application/vnd.ms-fontobject"; - case "woff": - return "application/font-woff"; - case "woff2": - return "application/font-woff2"; - case "otf": - return "application/font-sfnt"; // formerly "font/opentype" - case "ttf": - return "application/font-sfnt"; // formerly "font/truetype" - case "svg": - return "image/svg+xml"; - default: - return "text/html"; - } - } - } -} \ No newline at end of file diff --git a/Swashbuckle.Core.Lib/SwaggerUi/IAssetProvider.cs b/Swashbuckle.Core.Lib/SwaggerUi/IAssetProvider.cs deleted file mode 100644 index e6386caf6..000000000 --- a/Swashbuckle.Core.Lib/SwaggerUi/IAssetProvider.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.IO; - -namespace Swashbuckle.SwaggerUi -{ - public interface IAssetProvider - { - Asset GetAsset(string rootUrl, string assetPath); - } - - public class Asset - { - public Asset(Stream stream, string mediaType) - { - Stream = stream; - MediaType = mediaType; - } - - public Stream Stream { get; private set; } - - public string MediaType { get; private set; } - } - - public class AssetNotFound : Exception - { - public AssetNotFound(string message) - : base(message) - {} - } -} diff --git a/Swashbuckle.Core.Lib/SwaggerUi/StreamExtensions.cs b/Swashbuckle.Core.Lib/SwaggerUi/StreamExtensions.cs deleted file mode 100644 index 150c52622..000000000 --- a/Swashbuckle.Core.Lib/SwaggerUi/StreamExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Text; - -namespace Swashbuckle.SwaggerUi -{ - public static class StreamExtensions - { - public static Stream FindAndReplace(this Stream stream, IDictionary replacements) - { - var originalText = new StreamReader(stream).ReadToEnd(); - var outputBuilder = new StringBuilder(originalText); - - foreach (var replacement in replacements) - { - outputBuilder.Replace(replacement.Key, replacement.Value); - } - - return new MemoryStream(Encoding.UTF8.GetBytes(outputBuilder.ToString())); - } - } -} diff --git a/Swashbuckle.Core.Lib/Swashbuckle.Core.Lib.csproj b/Swashbuckle.Core.Lib/Swashbuckle.Core.Lib.csproj deleted file mode 100644 index 8d181e861..000000000 --- a/Swashbuckle.Core.Lib/Swashbuckle.Core.Lib.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - net452;net461;net472 - Swashbuckle.Core.Lib - 5.6.2 - - Library - - true - - - - - - - - - - - - - - - - - - - - diff --git a/Swashbuckle.Core.Lib/app.config b/Swashbuckle.Core.Lib/app.config deleted file mode 100644 index 8ddcd8843..000000000 --- a/Swashbuckle.Core.Lib/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/Swashbuckle.Core/Swashbuckle.Core.csproj b/Swashbuckle.Core/Swashbuckle.Core.csproj index be7a1f649..163d1fd22 100644 --- a/Swashbuckle.Core/Swashbuckle.Core.csproj +++ b/Swashbuckle.Core/Swashbuckle.Core.csproj @@ -1,158 +1,30 @@ - - - + + - Debug - AnyCPU - {D50A26FF-02C6-4C16-BA94-4CD7D43EFBB3} - Library - Properties - Swashbuckle + net452;net461;net47;net472 Swashbuckle.Core - v4.7.2 - 512 - ..\ - true - true - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - false - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - false - - - true - - - Swashbuckle.Core.snk + 5.6.2 + + Library + + true - - - - ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - - - - - - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll - - - ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll - - - ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll - - - - - ..\packages\Microsoft.AspNet.WebApi.Core.5.2.7\lib\net45\System.Web.Http.dll - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - Designer - - - - + + + + + + + - + - - %(RecursiveDir)%(FileName)%(Extension) - false - + - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file + diff --git a/Swashbuckle.Core/Swashbuckle.Core.nuspec b/Swashbuckle.Core/Swashbuckle.Core.nuspec deleted file mode 100644 index c5b1ee921..000000000 --- a/Swashbuckle.Core/Swashbuckle.Core.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - Swashbuckle.Core - $version$ - Swashbuckle.Core - Swagger for WebApi - Richard Morris - http://opensource.org/licenses/BSD-3-Clause - https://github.com/domaindrivendev/Swashbuckle - false - Seamlessly adds a Swagger to WebApi projects! - Combines ApiExplorer and Swagger/swagger-ui to provide a rich discovery, documentation and playground experience to your API consumers - Copyright 2013 - Swagger SwaggerUi Documentation Discovery Help WebApi AspNet AspNetWebApi Docs SelfHost OWIN - - - - - - \ No newline at end of file diff --git a/Swashbuckle.Core/Swashbuckle.Core.snk b/Swashbuckle.Core/Swashbuckle.Core.snk deleted file mode 100644 index 23fa8d6b1da9bd6741498aacd601877bd9af31c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50096Eow*Z>ceQ5=I9+ao$al$3uSVb{f{L*| zvtOqk>~g>B7{DM1M5CbW<69Sd?9}szp_6g!gCyOvLyH?v*@TFA2$FX4KCPq8qyB zdHOg%(n}NZ-{w4j(LaA}-c#d0TgONuFULv5UwoUtUALQ^P`D{h!Z+tPqf>J$Jz@~z z3%xJP0a;Yg4cF%D+I!f~=mdTJ6QFIB9~^?^LC!>PH^BQkUA%7!66{NjLCBzLz0rT+ z`ITu$1Ir|D%Ymk)j_{TRJpbY#xQl6a05-N0kzNbUwq3Q7DW!n;J*Xy8P@JjN!u zX^hQ0KJ`{MBDD6gn*CdIE$&1`QF2Zx33uSJG7><&%1w^<3?sG-!jb73Sbm!s(r6dK zjBiLB(Q+J2uiw>afkQ~5haYV8(2+8zs7F7X;1Yq5n^vKZ(~wMG1Ae#5rFq6Gn6?%p z^==+X8$hu@REqh_OvXo*GJ!;O - - - - - - - - \ No newline at end of file diff --git a/Swashbuckle.sln b/Swashbuckle.sln index e4461e5cd..eaa4b3a7a 100644 --- a/Swashbuckle.sln +++ b/Swashbuckle.sln @@ -31,7 +31,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{67E5A2 .nuget\NuGet.targets = .nuget\NuGet.targets EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Swashbuckle.Core", "Swashbuckle.Core\Swashbuckle.Core.csproj", "{D50A26FF-02C6-4C16-BA94-4CD7D43EFBB3}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Swashbuckle.Core", "Swashbuckle.Core\Swashbuckle.Core.csproj", "{D50A26FF-02C6-4C16-BA94-4CD7D43EFBB3}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{6A2C69FA-6824-44F3-A1A5-1313050FA567}" EndProject @@ -54,8 +54,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Swashbuckle.Core.Lib", "Swashbuckle.Core.Lib\Swashbuckle.Core.Lib.csproj", "{348BFDEC-F453-4E6E-843C-7963B0D379DA}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -89,10 +87,6 @@ Global {2D1F2F73-5828-413C-9FD0-6F81A964C82D}.Debug|Any CPU.Build.0 = Debug|Any CPU {2D1F2F73-5828-413C-9FD0-6F81A964C82D}.Release|Any CPU.ActiveCfg = Release|Any CPU {2D1F2F73-5828-413C-9FD0-6F81A964C82D}.Release|Any CPU.Build.0 = Release|Any CPU - {348BFDEC-F453-4E6E-843C-7963B0D379DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {348BFDEC-F453-4E6E-843C-7963B0D379DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {348BFDEC-F453-4E6E-843C-7963B0D379DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {348BFDEC-F453-4E6E-843C-7963B0D379DA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE