[
  {
    "path": ".gitignore",
    "content": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n\n# User-specific files\n.vs\n*.suo\n*.user\n*.sln.docstates\n\n# build packages\n*.nupkg\n\n# Build results\n\n[Dd]ebug/\n[Rr]elease/\nx64/\nbuild/\n[Bb]in/\n[Oo]bj/\n\n# MSTest test Results\n[Tt]est[Rr]esult*/\n[Bb]uild[Ll]og.*\n\n*_i.c\n*_p.c\n*.ilk\n*.meta\n*.obj\n*.pch\n*.pdb\n*.pgc\n*.pgd\n*.rsp\n*.sbr\n*.tlb\n*.tli\n*.tlh\n*.tmp\n*.tmp_proj\n*.log\n*.vspscc\n*.vssscc\n.builds\n*.pidb\n*.log\n*.scc\n\n# Visual C++ cache files\nipch/\n*.aps\n*.ncb\n*.opensdf\n*.sdf\n*.cachefile\n\n# Visual Studio profiler\n*.psess\n*.vsp\n*.vspx\n\n# Guidance Automation Toolkit\n*.gpState\n\n# ReSharper is a .NET coding add-in\n_ReSharper*/\n*.[Rr]e[Ss]harper\n\n# TeamCity is a build add-in\n_TeamCity*\n\n# DotCover is a Code Coverage Tool\n*.dotCover\n\n# NCrunch\n*.ncrunch*\n.*crunch*.local.xml\n\n# Installshield output folder\n[Ee]xpress/\n\n# DocProject is a documentation generator add-in\nDocProject/buildhelp/\nDocProject/Help/*.HxT\nDocProject/Help/*.HxC\nDocProject/Help/*.hhc\nDocProject/Help/*.hhk\nDocProject/Help/*.hhp\nDocProject/Help/Html2\nDocProject/Help/html\n\n# Click-Once directory\npublish/\n\n# Publish Web Output\n*.Publish.xml\n*.pubxml\n\n# NuGet Packages Directory\n## TODO: If you have NuGet Package Restore enabled, uncomment the next line\n#packages/\n\n# Windows Azure Build Output\ncsx\n*.build.csdef\n\n# Windows Store app package directory\nAppPackages/\n\n# Others\nsql/\n*.Cache\nClientBin/\n[Ss]tyle[Cc]op.*\n~$*\n*~\n*.dbmdl\n*.[Pp]ublish.xml\n*.pfx\n*.publishsettings\n\n# RIA/Silverlight projects\nGenerated_Code/\n\n# Backup & report files from converting an old project file to a newer\n# Visual Studio version. Backup files are not needed, because we have git ;-)\n_UpgradeReport_Files/\nBackup*/\nUpgradeLog*.XML\nUpgradeLog*.htm\n\n# SQL Server files\nApp_Data/*.mdf\nApp_Data/*.ldf\n\n# =========================\n# Windows detritus\n# =========================\n\n# Windows image file caches\nThumbs.db\nehthumbs.db\n\n# Folder config file\nDesktop.ini\n\n# Recycle Bin used on file shares\n$RECYCLE.BIN/\n\n# Mac crap\n.DS_Store\n\n# custom entries\n/src/SampleService/obj\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"src/SampleService/swagger-ui\"]\n\tpath = src/SampleService/swagger-ui\n\turl = https://github.com/wordnik/swagger-ui.git\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"{}\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright {yyyy} {name of copyright owner}\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n\n"
  },
  {
    "path": "README.md",
    "content": "<h1 align=\"left\">\nSwaggerWcf&nbsp;<a href=\"https://www.nuget.org/packages/SwaggerWcf\">\n        <img src=\"http://img.shields.io/nuget/v/SwaggerWcf.svg?style=flat\" alt=\"nuget status\">\n    </a>\n</h1>\n\nGenerates [Swagger](http://swagger.io/) (2.0) for WCF services and also provides [swagger-ui](https://github.com/swagger-api/swagger-ui).\n\nWith an API described in Swagger you can use multiple Swagger tools like client generators, see [swagger-codegen](https://github.com/swagger-api/swagger-codegen) for more details.\n\nThis project has started as a fork from [superstator/Swaggeratr](https://github.com/superstator/Swaggeratr) to implement version 2.0 of Swagger.\n\n## Getting Started\n\n### Step 1: Install SwaggerWcf package\n\n```\n\nInstall-Package SwaggerWcf\n\n```\n\n### Step 2: Configure WCF\n#### ASP.NET\n\nAdd the route in the `Application_Start` method inside `Global.asax`\n\n```csharp\n\nprotected void Application_Start(object sender, EventArgs e)\n{\n    // [.......]\n    \n    RouteTable.Routes.Add(new ServiceRoute(\"api-docs\", new WebServiceHostFactory(), typeof(SwaggerWcfEndpoint)));\n}\n\n```\n\nNote: You might need to add a reference to `System.ServiceModel.Activation`\n\nEdit `Web.config` and add the following (if it doesn't exist yet) inside the `system.serviceModel` block\n\n```xml\n\n<serviceHostingEnvironment aspNetCompatibilityEnabled=\"true\" multipleSiteBindingsEnabled=\"true\"/>\n\n```\n\nEdit again `Web.config` and add the following (if it doesn't exist yet) inside the `system.webServer` block\n\n```xml\n\n<modules runAllManagedModulesForAllRequests=\"true\"/>\n\n```\n#### Self Hosted\nAdd an endpoint to your App.config file.\n```xml\n<services>\n  <service name=\"SwaggerWcf.SwaggerWcfEndpoint\">\n    <endpoint address=\"http://localhost/docs\" binding=\"webHttpBinding\" contract=\"SwaggerWcf.ISwaggerWcfEndpoint\" />\n  </service>\n</services>\n```\nCreate a WebServiceHost\n```csharp\nvar swaggerHost = new WebServiceHost(typeof(SwaggerWcfEndpoint));\nswaggerHost.Open();\n```\n\n### Step 3: Optionaly configure WCF response auto types\n\nAdd the following to your config file.\nThis will allow the WCF service to accept requests and send replies based on the `Content-Type` headers.\n\n```xml\n\n<system.serviceModel>\n  <behaviors>\n    <endpointBehaviors>\n      <behavior>\n        <webHttp automaticFormatSelectionEnabled=\"true\" />\n      </behavior>\n    </endpointBehaviors>\n    <!-- [.......] -->\n  </behaviors>\n</system.serviceModel>\n  \n```\n\n### Step 4: Configure WCF services general information\n#### Configure via config file\nAdd the following to your config file and change the values accordingly\n\n```xml\n<configSections>\n  <section name=\"swaggerwcf\" type=\"SwaggerWcf.Configuration.SwaggerWcfSection, SwaggerWcf\" />\n</configSections>\n\n<swaggerwcf>\n  <tags>\n    <tag name=\"LowPerformance\" visible=\"false\" />\n  </tags>\n  <settings>\n    <setting name=\"InfoDescription\" value=\"Sample Service to test SwaggerWCF\" />\n    <setting name=\"InfoVersion\" value=\"0.0.1\" />\n    <setting name=\"InfoTermsOfService\" value=\"Terms of Service\" />\n    <setting name=\"InfoTitle\" value=\"SampleService\" />\n    <setting name=\"InfoContactName\" value=\"Abel Silva\" />\n    <setting name=\"InfoContactUrl\" value=\"http://github.com/abelsilva\" />\n    <setting name=\"InfoContactEmail\" value=\"no@e.mail\" />\n    <setting name=\"InfoLicenseUrl\" value=\"https://github.com/abelsilva/SwaggerWCF/blob/master/LICENSE\" />\n    <setting name=\"InfoLicenseName\" value=\"Apache License\" />\n  </settings>\n</swaggerwcf>\n```\n\nNotes:\n* make sure the `configSections` block is the first child of `configuration`\n* `tags` will be described further down\n\n#### Configure via code\nConfigure the base properties via code. New: You can add security settings to your api (see also the new Security-Methodattribute)\n\n```csharp\nvar info = new Info\n{\nDescription = \"Sample Service to test SwaggerWCF\",\nVersion = \"0.0.1\"\n// etc\n};\n\nvar security = new SecurityDefinitions\n{\n  {\n    \"api-gateway\", new SecurityAuthorization\n    {\n      Type = \"oauth2\",\n      Name = \"api-gateway\",\n      Description = \"Forces authentication with credentials via an api gateway\",\n      Flow = \"password\",\n      Scopes = new Dictionary<string, string=\"\">\n      {\n          { \"author\", \"use author scope\"},\n          { \"admin\", \"use admin scope\"},\n      },\n      AuthorizationUrl = \"http://yourapi.net/oauth/token\"\n    }\n  }\n};\n\nSwaggerWcfEndpoint.Configure(info, security);\n```\n\n### Step 5: Decorate WCF services interfaces\n\nFor each method, configure the `WebInvoke` or `WebGet` attribute, and add a `SwaggerWcfPath` attribute.\n\n```csharp\n\n[ServiceContract]\npublic interface IStore\n{\n    [SwaggerWcfPath(\"Create book\", \"Create a book on the store\")]\n    [WebInvoke(UriTemplate = \"/books\",\n        BodyStyle = WebMessageBodyStyle.Bare,\n        Method = \"POST\",\n        RequestFormat = WebMessageFormat.Json,\n        ResponseFormat = WebMessageFormat.Json)]\n    [OperationContract]\n    Book CreateBook(Book value);\n    \n    // [.......]\n}\n\n```\n\n### Step 6: Decorate WCF services class\n\nAdd the `SwaggerWcf` and `AspNetCompatibilityRequirements` attributes to the class providing the base path for the service (the same as used in step 2).\nOptinally, for each method, add the `SwaggerWcfTag` to categorize the method and the `SwaggerWcfResponse` for each possible response from the service.\n\n```csharp\n\n[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]\n[SwaggerWcf(\"/v1/rest\")]\npublic class BookStore : IStore\n{\n    [SwaggerWcfTag(\"Books\")]\n    [SwaggerWcfResponse(HttpStatusCode.Created, \"Book created, value in the response body with id updated\")]\n    [SwaggerWcfResponse(HttpStatusCode.BadRequest, \"Bad request\", true)]\n    [SwaggerWcfResponse(HttpStatusCode.InternalServerError,\n        \"Internal error (can be forced using ERROR_500 as book title)\", true)]\n    public Book CreateBook(Book value)\n    {\n        // [.......]\n    }\n    \n    // [.......]\n}\n\n```\n\n### Step 7: Decorate data types used in WCF services\n\n```csharp\n\n[DataContract(Name = \"book\")]\n[Description(\"Book with title, first publish date, author and language\")]\n[SwaggerWcfDefinition(ExternalDocsUrl = \"http://en.wikipedia.org/wiki/Book\", ExternalDocsDescription = \"Description of a book\")]\npublic class Book\n{\n    [DataMember(Name = \"id\")]\n    [Description(\"Book ID\")]\n    public string Id { get; set; }\n\n    // [.......]\n}\n\n```\n\nNote: make sure you add at least the `DataContract` and `DataMember` attributes in classes and properties\n\n## Attributes\n\n| Attribute                | Used in                                    | Description                            | Options                                                                                             |\n| ------------------------ |------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------------------------------------- |\n| `SwaggerWcf`             | `Class`, `Interface`                       | Enable parsing WCF service             | `ServicePath`                                                                                       |\n| `SwaggerWcfHidden`       | `Class`, `Method`, `Property`, `Parameter` | Hide element from Swagger              |                                                                                                     |\n| `SwaggerWcfTag`          | `Class`, `Method`, `Property`, `Parameter` | Add a tag to an element                | `TagName`, `HideFromSpec`                                                                           |\n| `SwaggerWcfHeader`       | `Method`                                   | Configure method HTTP headers          | `Name`, `Required`, `Description`, `DefaultValue`                                                   |\n| `SwaggerWcfPath`         | `Method`                                   | Configure a method in Swagger          | `Summary`, `Description`, `OperationId`, `ExternalDocsDescription`, `ExternalDocsUrl`, `Deprecated` |\n| `SwaggerWcfParameter`    | `Parameter`                                | Configure method parameters            | `Required`, `Description`, `ParameterType`                                                          |\n| `SwaggerWcfProperty`     | `Property`                                 | Configure property parameters          | `Required`, `Description`, `Minimum`, `Maximum`, `Default`, ...                                     |\n| `SwaggerWcfResponse`     | `Method`                                   | Configure method return value          | `Code`, `Description`, `EmptyResponseOverride`, `Headers`                                           |\n| `SwaggerWcfDefinition`   | `Class`                                    | Configure a data type                  | `ExternalDocsDescription`, `ExternalDocsUrl`                                                        |\n| `SwaggerWcfReturnType`   | `Method`                                   | Override method return type            | `ReturnType`                                                                                        |\n| `SwaggerWcfContentTypes` | `Method`                                   | Override consume/produce content-types | `ConsumeTypes`, `ProduceTypes`                                                                      |\n| `SwaggerWcfSecurity`     | `Method`                                   | Add security background to this method | `SecurityDefinitionName`, `params Scopes`                                                           |\n\n\n## Tags\n\nTags are used to create categories in Swagger UI.\n\nIn SwaggerWcf they can also be used to hide or show elements from the Swagger output using the configuration file.\n\nUsing the configuration from step 4, any elements with the tag `LowPerformance` will be hidden from Swagger.\n\nWhen a `SwaggerWcfTag` is added to an element, it may be configured with `HideFromSpec`.\nThis will prevent this tag to be displayed in the Swagger output.\n\nWhen combined with `SwaggerWcfHidden`, if the tag has the value `visible` as `true` in `web.config` file, the element will be visible\n\n## Query Parameter\n\nTo specify query parameters to a function you may use the following syntax\n\n```csharp\n[WebGet(UriTemplate = \"/books?filter={filter}\", BodyStyle = WebMessageBodyStyle.Bare)]\nBook[] ReadBooks(string filter = null);\n```\n\n## Optional Parameters\n\nTo specify a paramter as optional for swagger-ui provide a default value for the parameter on the interface.\n```csharp\npublic string Foo(string bar = null);\n```\n\n## Optional Properties\n\nTo mark a property as optional or required, use the `IsRequired` parameter on the `DataMember` attribute.\n\n\n## TODO\n\n* Add some options to configuration in `Web.config`\n* Tests\n\n## How to Improve It\n\nFork this project [abelsilva/swaggerwcf](https://github.com/abelsilva/swaggerwcf) and submit pull requests.\n"
  },
  {
    "path": "notes/samples/petstore-expanded.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\n    \"termsOfService\": \"http://swagger.io/terms/\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\",\n      \"email\": \"apiteam@swagger.io\",\n      \"url\": \"http://swagger.io\"\n    },\n    \"license\": {\n      \"name\": \"MIT\",\n      \"url\": \"http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT\"\n    }\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"description\": \"Returns all pets from the system that the user has access to\",\n        \"operationId\": \"findPets\",\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"tags\",\n            \"in\": \"query\",\n            \"description\": \"tags to filter by\",\n            \"required\": false,\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"collectionFormat\": \"csv\"\n          },\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"description\": \"maximum number of results to return\",\n            \"required\": false,\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Pet\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"description\": \"Creates a new pet in the store.  Duplicates are allowed\",\n        \"operationId\": \"addPet\",\n        \"produces\": [\n          \"application/json\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"pet\",\n            \"in\": \"body\",\n            \"description\": \"Pet to add to the store\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/NewPet\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    },\n    \"/pets/{id}\": {\n      \"get\": {\n        \"description\": \"Returns a user based on a single ID, if the user does not have access to the pet\",\n        \"operationId\": \"findPetById\",\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to fetch\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"delete\": {\n        \"description\": \"deletes a single pet based on the ID supplied\",\n        \"operationId\": \"deletePet\",\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to delete\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"pet deleted\"\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"required\": [\n        \"id\",\n        \"name\"\n      ],\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"NewPet\": {\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/Pet\"\n        },\n        {\n          \"required\": [\n            \"name\"\n          ],\n          \"properties\": {\n            \"id\": {\n              \"type\": \"integer\",\n              \"format\": \"int64\"\n            }\n          }\n        }\n      ]\n    },\n    \"ErrorModel\": {\n      \"required\": [\n        \"code\",\n        \"message\"\n      ],\n      \"properties\": {\n        \"code\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\"\n        },\n        \"message\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "notes/samples/petstore-minimal.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\n    \"termsOfService\": \"http://swagger.io/terms/\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\"\n    },\n    \"license\": {\n      \"name\": \"MIT\"\n    }\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"description\": \"Returns all pets from the system that the user has access to\",\n        \"produces\": [\n          \"application/json\"\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"A list of pets.\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Pet\"\n              }\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"required\": [\n        \"id\",\n        \"name\"\n      ],\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "notes/samples/petstore-simple.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\n    \"termsOfService\": \"http://swagger.io/terms/\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\"\n    },\n    \"license\": {\n      \"name\": \"MIT\"\n    }\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"description\": \"Returns all pets from the system that the user has access to\",\n        \"operationId\": \"findPets\",\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"tags\",\n            \"in\": \"query\",\n            \"description\": \"tags to filter by\",\n            \"required\": false,\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"collectionFormat\": \"csv\"\n          },\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"description\": \"maximum number of results to return\",\n            \"required\": false,\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Pet\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"description\": \"Creates a new pet in the store.  Duplicates are allowed\",\n        \"operationId\": \"addPet\",\n        \"produces\": [\n          \"application/json\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"pet\",\n            \"in\": \"body\",\n            \"description\": \"Pet to add to the store\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/PetInput\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    },\n    \"/pets/{id}\": {\n      \"get\": {\n        \"description\": \"Returns a user based on a single ID, if the user does not have access to the pet\",\n        \"operationId\": \"findPetById\",\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to fetch\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"delete\": {\n        \"description\": \"deletes a single pet based on the ID supplied\",\n        \"operationId\": \"deletePet\",\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to delete\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"pet deleted\"\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"required\": [\n        \"id\",\n        \"name\"\n      ],\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"PetInput\": {\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/Pet\"\n        },\n        {\n          \"required\": [\n            \"name\"\n          ],\n          \"properties\": {\n            \"id\": {\n              \"type\": \"integer\",\n              \"format\": \"int64\"\n            }\n          }\n        }\n      ]\n    },\n    \"ErrorModel\": {\n      \"required\": [\n        \"code\",\n        \"message\"\n      ],\n      \"properties\": {\n        \"code\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\"\n        },\n        \"message\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "notes/samples/petstore-with-external-docs.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"description\": \"A sample API that uses a petstore as an example to demonstrate features in the swagger-2.0 specification\",\n    \"termsOfService\": \"http://swagger.io/terms/\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\",\n      \"email\": \"apiteam@swagger.io\",\n      \"url\": \"http://swagger.io\"\n    },\n    \"license\": {\n      \"name\": \"MIT\",\n      \"url\": \"http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT\"\n    }\n  },\n  \"externalDocs\": {\n    \"description\": \"find more info here\",\n    \"url\": \"https://swagger.io/about\"\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"consumes\": [\n    \"application/json\"\n  ],\n  \"produces\": [\n    \"application/json\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"description\": \"Returns all pets from the system that the user has access to\",\n        \"operationId\": \"findPets\",\n        \"externalDocs\": {\n          \"description\": \"find more info here\",\n          \"url\": \"https://swagger.io/about\"\n        },\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"tags\",\n            \"in\": \"query\",\n            \"description\": \"tags to filter by\",\n            \"required\": false,\n            \"type\": \"array\",\n            \"items\": {\n              \"type\": \"string\"\n            },\n            \"collectionFormat\": \"csv\"\n          },\n          {\n            \"name\": \"limit\",\n            \"in\": \"query\",\n            \"description\": \"maximum number of results to return\",\n            \"required\": false,\n            \"type\": \"integer\",\n            \"format\": \"int32\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Pet\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"post\": {\n        \"description\": \"Creates a new pet in the store.  Duplicates are allowed\",\n        \"operationId\": \"addPet\",\n        \"produces\": [\n          \"application/json\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"pet\",\n            \"in\": \"body\",\n            \"description\": \"Pet to add to the store\",\n            \"required\": true,\n            \"schema\": {\n              \"$ref\": \"#/definitions/NewPet\"\n            }\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    },\n    \"/pets/{id}\": {\n      \"get\": {\n        \"description\": \"Returns a user based on a single ID, if the user does not have access to the pet\",\n        \"operationId\": \"findPetById\",\n        \"produces\": [\n          \"application/json\",\n          \"application/xml\",\n          \"text/xml\",\n          \"text/html\"\n        ],\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to fetch\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Pet\"\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      },\n      \"delete\": {\n        \"description\": \"deletes a single pet based on the ID supplied\",\n        \"operationId\": \"deletePet\",\n        \"parameters\": [\n          {\n            \"name\": \"id\",\n            \"in\": \"path\",\n            \"description\": \"ID of pet to delete\",\n            \"required\": true,\n            \"type\": \"integer\",\n            \"format\": \"int64\"\n          }\n        ],\n        \"responses\": {\n          \"204\": {\n            \"description\": \"pet deleted\"\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/ErrorModel\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"required\": [\n        \"id\",\n        \"name\"\n      ],\n      \"externalDocs\": {\n        \"description\": \"find more info here\",\n        \"url\": \"https://swagger.io/about\"\n      },\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"NewPet\": {\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/Pet\"\n        },\n        {\n          \"required\": [\n            \"name\"\n          ],\n          \"properties\": {\n            \"id\": {\n              \"type\": \"integer\",\n              \"format\": \"int64\"\n            }\n          }\n        }\n      ]\n    },\n    \"ErrorModel\": {\n      \"required\": [\n        \"code\",\n        \"message\"\n      ],\n      \"properties\": {\n        \"code\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\"\n        },\n        \"message\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "notes/samples/petstore.json",
    "content": "{\n  \"swagger\": \"2.0\",\n  \"info\": {\n    \"version\": \"1.0.0\",\n    \"title\": \"Swagger Petstore\",\n    \"contact\": {\n      \"name\": \"Swagger API Team\",\n      \"url\": \"http://swagger.io\"\n    },\n    \"license\": {\n      \"name\": \"Creative Commons 4.0 International\",\n      \"url\": \"http://creativecommons.org/licenses/by/4.0/\"\n    }\n  },\n  \"host\": \"petstore.swagger.io\",\n  \"basePath\": \"/api\",\n  \"schemes\": [\n    \"http\"\n  ],\n  \"paths\": {\n    \"/pets\": {\n      \"get\": {\n        \"tags\": [ \"Pet Operations\" ],\n        \"summary\": \"finds pets in the system\",\n        \"responses\": {\n          \"200\": {\n            \"description\": \"pet response\",\n            \"schema\": {\n              \"type\": \"array\",\n              \"items\": {\n                \"$ref\": \"#/definitions/Pet\"\n              }\n            },\n            \"headers\": {\n              \"x-expires\": {\n                \"type\": \"string\"\n              }\n            }\n          },\n          \"default\": {\n            \"description\": \"unexpected error\",\n            \"schema\": {\n              \"$ref\": \"#/definitions/Error\"\n            }\n          }\n        }\n      }\n    }\n  },\n  \"definitions\": {\n    \"Pet\": {\n      \"required\": [\n        \"id\",\n        \"name\"\n      ],\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\",\n          \"format\": \"int64\"\n        },\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"tag\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"Error\": {\n      \"required\": [\n        \"code\",\n        \"message\"\n      ],\n      \"properties\": {\n        \"code\": {\n          \"type\": \"integer\",\n          \"format\": \"int32\"\n        },\n        \"message\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "notes/schema.json",
    "content": "{\n  \"title\": \"A JSON Schema for Swagger 2.0 API.\",\n  \"id\": \"http://swagger.io/v2/schema.json#\",\n  \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n  \"type\": \"object\",\n  \"required\": [\n    \"swagger\",\n    \"info\",\n    \"paths\"\n  ],\n  \"additionalProperties\": false,\n  \"patternProperties\": {\n    \"^x-\": {\n      \"$ref\": \"#/definitions/vendorExtension\"\n    }\n  },\n  \"properties\": {\n    \"swagger\": {\n      \"type\": \"string\",\n      \"enum\": [\n        \"2.0\"\n      ],\n      \"description\": \"The Swagger version of this document.\"\n    },\n    \"info\": {\n      \"$ref\": \"#/definitions/info\"\n    },\n    \"host\": {\n      \"type\": \"string\",\n      \"format\": \"uri\",\n      \"pattern\": \"^[^{}/ :\\\\\\\\]+(?::\\\\d+)?$\",\n      \"description\": \"The fully qualified URI to the host of the API.\"\n    },\n    \"basePath\": {\n      \"type\": \"string\",\n      \"pattern\": \"^/\",\n      \"description\": \"The base path to the API. Example: '/api'.\"\n    },\n    \"schemes\": {\n      \"$ref\": \"#/definitions/schemesList\"\n    },\n    \"consumes\": {\n      \"description\": \"A list of MIME types accepted by the API.\",\n      \"$ref\": \"#/definitions/mediaTypeList\"\n    },\n    \"produces\": {\n      \"description\": \"A list of MIME types the API can produce.\",\n      \"$ref\": \"#/definitions/mediaTypeList\"\n    },\n    \"paths\": {\n      \"$ref\": \"#/definitions/paths\"\n    },\n    \"definitions\": {\n      \"$ref\": \"#/definitions/definitions\"\n    },\n    \"parameters\": {\n      \"$ref\": \"#/definitions/parameterDefinitions\"\n    },\n    \"responses\": {\n      \"$ref\": \"#/definitions/responseDefinitions\"\n    },\n    \"security\": {\n      \"$ref\": \"#/definitions/security\"\n    },\n    \"securityDefinitions\": {\n      \"$ref\": \"#/definitions/securityDefinitions\"\n    },\n    \"tags\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"$ref\": \"#/definitions/tag\"\n      },\n      \"uniqueItems\": true\n    },\n    \"externalDocs\": {\n      \"$ref\": \"#/definitions/externalDocs\"\n    }\n  },\n  \"definitions\": {\n    \"info\": {\n      \"type\": \"object\",\n      \"description\": \"General information about the API.\",\n      \"required\": [\n        \"version\",\n        \"title\"\n      ],\n      \"additionalProperties\": false,\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"properties\": {\n        \"title\": {\n          \"type\": \"string\",\n          \"description\": \"A unique and precise title of the API.\"\n        },\n        \"version\": {\n          \"type\": \"string\",\n          \"description\": \"A semantic version number of the API.\"\n        },\n        \"description\": {\n          \"type\": \"string\",\n          \"description\": \"A longer description of the API. Should be different from the title.  Github-flavored markdown is allowed.\"\n        },\n        \"termsOfService\": {\n          \"type\": \"string\",\n          \"description\": \"The terms of service for the API.\"\n        },\n        \"contact\": {\n          \"$ref\": \"#/definitions/contact\"\n        },\n        \"license\": {\n          \"$ref\": \"#/definitions/license\"\n        }\n      }\n    },\n    \"contact\": {\n      \"type\": \"object\",\n      \"description\": \"Contact information for the owners of the API.\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\",\n          \"description\": \"The identifying name of the contact person/organization.\"\n        },\n        \"url\": {\n          \"type\": \"string\",\n          \"description\": \"The URL pointing to the contact information.\",\n          \"format\": \"uri\"\n        },\n        \"email\": {\n          \"type\": \"string\",\n          \"description\": \"The email address of the contact person/organization.\",\n          \"format\": \"email\"\n        }\n      }\n    },\n    \"license\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"name\"\n      ],\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\",\n          \"description\": \"The name of the license type. It's encouraged to use an OSI compatible license.\"\n        },\n        \"url\": {\n          \"type\": \"string\",\n          \"description\": \"The URL pointing to the license.\",\n          \"format\": \"uri\"\n        }\n      }\n    },\n    \"paths\": {\n      \"type\": \"object\",\n      \"description\": \"Relative paths to the individual endpoints. They must be relative to the 'basePath'.\",\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        },\n        \"^/\": {\n          \"$ref\": \"#/definitions/pathItem\"\n        }\n      },\n      \"additionalProperties\": false\n    },\n    \"definitions\": {\n      \"type\": \"object\",\n      \"additionalProperties\": {\n        \"$ref\": \"#/definitions/schema\"\n      },\n      \"description\": \"One or more JSON objects describing the schemas being consumed and produced by the API.\"\n    },\n    \"parameterDefinitions\": {\n      \"type\": \"object\",\n      \"additionalProperties\": {\n        \"$ref\": \"#/definitions/parameter\"\n      },\n      \"description\": \"One or more JSON representations for parameters\"\n    },\n    \"responseDefinitions\": {\n      \"type\": \"object\",\n      \"additionalProperties\": {\n        \"$ref\": \"#/definitions/response\"\n      },\n      \"description\": \"One or more JSON representations for parameters\"\n    },\n    \"externalDocs\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"description\": \"information about external documentation\",\n      \"required\": [\n        \"url\"\n      ],\n      \"properties\": {\n        \"description\": {\n          \"type\": \"string\"\n        },\n        \"url\": {\n          \"type\": \"string\",\n          \"format\": \"uri\"\n        }\n      }\n    },\n    \"examples\": {\n      \"type\": \"object\",\n      \"patternProperties\": {\n        \"^[a-z0-9-]+/[a-z0-9\\\\-+]+$\": {}\n      },\n      \"additionalProperties\": false\n    },\n    \"mimeType\": {\n      \"type\": \"string\",\n      \"description\": \"The MIME type of the HTTP message.\"\n    },\n    \"operation\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"responses\"\n      ],\n      \"additionalProperties\": false,\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"properties\": {\n        \"tags\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"type\": \"string\"\n          },\n          \"uniqueItems\": true\n        },\n        \"summary\": {\n          \"type\": \"string\",\n          \"description\": \"A brief summary of the operation.\"\n        },\n        \"description\": {\n          \"type\": \"string\",\n          \"description\": \"A longer description of the operation, github-flavored markdown is allowed.\"\n        },\n        \"externalDocs\": {\n          \"$ref\": \"#/definitions/externalDocs\"\n        },\n        \"operationId\": {\n          \"type\": \"string\",\n          \"description\": \"A friendly name of the operation\"\n        },\n        \"produces\": {\n          \"description\": \"A list of MIME types the API can produce.\",\n          \"$ref\": \"#/definitions/mediaTypeList\"\n        },\n        \"consumes\": {\n          \"description\": \"A list of MIME types the API can consume.\",\n          \"$ref\": \"#/definitions/mediaTypeList\"\n        },\n        \"parameters\": {\n          \"$ref\": \"#/definitions/parametersList\"\n        },\n        \"responses\": {\n          \"$ref\": \"#/definitions/responses\"\n        },\n        \"schemes\": {\n          \"$ref\": \"#/definitions/schemesList\"\n        },\n        \"deprecated\": {\n          \"type\": \"boolean\",\n          \"default\": false\n        },\n        \"security\": {\n          \"$ref\": \"#/definitions/security\"\n        }\n      }\n    },\n    \"pathItem\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"properties\": {\n        \"$ref\": {\n          \"type\": \"string\"\n        },\n        \"get\": {\n          \"$ref\": \"#/definitions/operation\"\n        },\n        \"put\": {\n          \"$ref\": \"#/definitions/operation\"\n        },\n        \"post\": {\n          \"$ref\": \"#/definitions/operation\"\n        },\n        \"delete\": {\n          \"$ref\": \"#/definitions/operation\"\n        },\n        \"options\": {\n          \"$ref\": \"#/definitions/operation\"\n        },\n        \"head\": {\n          \"$ref\": \"#/definitions/operation\"\n        },\n        \"patch\": {\n          \"$ref\": \"#/definitions/operation\"\n        },\n        \"parameters\": {\n          \"$ref\": \"#/definitions/parametersList\"\n        }\n      }\n    },\n    \"responses\": {\n      \"type\": \"object\",\n      \"description\": \"Response objects names can either be any valid HTTP status code or 'default'.\",\n      \"minProperties\": 1,\n      \"additionalProperties\": false,\n      \"patternProperties\": {\n        \"^([0-9]{3})$|^(default)$\": {\n          \"$ref\": \"#/definitions/responseValue\"\n        },\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"not\": {\n        \"type\": \"object\",\n        \"additionalProperties\": false,\n        \"patternProperties\": {\n          \"^x-\": {\n            \"$ref\": \"#/definitions/vendorExtension\"\n          }\n        }\n      }\n    },\n    \"responseValue\": {\n      \"oneOf\": [\n        {\n          \"$ref\": \"#/definitions/response\"\n        },\n        {\n          \"$ref\": \"#/definitions/jsonReference\"\n        }\n      ]\n    },\n    \"response\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"description\"\n      ],\n      \"properties\": {\n        \"description\": {\n          \"type\": \"string\"\n        },\n        \"schema\": {\n          \"$ref\": \"#/definitions/schema\"\n        },\n        \"headers\": {\n          \"$ref\": \"#/definitions/headers\"\n        },\n        \"examples\": {\n          \"$ref\": \"#/definitions/examples\"\n        }\n      },\n      \"additionalProperties\": false\n    },\n    \"headers\": {\n      \"type\": \"object\",\n      \"additionalProperties\": {\n        \"$ref\": \"#/definitions/header\"\n      }\n    },\n    \"header\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"required\": [\n        \"type\"\n      ],\n      \"properties\": {\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"string\",\n            \"number\",\n            \"integer\",\n            \"boolean\",\n            \"array\"\n          ]\n        },\n        \"format\": {\n          \"type\": \"string\"\n        },\n        \"items\": {\n          \"$ref\": \"#/definitions/primitivesItems\"\n        },\n        \"collectionFormat\": {\n          \"$ref\": \"#/definitions/collectionFormat\"\n        },\n        \"default\": {\n          \"$ref\": \"#/definitions/default\"\n        },\n        \"maximum\": {\n          \"$ref\": \"#/definitions/maximum\"\n        },\n        \"exclusiveMaximum\": {\n          \"$ref\": \"#/definitions/exclusiveMaximum\"\n        },\n        \"minimum\": {\n          \"$ref\": \"#/definitions/minimum\"\n        },\n        \"exclusiveMinimum\": {\n          \"$ref\": \"#/definitions/exclusiveMinimum\"\n        },\n        \"maxLength\": {\n          \"$ref\": \"#/definitions/maxLength\"\n        },\n        \"minLength\": {\n          \"$ref\": \"#/definitions/minLength\"\n        },\n        \"pattern\": {\n          \"$ref\": \"#/definitions/pattern\"\n        },\n        \"maxItems\": {\n          \"$ref\": \"#/definitions/maxItems\"\n        },\n        \"minItems\": {\n          \"$ref\": \"#/definitions/minItems\"\n        },\n        \"uniqueItems\": {\n          \"$ref\": \"#/definitions/uniqueItems\"\n        },\n        \"enum\": {\n          \"$ref\": \"#/definitions/enum\"\n        },\n        \"multipleOf\": {\n          \"$ref\": \"#/definitions/multipleOf\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        }\n      }\n    },\n    \"vendorExtension\": {\n      \"description\": \"Any property starting with x- is valid.\",\n      \"additionalProperties\": true,\n      \"additionalItems\": true\n    },\n    \"bodyParameter\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"name\",\n        \"in\",\n        \"schema\"\n      ],\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"properties\": {\n        \"description\": {\n          \"type\": \"string\",\n          \"description\": \"A brief description of the parameter. This could contain examples of use.  Github-flavored markdown is allowed.\"\n        },\n        \"name\": {\n          \"type\": \"string\",\n          \"description\": \"The name of the parameter.\"\n        },\n        \"in\": {\n          \"type\": \"string\",\n          \"description\": \"Determines the location of the parameter.\",\n          \"enum\": [\n            \"body\"\n          ]\n        },\n        \"required\": {\n          \"type\": \"boolean\",\n          \"description\": \"Determines whether or not this parameter is required or optional.\",\n          \"default\": false\n        },\n        \"schema\": {\n          \"$ref\": \"#/definitions/schema\"\n        }\n      },\n      \"additionalProperties\": false\n    },\n    \"headerParameterSubSchema\": {\n      \"additionalProperties\": false,\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"properties\": {\n        \"required\": {\n          \"type\": \"boolean\",\n          \"description\": \"Determines whether or not this parameter is required or optional.\",\n          \"default\": false\n        },\n        \"in\": {\n          \"type\": \"string\",\n          \"description\": \"Determines the location of the parameter.\",\n          \"enum\": [\n            \"header\"\n          ]\n        },\n        \"description\": {\n          \"type\": \"string\",\n          \"description\": \"A brief description of the parameter. This could contain examples of use.  Github-flavored markdown is allowed.\"\n        },\n        \"name\": {\n          \"type\": \"string\",\n          \"description\": \"The name of the parameter.\"\n        },\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"string\",\n            \"number\",\n            \"boolean\",\n            \"integer\",\n            \"array\"\n          ]\n        },\n        \"format\": {\n          \"type\": \"string\"\n        },\n        \"items\": {\n          \"$ref\": \"#/definitions/primitivesItems\"\n        },\n        \"collectionFormat\": {\n          \"$ref\": \"#/definitions/collectionFormat\"\n        },\n        \"default\": {\n          \"$ref\": \"#/definitions/default\"\n        },\n        \"maximum\": {\n          \"$ref\": \"#/definitions/maximum\"\n        },\n        \"exclusiveMaximum\": {\n          \"$ref\": \"#/definitions/exclusiveMaximum\"\n        },\n        \"minimum\": {\n          \"$ref\": \"#/definitions/minimum\"\n        },\n        \"exclusiveMinimum\": {\n          \"$ref\": \"#/definitions/exclusiveMinimum\"\n        },\n        \"maxLength\": {\n          \"$ref\": \"#/definitions/maxLength\"\n        },\n        \"minLength\": {\n          \"$ref\": \"#/definitions/minLength\"\n        },\n        \"pattern\": {\n          \"$ref\": \"#/definitions/pattern\"\n        },\n        \"maxItems\": {\n          \"$ref\": \"#/definitions/maxItems\"\n        },\n        \"minItems\": {\n          \"$ref\": \"#/definitions/minItems\"\n        },\n        \"uniqueItems\": {\n          \"$ref\": \"#/definitions/uniqueItems\"\n        },\n        \"enum\": {\n          \"$ref\": \"#/definitions/enum\"\n        },\n        \"multipleOf\": {\n          \"$ref\": \"#/definitions/multipleOf\"\n        }\n      }\n    },\n    \"queryParameterSubSchema\": {\n      \"additionalProperties\": false,\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"properties\": {\n        \"required\": {\n          \"type\": \"boolean\",\n          \"description\": \"Determines whether or not this parameter is required or optional.\",\n          \"default\": false\n        },\n        \"in\": {\n          \"type\": \"string\",\n          \"description\": \"Determines the location of the parameter.\",\n          \"enum\": [\n            \"query\"\n          ]\n        },\n        \"description\": {\n          \"type\": \"string\",\n          \"description\": \"A brief description of the parameter. This could contain examples of use.  Github-flavored markdown is allowed.\"\n        },\n        \"name\": {\n          \"type\": \"string\",\n          \"description\": \"The name of the parameter.\"\n        },\n        \"allowEmptyValue\": {\n          \"type\": \"boolean\",\n          \"default\": false,\n          \"description\": \"allows sending a parameter by name only or with an empty value.\"\n        },\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"string\",\n            \"number\",\n            \"boolean\",\n            \"integer\",\n            \"array\"\n          ]\n        },\n        \"format\": {\n          \"type\": \"string\"\n        },\n        \"items\": {\n          \"$ref\": \"#/definitions/primitivesItems\"\n        },\n        \"collectionFormat\": {\n          \"$ref\": \"#/definitions/collectionFormatWithMulti\"\n        },\n        \"default\": {\n          \"$ref\": \"#/definitions/default\"\n        },\n        \"maximum\": {\n          \"$ref\": \"#/definitions/maximum\"\n        },\n        \"exclusiveMaximum\": {\n          \"$ref\": \"#/definitions/exclusiveMaximum\"\n        },\n        \"minimum\": {\n          \"$ref\": \"#/definitions/minimum\"\n        },\n        \"exclusiveMinimum\": {\n          \"$ref\": \"#/definitions/exclusiveMinimum\"\n        },\n        \"maxLength\": {\n          \"$ref\": \"#/definitions/maxLength\"\n        },\n        \"minLength\": {\n          \"$ref\": \"#/definitions/minLength\"\n        },\n        \"pattern\": {\n          \"$ref\": \"#/definitions/pattern\"\n        },\n        \"maxItems\": {\n          \"$ref\": \"#/definitions/maxItems\"\n        },\n        \"minItems\": {\n          \"$ref\": \"#/definitions/minItems\"\n        },\n        \"uniqueItems\": {\n          \"$ref\": \"#/definitions/uniqueItems\"\n        },\n        \"enum\": {\n          \"$ref\": \"#/definitions/enum\"\n        },\n        \"multipleOf\": {\n          \"$ref\": \"#/definitions/multipleOf\"\n        }\n      }\n    },\n    \"formDataParameterSubSchema\": {\n      \"additionalProperties\": false,\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"properties\": {\n        \"required\": {\n          \"type\": \"boolean\",\n          \"description\": \"Determines whether or not this parameter is required or optional.\",\n          \"default\": false\n        },\n        \"in\": {\n          \"type\": \"string\",\n          \"description\": \"Determines the location of the parameter.\",\n          \"enum\": [\n            \"formData\"\n          ]\n        },\n        \"description\": {\n          \"type\": \"string\",\n          \"description\": \"A brief description of the parameter. This could contain examples of use.  Github-flavored markdown is allowed.\"\n        },\n        \"name\": {\n          \"type\": \"string\",\n          \"description\": \"The name of the parameter.\"\n        },\n        \"allowEmptyValue\": {\n          \"type\": \"boolean\",\n          \"default\": false,\n          \"description\": \"allows sending a parameter by name only or with an empty value.\"\n        },\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"string\",\n            \"number\",\n            \"boolean\",\n            \"integer\",\n            \"array\",\n            \"file\"\n          ]\n        },\n        \"format\": {\n          \"type\": \"string\"\n        },\n        \"items\": {\n          \"$ref\": \"#/definitions/primitivesItems\"\n        },\n        \"collectionFormat\": {\n          \"$ref\": \"#/definitions/collectionFormatWithMulti\"\n        },\n        \"default\": {\n          \"$ref\": \"#/definitions/default\"\n        },\n        \"maximum\": {\n          \"$ref\": \"#/definitions/maximum\"\n        },\n        \"exclusiveMaximum\": {\n          \"$ref\": \"#/definitions/exclusiveMaximum\"\n        },\n        \"minimum\": {\n          \"$ref\": \"#/definitions/minimum\"\n        },\n        \"exclusiveMinimum\": {\n          \"$ref\": \"#/definitions/exclusiveMinimum\"\n        },\n        \"maxLength\": {\n          \"$ref\": \"#/definitions/maxLength\"\n        },\n        \"minLength\": {\n          \"$ref\": \"#/definitions/minLength\"\n        },\n        \"pattern\": {\n          \"$ref\": \"#/definitions/pattern\"\n        },\n        \"maxItems\": {\n          \"$ref\": \"#/definitions/maxItems\"\n        },\n        \"minItems\": {\n          \"$ref\": \"#/definitions/minItems\"\n        },\n        \"uniqueItems\": {\n          \"$ref\": \"#/definitions/uniqueItems\"\n        },\n        \"enum\": {\n          \"$ref\": \"#/definitions/enum\"\n        },\n        \"multipleOf\": {\n          \"$ref\": \"#/definitions/multipleOf\"\n        }\n      }\n    },\n    \"pathParameterSubSchema\": {\n      \"additionalProperties\": false,\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"properties\": {\n        \"required\": {\n          \"type\": \"boolean\",\n          \"enum\": [\n            true\n          ],\n          \"description\": \"Determines whether or not this parameter is required or optional.\"\n        },\n        \"in\": {\n          \"type\": \"string\",\n          \"description\": \"Determines the location of the parameter.\",\n          \"enum\": [\n            \"path\"\n          ]\n        },\n        \"description\": {\n          \"type\": \"string\",\n          \"description\": \"A brief description of the parameter. This could contain examples of use.  Github-flavored markdown is allowed.\"\n        },\n        \"name\": {\n          \"type\": \"string\",\n          \"description\": \"The name of the parameter.\"\n        },\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"string\",\n            \"number\",\n            \"boolean\",\n            \"integer\",\n            \"array\"\n          ]\n        },\n        \"format\": {\n          \"type\": \"string\"\n        },\n        \"items\": {\n          \"$ref\": \"#/definitions/primitivesItems\"\n        },\n        \"collectionFormat\": {\n          \"$ref\": \"#/definitions/collectionFormat\"\n        },\n        \"default\": {\n          \"$ref\": \"#/definitions/default\"\n        },\n        \"maximum\": {\n          \"$ref\": \"#/definitions/maximum\"\n        },\n        \"exclusiveMaximum\": {\n          \"$ref\": \"#/definitions/exclusiveMaximum\"\n        },\n        \"minimum\": {\n          \"$ref\": \"#/definitions/minimum\"\n        },\n        \"exclusiveMinimum\": {\n          \"$ref\": \"#/definitions/exclusiveMinimum\"\n        },\n        \"maxLength\": {\n          \"$ref\": \"#/definitions/maxLength\"\n        },\n        \"minLength\": {\n          \"$ref\": \"#/definitions/minLength\"\n        },\n        \"pattern\": {\n          \"$ref\": \"#/definitions/pattern\"\n        },\n        \"maxItems\": {\n          \"$ref\": \"#/definitions/maxItems\"\n        },\n        \"minItems\": {\n          \"$ref\": \"#/definitions/minItems\"\n        },\n        \"uniqueItems\": {\n          \"$ref\": \"#/definitions/uniqueItems\"\n        },\n        \"enum\": {\n          \"$ref\": \"#/definitions/enum\"\n        },\n        \"multipleOf\": {\n          \"$ref\": \"#/definitions/multipleOf\"\n        }\n      }\n    },\n    \"nonBodyParameter\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"name\",\n        \"in\",\n        \"type\"\n      ],\n      \"oneOf\": [\n        {\n          \"$ref\": \"#/definitions/headerParameterSubSchema\"\n        },\n        {\n          \"$ref\": \"#/definitions/formDataParameterSubSchema\"\n        },\n        {\n          \"$ref\": \"#/definitions/queryParameterSubSchema\"\n        },\n        {\n          \"$ref\": \"#/definitions/pathParameterSubSchema\"\n        }\n      ]\n    },\n    \"parameter\": {\n      \"oneOf\": [\n        {\n          \"$ref\": \"#/definitions/bodyParameter\"\n        },\n        {\n          \"$ref\": \"#/definitions/nonBodyParameter\"\n        }\n      ]\n    },\n    \"schema\": {\n      \"type\": \"object\",\n      \"description\": \"A deterministic version of a JSON Schema object.\",\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      },\n      \"properties\": {\n        \"$ref\": {\n          \"type\": \"string\"\n        },\n        \"format\": {\n          \"type\": \"string\"\n        },\n        \"title\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/title\"\n        },\n        \"description\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/description\"\n        },\n        \"default\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/default\"\n        },\n        \"multipleOf\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/multipleOf\"\n        },\n        \"maximum\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/maximum\"\n        },\n        \"exclusiveMaximum\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum\"\n        },\n        \"minimum\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/minimum\"\n        },\n        \"exclusiveMinimum\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum\"\n        },\n        \"maxLength\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"\n        },\n        \"minLength\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"\n        },\n        \"pattern\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/pattern\"\n        },\n        \"maxItems\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"\n        },\n        \"minItems\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"\n        },\n        \"uniqueItems\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/uniqueItems\"\n        },\n        \"maxProperties\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"\n        },\n        \"minProperties\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"\n        },\n        \"required\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/stringArray\"\n        },\n        \"enum\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/enum\"\n        },\n        \"additionalProperties\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/additionalProperties\"\n        },\n        \"type\": {\n          \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/type\"\n        },\n        \"items\": {\n          \"anyOf\": [\n            {\n              \"$ref\": \"#/definitions/schema\"\n            },\n            {\n              \"type\": \"array\",\n              \"minItems\": 1,\n              \"items\": {\n                \"$ref\": \"#/definitions/schema\"\n              }\n            }\n          ],\n          \"default\": {}\n        },\n        \"allOf\": {\n          \"type\": \"array\",\n          \"minItems\": 1,\n          \"items\": {\n            \"$ref\": \"#/definitions/schema\"\n          }\n        },\n        \"properties\": {\n          \"type\": \"object\",\n          \"additionalProperties\": {\n            \"$ref\": \"#/definitions/schema\"\n          },\n          \"default\": {}\n        },\n        \"discriminator\": {\n          \"type\": \"string\"\n        },\n        \"readOnly\": {\n          \"type\": \"boolean\",\n          \"default\": false\n        },\n        \"xml\": {\n          \"$ref\": \"#/definitions/xml\"\n        },\n        \"externalDocs\": {\n          \"$ref\": \"#/definitions/externalDocs\"\n        },\n        \"example\": {}\n      },\n      \"additionalProperties\": false\n    },\n    \"primitivesItems\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"string\",\n            \"number\",\n            \"integer\",\n            \"boolean\",\n            \"array\"\n          ]\n        },\n        \"format\": {\n          \"type\": \"string\"\n        },\n        \"items\": {\n          \"$ref\": \"#/definitions/primitivesItems\"\n        },\n        \"collectionFormat\": {\n          \"$ref\": \"#/definitions/collectionFormat\"\n        },\n        \"default\": {\n          \"$ref\": \"#/definitions/default\"\n        },\n        \"maximum\": {\n          \"$ref\": \"#/definitions/maximum\"\n        },\n        \"exclusiveMaximum\": {\n          \"$ref\": \"#/definitions/exclusiveMaximum\"\n        },\n        \"minimum\": {\n          \"$ref\": \"#/definitions/minimum\"\n        },\n        \"exclusiveMinimum\": {\n          \"$ref\": \"#/definitions/exclusiveMinimum\"\n        },\n        \"maxLength\": {\n          \"$ref\": \"#/definitions/maxLength\"\n        },\n        \"minLength\": {\n          \"$ref\": \"#/definitions/minLength\"\n        },\n        \"pattern\": {\n          \"$ref\": \"#/definitions/pattern\"\n        },\n        \"maxItems\": {\n          \"$ref\": \"#/definitions/maxItems\"\n        },\n        \"minItems\": {\n          \"$ref\": \"#/definitions/minItems\"\n        },\n        \"uniqueItems\": {\n          \"$ref\": \"#/definitions/uniqueItems\"\n        },\n        \"enum\": {\n          \"$ref\": \"#/definitions/enum\"\n        },\n        \"multipleOf\": {\n          \"$ref\": \"#/definitions/multipleOf\"\n        }\n      }\n    },\n    \"security\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"$ref\": \"#/definitions/securityRequirement\"\n      },\n      \"uniqueItems\": true\n    },\n    \"securityRequirement\": {\n      \"type\": \"object\",\n      \"additionalProperties\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"string\"\n        },\n        \"uniqueItems\": true\n      }\n    },\n    \"xml\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"namespace\": {\n          \"type\": \"string\"\n        },\n        \"prefix\": {\n          \"type\": \"string\"\n        },\n        \"attribute\": {\n          \"type\": \"boolean\",\n          \"default\": false\n        },\n        \"wrapped\": {\n          \"type\": \"boolean\",\n          \"default\": false\n        }\n      }\n    },\n    \"tag\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"required\": [\n        \"name\"\n      ],\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        },\n        \"externalDocs\": {\n          \"$ref\": \"#/definitions/externalDocs\"\n        }\n      },\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      }\n    },\n    \"securityDefinitions\": {\n      \"type\": \"object\",\n      \"additionalProperties\": {\n        \"oneOf\": [\n          {\n            \"$ref\": \"#/definitions/basicAuthenticationSecurity\"\n          },\n          {\n            \"$ref\": \"#/definitions/apiKeySecurity\"\n          },\n          {\n            \"$ref\": \"#/definitions/oauth2ImplicitSecurity\"\n          },\n          {\n            \"$ref\": \"#/definitions/oauth2PasswordSecurity\"\n          },\n          {\n            \"$ref\": \"#/definitions/oauth2ApplicationSecurity\"\n          },\n          {\n            \"$ref\": \"#/definitions/oauth2AccessCodeSecurity\"\n          }\n        ]\n      }\n    },\n    \"basicAuthenticationSecurity\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"required\": [\n        \"type\"\n      ],\n      \"properties\": {\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"basic\"\n          ]\n        },\n        \"description\": {\n          \"type\": \"string\"\n        }\n      },\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      }\n    },\n    \"apiKeySecurity\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"required\": [\n        \"type\",\n        \"name\",\n        \"in\"\n      ],\n      \"properties\": {\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"apiKey\"\n          ]\n        },\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"in\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"header\",\n            \"query\"\n          ]\n        },\n        \"description\": {\n          \"type\": \"string\"\n        }\n      },\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      }\n    },\n    \"oauth2ImplicitSecurity\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"required\": [\n        \"type\",\n        \"flow\",\n        \"authorizationUrl\"\n      ],\n      \"properties\": {\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"oauth2\"\n          ]\n        },\n        \"flow\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"implicit\"\n          ]\n        },\n        \"scopes\": {\n          \"$ref\": \"#/definitions/oauth2Scopes\"\n        },\n        \"authorizationUrl\": {\n          \"type\": \"string\",\n          \"format\": \"uri\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        }\n      },\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      }\n    },\n    \"oauth2PasswordSecurity\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"required\": [\n        \"type\",\n        \"flow\",\n        \"tokenUrl\"\n      ],\n      \"properties\": {\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"oauth2\"\n          ]\n        },\n        \"flow\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"password\"\n          ]\n        },\n        \"scopes\": {\n          \"$ref\": \"#/definitions/oauth2Scopes\"\n        },\n        \"tokenUrl\": {\n          \"type\": \"string\",\n          \"format\": \"uri\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        }\n      },\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      }\n    },\n    \"oauth2ApplicationSecurity\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"required\": [\n        \"type\",\n        \"flow\",\n        \"tokenUrl\"\n      ],\n      \"properties\": {\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"oauth2\"\n          ]\n        },\n        \"flow\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"application\"\n          ]\n        },\n        \"scopes\": {\n          \"$ref\": \"#/definitions/oauth2Scopes\"\n        },\n        \"tokenUrl\": {\n          \"type\": \"string\",\n          \"format\": \"uri\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        }\n      },\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      }\n    },\n    \"oauth2AccessCodeSecurity\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"required\": [\n        \"type\",\n        \"flow\",\n        \"authorizationUrl\",\n        \"tokenUrl\"\n      ],\n      \"properties\": {\n        \"type\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"oauth2\"\n          ]\n        },\n        \"flow\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"accessCode\"\n          ]\n        },\n        \"scopes\": {\n          \"$ref\": \"#/definitions/oauth2Scopes\"\n        },\n        \"authorizationUrl\": {\n          \"type\": \"string\",\n          \"format\": \"uri\"\n        },\n        \"tokenUrl\": {\n          \"type\": \"string\",\n          \"format\": \"uri\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        }\n      },\n      \"patternProperties\": {\n        \"^x-\": {\n          \"$ref\": \"#/definitions/vendorExtension\"\n        }\n      }\n    },\n    \"oauth2Scopes\": {\n      \"type\": \"object\",\n      \"additionalProperties\": {\n        \"type\": \"string\"\n      }\n    },\n    \"mediaTypeList\": {\n      \"type\": \"array\",\n      \"items\": {\n        \"$ref\": \"#/definitions/mimeType\"\n      },\n      \"uniqueItems\": true\n    },\n    \"parametersList\": {\n      \"type\": \"array\",\n      \"description\": \"The parameters needed to send a valid API call.\",\n      \"additionalItems\": false,\n      \"items\": {\n        \"oneOf\": [\n          {\n            \"$ref\": \"#/definitions/parameter\"\n          },\n          {\n            \"$ref\": \"#/definitions/jsonReference\"\n          }\n        ]\n      },\n      \"uniqueItems\": true\n    },\n    \"schemesList\": {\n      \"type\": \"array\",\n      \"description\": \"The transfer protocol of the API.\",\n      \"items\": {\n        \"type\": \"string\",\n        \"enum\": [\n          \"http\",\n          \"https\",\n          \"ws\",\n          \"wss\"\n        ]\n      },\n      \"uniqueItems\": true\n    },\n    \"collectionFormat\": {\n      \"type\": \"string\",\n      \"enum\": [\n        \"csv\",\n        \"ssv\",\n        \"tsv\",\n        \"pipes\"\n      ],\n      \"default\": \"csv\"\n    },\n    \"collectionFormatWithMulti\": {\n      \"type\": \"string\",\n      \"enum\": [\n        \"csv\",\n        \"ssv\",\n        \"tsv\",\n        \"pipes\",\n        \"multi\"\n      ],\n      \"default\": \"csv\"\n    },\n    \"title\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/title\"\n    },\n    \"description\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/description\"\n    },\n    \"default\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/default\"\n    },\n    \"multipleOf\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/multipleOf\"\n    },\n    \"maximum\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/maximum\"\n    },\n    \"exclusiveMaximum\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/exclusiveMaximum\"\n    },\n    \"minimum\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/minimum\"\n    },\n    \"exclusiveMinimum\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/exclusiveMinimum\"\n    },\n    \"maxLength\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"\n    },\n    \"minLength\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"\n    },\n    \"pattern\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/pattern\"\n    },\n    \"maxItems\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveInteger\"\n    },\n    \"minItems\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/definitions/positiveIntegerDefault0\"\n    },\n    \"uniqueItems\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/uniqueItems\"\n    },\n    \"enum\": {\n      \"$ref\": \"http://json-schema.org/draft-04/schema#/properties/enum\"\n    },\n    \"jsonReference\": {\n      \"type\": \"object\",\n      \"additionalProperties\": false,\n      \"properties\": {\n        \"$ref\": {\n          \"type\": \"string\"\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "notes/spec-2.0.md",
    "content": "# Swagger RESTful API Documentation Specification\n\n#### Version 2.0\n\nThe key words \"MUST\", \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\", \"RECOMMENDED\", \"MAY\", and \"OPTIONAL\" in this document are to be interpreted as described in [RFC 2119](http://www.ietf.org/rfc/rfc2119.txt).\n\nThe Swagger specification is licensed under [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).\n\n## Introduction\n\nSwagger™  is a project used to describe and document RESTful APIs.\n\nThe Swagger specification defines a set of files required to describe such an API. These files can then be used by the Swagger-UI project to display the API and Swagger-Codegen to generate clients in various languages. Additional utilities can also take advantage of the resulting files, such as testing tools.\n\n## Revision History\n\nVersion | Date | Notes\n--- | --- | ---\n2.0 | 2014-09-08 | Release of Swagger 2.0\n1.2 | 2014-03-14 | Initial release of the formal document.\n1.1 | 2012-08-22 | Release of Swagger 1.1\n1.0 | 2011-08-10 | First release of the Swagger Specification\n\n## Definitions\n\n##### <a name=\"pathTemplating\"></a>Path Templating\nPath templating refers to the usage of curly braces ({}) to mark a section of a URL path as replaceable using path parameters.\n\n##### <a name=\"mimeTypes\"></a>Mime Types\nMime type definitions are spread across several resources. The mime type definitions should be in compliance with [RFC 6838](http://tools.ietf.org/html/rfc6838).\n\nSome examples of possible mime type definitions:\n```\n  text/plain; charset=utf-8\n  application/json\n  application/vnd.github+json\n  application/vnd.github.v3+json\n  application/vnd.github.v3.raw+json\n  application/vnd.github.v3.text+json\n  application/vnd.github.v3.html+json\n  application/vnd.github.v3.full+json\n  application/vnd.github.v3.diff\n  application/vnd.github.v3.patch\n```\n##### <a name=\"httpCodes\"></a>HTTP Status Codes\nThe HTTP Status Codes are used to indicate the status of the executed operation. The available status codes are described by [RFC 7231](http://tools.ietf.org/html/rfc7231#section-6) and in the [IANA Status Code Registry](http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).\n\n## Specification\n\n### Format\n\nThe files describing the RESTful API in accordance with the Swagger specification are represented as JSON objects and conform to the JSON standards. YAML, being a superset of JSON, can be used as well to \nrepresent a Swagger specification file.\n\nFor example, if a field is said to have an array value, the JSON array representation will be used:\n\n```js\n{\n   \"field\" : [...]\n}\n```\n\nWhile the API is described using JSON it does not impose a JSON input/output to the API itself.\n\nAll field names in the specification are **case sensitive**.\n\nThe schema exposes two types of fields. Fixed fields, which have a declared name, and Patterned fields, which declare a regex pattern for the field name. Patterned fields can have multiple occurrences as long as each has a unique name. \n\n### File Structure\n\nThe Swagger representation of the API is made of a single file. However, parts of the definitions can be split into separate files, at the discretion of the user. This is applicable for `$ref` fields in the specification as follows from the [JSON Schema](http://json-schema.org) definitions.\n\nBy convention, the Swagger specification file is named `swagger.json`.\n\n### Data Types\n\nPrimitive data types in the Swagger Specification are based on the types supported by the [JSON-Schema Draft 4](http://json-schema.org/latest/json-schema-core.html#anchor8). Models are described using the [Schema Object](#schemaObject) which is a subset of JSON Schema Draft 4.\n\nAn additional primitive data type `\"file\"` is used by the [Parameter Object](#parameterObject) and the [Response Object](#responseObject) to set the parameter type or the response as being a file.\n\n<a name=\"dataTypeFormat\"></a>Primitives have an optional modifier property `format`. Swagger uses several known formats to more finely define the data type being used. However, the `format` property is an open `string`-valued property, and can have any value to support documentation needs. Formats such as `\"email\"`, `\"uuid\"`, etc., can be used even though they are not defined by this specification. Types that are not accompanied by a `format` property follow their definition from the JSON Schema (except for `file` type which is defined above). The formats defined by the Swagger Specification are:\n\n\nCommon Name | [`type`](#dataTypeType) | [`format`](#dataTypeFormat) | Comments\n----------- | ------ | -------- | --------\ninteger | `integer` | `int32` | signed 32 bits\nlong | `integer` | `int64` | signed 64 bits\nfloat | `number` | `float` | \ndouble | `number` | `double` |\nstring | `string` | |\nbyte | `string` | `byte` |\nboolean | `boolean` | |\ndate | `string` | `date` | As defined by `full-date` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)\ndateTime | `string` | `date-time` | As defined by `date-time` - [RFC3339](http://xml2rfc.ietf.org/public/rfc/html/rfc3339.html#anchor14)\npassword | `string` | `password` | Used to hint UIs the input needs to be obscured.\n\n### Schema\n\n#### <a name=\"swaggerObject\"></a>Swagger Object\n\nThis is the root document object for the API specification. It combines what previously was the Resource Listing and API Declaration (version 1.2 and earlier) together into one document.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"swaggerSwagger\"></a>swagger | `string` | **Required.** Specifies the Swagger Specification version being used. It can be used by the Swagger UI and other clients to interpret the API listing. The value MUST be `\"2.0\"`.\n<a name=\"swaggerInfo\"></a>info | [Info Object](#infoObject) | **Required.** Provides metadata about the API. The metadata can be used by the clients if needed.\n<a name=\"swaggerHost\"></a>host | `string` | The host (name or ip) serving the API. This MUST be the host only and does not include the scheme nor sub-paths. It MAY include a port. If the `host` is not included, the host serving the documentation is to be used (including the port). The `host` does not support [path templating](#pathTemplating).\n<a name=\"swaggerBasePath\"></a>basePath | `string` | The base path on which the API is served, which is relative to the [`host`](#swaggerHost). If it is not included, the API is served directly under the `host`. The value MUST start with a leading slash (`/`). The `basePath` does not support [path templating](#pathTemplating). \n<a name=\"swaggerSchemes\"></a>schemes | [`string`] | The transfer protocol of the API. Values MUST be from the list: `\"http\"`, `\"https\"`, `\"ws\"`, `\"wss\"`. If the `schemes` is not included, the default scheme to be used is the one used to access the specification.\n<a name=\"swaggerConsumes\"></a>consumes | [`string`] | A list of MIME types the APIs can consume. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under [Mime Types](#mimeTypes).\n<a name=\"swaggerProduces\"></a>produces | [`string`] | A list of MIME types the APIs can produce. This is global to all APIs but can be overridden on specific API calls. Value MUST be as described under [Mime Types](#mimeTypes).\n<a name=\"swaggerPaths\"></a>paths | [Paths Object](#pathsObject) | **Required.** The available paths and operations for the API.\n<a name=\"swaggerDefinitions\"></a>definitions | [Definitions Object](#definitionsObject) | An object to hold data types produced and consumed by operations.\n<a name=\"swaggerParameters\"></a>parameters | [Parameters Definitions Object](#parametersDefinitionsObject) | An object to hold parameters that can be used across operations. This property *does not* define global parameters for all operations.\n<a name=\"swaggerResponses\"></a>responses | [Responses Definitions Object](#responsesDefinitionsObject) | An object to hold responses that can be used across operations. This property *does not* define global responses for all operations.\n<a name=\"swaggerSecurityDefinitions\"></a>securityDefinitions | [Security Definitions Object](#securityDefinitionsObject) | Security scheme definitions that can be used across the specification.\n<a name=\"swaggerSecurity\"></a>security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security schemes are applied for the API as a whole. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). Individual operations can override this definition.\n<a name=\"swaggerTags\"></a>tags | [[Tag Object](#tagObject)] | A list of tags used by the specification with additional metadata. The order of the tags can be used to reflect on their order by the parsing tools. Not all tags that are used by the [Operation Object](#operationObject) must be declared. The tags that are not declared may be organized randomly or based on the tools' logic. Each tag name in the list MUST be unique.\n<a name=\"swaggerExternalDocs\"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation.\n\n\n#### <a name=\"infoObject\"></a>Info Object\n\nThe object provides metadata about the API. The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"infoTitle\"></a>title | `string` | **Required.** The title of the application.\n<a name=\"infoDescription\"></a>description | `string` | A short description of the application. [GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation.\n<a name=\"infoTermsOfService\"></a>termsOfService | `string` | The Terms of Service for the API.\n<a name=\"infoContact\"></a>contact | [Contact Object](#contactObject) | The contact information for the exposed API.\n<a name=\"infoLicense\"></a>license | [License Object](#licenseObject) | The license information for the exposed API.\n<a name=\"infoVersion\"></a>version | `string` | **Required** Provides the version of the application API (not to be confused with the specification version).\n\n##### Patterned Objects \n\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"operationExtensions\"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.\n\n##### Info Object Example:\n\n```js\n{\n  \"title\": \"Swagger Sample App\",\n  \"description\": \"This is a sample server Petstore server.\",\n  \"termsOfService\": \"http://swagger.io/terms/\",\n  \"contact\": {\n    \"name\": \"API Support\",\n    \"url\": \"http://www.swagger.io/support\",\n    \"email\": \"support@swagger.io\"\n  },\n  \"license\": {\n    \"name\": \"Apache 2.0\",\n    \"url\": \"http://www.apache.org/licenses/LICENSE-2.0.html\"\n  },\n  \"version\": \"1.0.1\"\n}\n```\n\n```yaml\ntitle: Swagger Sample App\ndescription: This is a sample server Petstore server.\ntermsOfService: http://swagger.io/terms/\ncontact:\n  name: API Support\n  url: http://www.swagger.io/support\n  email: support@swagger.io\nlicense:\n  name: Apache 2.0\n  url: http://www.apache.org/licenses/LICENSE-2.0.html\nversion: 1.0.1\n```\n\n#### <a name=\"contactObject\"></a>Contact Object\n\nContact information for the exposed API.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"contactName\"></a>name | `string` | The identifying name of the contact person/organization.\n<a name=\"contactUrl\"></a>url | `string` | The URL pointing to the contact information. MUST be in the format of a URL.\n<a name=\"contactEmail\"></a>email | `string` | The email address of the contact person/organization. MUST be in the format of an email address.\n\n##### Contact Object Example:\n\n```js\n{\n  \"name\": \"API Support\",\n  \"url\": \"http://www.swagger.io/support\",\n  \"email\": \"support@swagger.io\"\n}\n```\n\n```yaml\nname: API Support\nurl: http://www.swagger.io/support\nemail: support@swagger.io\n```\n\n#### <a name=\"licenseObject\"></a>License Object\n\nLicense information for the exposed API.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"licenseName\"></a>name | `string` | **Required.** The license name used for the API.\n<a name=\"licenseUrl\"></a>url | `string` | A URL to the license used for the API. MUST be in the format of a URL.\n\n##### License Object Example:\n\n```js\n{\n  \"name\": \"Apache 2.0\",\n  \"url\": \"http://www.apache.org/licenses/LICENSE-2.0.html\"\n}\n```\n\n```yaml\nname: Apache 2.0\nurl: http://www.apache.org/licenses/LICENSE-2.0.html\n```\n\n#### <a name=\"pathsObject\"></a>Paths Object\n\nHolds the relative paths to the individual endpoints. The path is appended to the [`basePath`](#swaggerBasePath) in order to construct the full URL.\nThe Paths may be empty, due to [ACL constraints](#securityFiltering).\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"pathsPath\"></a>/{path} | [Path Item Object](#pathItemObject) | A relative path to an individual endpoint. The field name MUST begin with a slash. The path is appended to the [`basePath`](#swaggerBasePath) in order to construct the full URL. [Path templating](#pathTemplating) is allowed.\n<a name=\"pathsExtensions\"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details. \n\n##### Paths Object Example\n\n```js\n{\n  \"/pets\": {\n    \"get\": {\n      \"description\": \"Returns all pets from the system that the user has access to\",\n      \"produces\": [\n        \"application/json\"\n      ],\n      \"responses\": {\n        \"200\": {\n          \"description\": \"A list of pets.\",\n          \"schema\": {\n            \"type\": \"array\",\n            \"items\": {\n              \"$ref\": \"#/definitions/pet\"\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n```yaml\n/pets:\n  get:\n    description: Returns all pets from the system that the user has access to\n    produces:\n    - application/json\n    responses:\n      200:\n        description: A list of pets.\n        schema:\n          type: array\n          items:\n            $ref: '#/definitions/pet'\n```\n\n#### <a name=\"pathItemObject\"></a>Path Item Object\n\nDescribes the operations available on a single path.\nA Path Item may be empty, due to [ACL constraints](#securityFiltering). The path itself is still exposed to the documentation viewer but they will not know which operations and parameters are available.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"pathItemRef\"></a>$ref | `string` | Allows for an external definition of this path item. The referenced structure MUST be in the format of a [Path Item Object](#pathItemObject). If there are conflicts between the referenced definition and this Path Item's definition, the behavior is *undefined*.\n<a name=\"pathItemGet\"></a>get | [Operation Object](#operationObject) | A definition of a GET operation on this path.\n<a name=\"pathItemPut\"></a>put | [Operation Object](#operationObject) | A definition of a PUT operation on this path.\n<a name=\"pathItemPost\"></a>post | [Operation Object](#operationObject) | A definition of a POST operation on this path.\n<a name=\"pathItemDelete\"></a>delete | [Operation Object](#operationObject) | A definition of a DELETE operation on this path.\n<a name=\"pathItemOptions\"></a>options | [Operation Object](#operationObject) | A definition of a OPTIONS operation on this path.\n<a name=\"pathItemHead\"></a>head | [Operation Object](#operationObject) | A definition of a HEAD operation on this path.\n<a name=\"pathItemPatch\"></a>patch | [Operation Object](#operationObject) | A definition of a PATCH operation on this path.\n<a name=\"pathItemParameters\"></a>parameters | [[Parameter Object](#parameterObject) <span>&#124;</span> [Reference Object](#referenceObject)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [Swagger Object's parameters](#swaggerParameters). There can be one \"body\" parameter at most.\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"pathItemExtensions\"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details. \n\n##### Path Item Object Example\n\n```js\n{\n  \"get\": {\n    \"description\": \"Returns pets based on ID\",\n    \"summary\": \"Find pets by ID\",\n    \"operationId\": \"getPetsById\",\n    \"produces\": [\n      \"application/json\",\n      \"text/html\"\n    ],\n    \"responses\": {\n      \"200\": {\n        \"description\": \"pet response\",\n        \"schema\": {\n          \"type\": \"array\",\n          \"items\": {\n            \"$ref\": \"#/definitions/Pet\"\n          }\n        }\n      },\n      \"default\": {\n        \"description\": \"error payload\",\n        \"schema\": {\n          \"$ref\": \"#/definitions/ErrorModel\"\n        }\n      }\n    }\n  },\n  \"parameters\": [\n    {\n      \"name\": \"id\",\n      \"in\": \"path\",\n      \"description\": \"ID of pet to use\",\n      \"required\": true,\n      \"type\": \"array\",\n      \"items\": {\n        \"type\": \"string\"\n      },\n      \"collectionFormat\": \"csv\"\n    }\n  ]\n}\n```\n\n```yaml\nget:\n  description: Returns pets based on ID\n  summary: Find pets by ID\n  operationId: getPetsById\n  produces:\n  - application/json\n  - text/html\n  responses:\n    200:\n      description: pet response\n      schema:\n        type: array\n        items:\n          $ref: '#/definitions/Pet'\n    default:\n      description: error payload\n      schema:\n        $ref: '#/definitions/ErrorModel'\nparameters:\n- name: id\n  in: path\n  description: ID of pet to use\n  required: true\n  type: array\n  items:\n    type: string\n  collectionFormat: csv\n```\n\n#### <a name=\"operationObject\"></a>Operation Object\n\nDescribes a single API operation on a path.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"operationTags\"></a>tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.\n<a name=\"operationSummary\"></a>summary | `string` | A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.\n<a name=\"operationDescription\"></a>description | `string` | A verbose explanation of the operation behavior. [GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation.\n<a name=\"operationExternalDocs\"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this operation.\n<a name=\"operationId\"></a>operationId | `string` | A friendly name for the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operation id to uniquely identify an operation.\n<a name=\"operationConsumes\"></a>consumes | [`string`] | A list of MIME types the operation can consume. This overrides the [`consumes`](#swaggerConsumes) definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under [Mime Types](#mimeTypes).\n<a name=\"operationProduces\"></a>produces | [`string`] | A list of MIME types the operation can produce. This overrides the [`produces`](#swaggerProduces) definition at the Swagger Object. An empty value MAY be used to clear the global definition. Value MUST be as described under [Mime Types](#mimeTypes).\n<a name=\"operationParameters\"></a>parameters | [[Parameter Object](#parameterObject) <span>&#124;</span> [Reference Object](#referenceObject)] | A list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](#pathItemParameters), the new definition will override it, but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [Swagger Object's parameters](#swaggerParameters). There can be one \"body\" parameter at most.\n<a name=\"operationResponses\"></a>responses | [Responses Object](#responsesObject) | **Required.** The list of possible responses as they are returned from executing this operation.\n<a name=\"operationSchemes\"></a>schemes | [`string`] | The transfer protocol for the operation. Values MUST be from the list: `\"http\"`, `\"https\"`, `\"ws\"`, `\"wss\"`. The value overrides the Swagger Object [`schemes`](#swaggerSchemes) definition. \n<a name=\"operationDeprecated\"></a>deprecated | `boolean` | Declares this operation to be deprecated. Usage of the declared operation should be refrained. Default value is `false`.\n<a name=\"operationSecurity\"></a>security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security schemes are applied for this operation. The list of values describes alternative security schemes that can be used (that is, there is a logical OR between the security requirements). This definition overrides any declared top-level [`security`](#swaggerSecurity). To remove a top-level security declaration, an empty array can be used.\n\n##### Patterned Objects \n\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"operationExtensions\"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.\n\n##### Operation Object Example\n\n```js\n{\n  \"tags\": [\n    \"pet\"\n  ],\n  \"summary\": \"Updates a pet in the store with form data\",\n  \"description\": \"\",\n  \"operationId\": \"updatePetWithForm\",\n  \"consumes\": [\n    \"application/x-www-form-urlencoded\"\n  ],\n  \"produces\": [\n    \"application/json\",\n    \"application/xml\"\n  ],\n  \"parameters\": [\n    {\n      \"name\": \"petId\",\n      \"in\": \"path\",\n      \"description\": \"ID of pet that needs to be updated\",\n      \"required\": true,\n      \"type\": \"string\"\n    },\n    {\n      \"name\": \"name\",\n      \"in\": \"formData\",\n      \"description\": \"Updated name of the pet\",\n      \"required\": false,\n      \"type\": \"string\"\n    },\n    {\n      \"name\": \"status\",\n      \"in\": \"formData\",\n      \"description\": \"Updated status of the pet\",\n      \"required\": false,\n      \"type\": \"string\"\n    }\n  ],\n  \"responses\": {\n    \"200\": {\n      \"description\": \"Pet updated.\"\n    },\n    \"405\": {\n      \"description\": \"Invalid input\"\n    }\n  },\n  \"security\": [\n    {\n      \"petstore_auth\": [\n        \"write:pets\",\n        \"read:pets\"\n      ]\n    }\n  ]\n}\n```\n\n```yaml\ntags:\n- pet\nsummary: Updates a pet in the store with form data\ndescription: \"\"\noperationId: updatePetWithForm\nconsumes:\n- application/x-www-form-urlencoded\nproduces:\n- application/json\n- application/xml\nparameters:\n- name: petId\n  in: path\n  description: ID of pet that needs to be updated\n  required: true\n  type: string\n- name: name\n  in: formData\n  description: Updated name of the pet\n  required: false\n  type: string\n- name: status\n  in: formData\n  description: Updated status of the pet\n  required: false\n  type: string\nresponses:\n  200:\n    description: Pet updated.\n  405:\n    description: Invalid input\nsecurity:\n- petstore_auth:\n  - write:pets\n  - read:pets\n```\n\n\n#### <a name=\"externalDocumentationObject\"></a>External Documentation Object\n\nAllows referencing an external resource for extended documentation.\n\n##### Fixed Fields\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"externalDocDescription\"></a>description | `string` | A short description of the target documentation. [GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation.\n<a name=\"externalDocUrl\"></a>url | `string` | **Required.** The URL for the target documentation. Value MUST be in the format of a URL.\n\n##### External Documentation Object Example\n\n```js\n{\n  \"description\": \"Find more info here\",\n  \"url\": \"https://swagger.io\"\n}\n```\n\n```yaml\ndescription: Find more info here\nurl: https://swagger.io\n```\n\n#### <a name=\"parameterObject\"></a>Parameter Object\n\nDescribes a single operation parameter.\n\nA unique parameter is defined by a combination of a [name](#parameterName) and [location](#parameterIn).\n\nThere are five possible parameter types.\n* Path - Used together with [Path Templating](#pathTemplating), where the parameter value is actually part of the operation's URL. This does not include the host or base path of the API. For example, in `/items/{itemId}`, the path parameter is `itemId`.\n* Query - Parameters that are appended to the URL. For example, in `/items?id=###`, the query parameter is `id`.\n* Header - Custom headers that are expected as part of the request.\n* Body - The payload that's appended to the HTTP request. Since there can only be one payload, there can only be *one* body parameter. The name of the body parameter has no effect on the parameter itself and is used for documentation purposes only. Since Form parameters are also in the payload, body and form parameters cannot exist together for the same operation.\n* Form - Used to describe the payload of an HTTP request when either `application/x-www-form-urlencoded` or `multipart/form-data` are used as the content type of the request (in Swagger's definition, the [`consumes`](#operationConsumes) property of an operation). This is the only parameter type that can be used to send files, thus supporting the `file` type. Since form parameters are sent in the payload, they cannot be declared together with a body parameter for the same operation. Form parameters have a different format based on the content-type used (for further details, consult http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4):\n  * `application/x-www-form-urlencoded` - Similar to the format of Query parameters but as a payload. For example, `foo=1&bar=swagger` - both `foo` and `bar` are form parameters. This is normally used for simple parameters that are being transferred.\n  * `multipart/form-data` - each parameter takes a section in the payload with an internal header. For example, for the header `Content-Disposition: form-data; name=\"submit-name\"` the name of the parameter is `submit-name`. This type of form parameters is more commonly used for file transfers.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\n<a name=\"parameterName\"></a>name | `string` | **Required.** The name of the parameter. Parameter names are *case sensitive*. <ul><li>If [`in`](#parameterIn) is `\"path\"`, the `name` field MUST correspond to the associated path segment from the [path](#pathsPath) field in the [Paths Object](#pathsObject). See [Path Templating](#pathTemplating) for further information.<li>For all other cases, the `name` corresponds to the parameter name used based on the [`in`](#parameterIn) property.</ul>\n<a name=\"parameterIn\"></a>in | `string` | **Required.** The location of the parameter. Possible values are \"query\", \"header\", \"path\", \"formData\" or \"body\".\n<a name=\"parameterDescription\"></a>description | `string` | A brief description of the parameter. This could contain examples of use.  [GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation.\n<a name=\"parameterRequired\"></a>required | `boolean` | Determines whether this parameter is mandatory. If the parameter is [`in`](#parameterIn) \"path\", this property is **required** and its value MUST be `true`. Otherwise, the property MAY be included and its default value is `false`. \n\nIf [`in`](#parameterIn) is `\"body\"`:\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"parameterSchema\"></a>schema | [Schema Object](#schemaObject) | **Required.** The schema defining the type used for the body parameter.\n\nIf [`in`](#parameterIn) is any value other than `\"body\"`:\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"parameterType\"></a>type | `string` | **Required.** The type of the parameter. Since the parameter is not located at the request body, it is limited to simple types (that is, not an object). The value MUST be one of `\"string\"`, `\"number\"`, `\"integer\"`, `\"boolean\"`, `\"array\"` or `\"file\"`. If `type` is `\"file\"`, the [`consumes`](#operationConsumes) MUST be either `\"multipart/form-data\"` or `\" application/x-www-form-urlencoded\"` and the parameter MUST be [`in`](#parameterIn) `\"formData\"`.\n<a name=\"parameterFormat\"></a>format | `string` | The extending format for the previously mentioned [`type`](#parameterType). See [Data Type Formats](#dataTypeFormat) for further details.\n<a name=\"parameterAllowEmptyValue\"/>allowEmptyValue | `boolean` | Sets the ability to pass empty-valued parameters. This is valid only for either `query` or `formData` parameters and allows you to send a parameter with a name only or  an empty value. Default value is `false`.\n<a name=\"parameterItems\"></a>items | [Items Object](#itemsObject) | **Required if [`type`](#parameterType) is \"array\".** Describes the type of items in the array.\n<a name=\"parameterCollectionFormat\"></a>collectionFormat | `string` | Determines the format of the array if type array is used. Possible values are: <ul><li>`csv` - comma separated values `foo,bar`. <li>`ssv` - space separated values `foo bar`. <li>`tsv` - tab separated values `foo\\tbar`. <li>`pipes` - pipe separated values <code>foo&#124;bar</code>. <li>`multi` - corresponds to multiple parameter instances instead of multiple values for a single instance `foo=bar&foo=baz`. This is valid only for parameters [`in`](#parameterIn) \"query\" or \"formData\". </ul> Default value is `csv`.\n<a name=\"parameterDefault\"></a>default | * | Sets a default value to the parameter. See http://json-schema.org/latest/json-schema-validation.html#anchor101. Unlike JSON Schema this value MUST conform to the defined [`type`](#parameterType) for this parameter.\n<a name=\"parameterMaximum\"></a>maximum | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor17.\n<a name=\"parameterExclusiveMaximum\"></a>exclusiveMaximum | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor17.\n<a name=\"parameterMinimum\"></a>minimum | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor21.\n<a name=\"parameterExclusiveMinimum\"></a>exclusiveMinimum | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor21.\n<a name=\"parameterMaxLength\"></a>maxLength | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor26.\n<a name=\"parameterMinLength\"></a>minLength | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor29.\n<a name=\"parameterPattern\"></a>pattern | `string` | See http://json-schema.org/latest/json-schema-validation.html#anchor33.\n<a name=\"parameterMaxItems\"></a>maxItems | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor42.\n<a name=\"parameterMinItems\"></a>minItems | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor45.\n<a name=\"parameterUniqueItems\"></a>uniqueItems | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor49.\n<a name=\"parameterEnum\"></a>enum | [*] | See http://json-schema.org/latest/json-schema-validation.html#anchor76.\n<a name=\"parameterMultipleOf\"></a>multipleOf | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor14.\n\n\n##### Patterned Fields\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"parameterExtensions\"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.\n\n\n##### Parameter Object Examples\n\n###### Body Parameters\n\nA body parameter with a referenced schema definition (normally for a model definition):\n```js\n{\n  \"name\": \"user\",\n  \"in\": \"body\",\n  \"description\": \"user to add to the system\",\n  \"required\": true,\n  \"schema\": {\n    \"$ref\": \"#/definitions/User\"\n  }\n}\n```\n\n```yaml\nname: user\nin: body\ndescription: user to add to the system\nrequired: true\nschema:\n  $ref: '#/definitions/User'\n```\n\nA body parameter that is an array of string values:\n```js\n{\n  \"name\": \"user\",\n  \"in\": \"body\",\n  \"description\": \"user to add to the system\",\n  \"required\": true,\n  \"schema\": {\n    \"type\": \"array\",\n    \"items\": {\n      \"type\": \"string\"\n    }\n  }\n}\n```\n\n```yaml\nname: user\nin: body\ndescription: user to add to the system\nrequired: true\nschema:\n  type: array\n  items:\n    type: string\n```\n\n###### Other Parameters\n\nA header parameter with an array of 64 bit integer numbers:\n\n```js\n{\n  \"name\": \"token\",\n  \"in\": \"header\",\n  \"description\": \"token to be passed as a header\",\n  \"required\": true,\n  \"type\": \"array\",\n  \"items\": {\n    \"type\": \"integer\",\n    \"format\": \"int64\"\n  },\n  \"collectionFormat\": \"csv\"\n}\n```\n\n```yaml\nname: token\nin: header\ndescription: token to be passed as a header\nrequired: true\ntype: array\nitems:\n  type: integer\n  format: int64\ncollectionFormat: csv\n```\n\nA path parameter of a string value:\n```js\n{\n  \"name\": \"username\",\n  \"in\": \"path\",\n  \"description\": \"username to fetch\",\n  \"required\": true,\n  \"type\": \"string\"\n}\n```\n\n```yaml\nname: username\nin: path\ndescription: username to fetch\nrequired: true\ntype: string\n```\n\nAn optional query parameter of a string value, allowing multiple values by repeating the query parameter:\n```js\n{\n  \"name\": \"id\",\n  \"in\": \"query\",\n  \"description\": \"ID of the object to fetch\",\n  \"required\": false,\n  \"type\": \"array\",\n  \"items\": {\n    \"type\": \"string\"\n  },\n  \"collectionFormat\": \"multi\"\n}\n```\n\n```yaml\nname: id\nin: query\ndescription: ID of the object to fetch\nrequired: false\ntype: array\nitems:\n  type: string\ncollectionFormat: multi\n```\n\nA form data with file type for a file upload:\n```js\n{\n  \"name\": \"avatar\",\n  \"in\": \"formData\",\n  \"description\": \"The avatar of the user\",\n  \"required\": true,\n  \"type\": \"file\"\n}\n```\n\n```yaml\nname: avatar\nin: formData\ndescription: The avatar of the user\nrequired: true\ntype: file\n```\n\n#### <a name=\"itemsObject\"></a>Items Object\n\nAn limited subset of JSON-Schema's items object. It is used by parameter definitions that are not located [`in`](#parameterIn) `\"body\"`.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\n<a name=\"itemsType\"></a>type | `string` | **Required.** The internal type of the array. The value MUST be one of `\"string\"`, `\"number\"`, `\"integer\"`, `\"boolean\"`, or `\"array\"`. Files and models are not allowed.\n<a name=\"itemsFormat\"></a>format | `string` | The extending format for the previously mentioned [`type`](#parameterType). See [Data Type Formats](#dataTypeFormat) for further details.\n<a name=\"itemsItems\"></a>items | [Items Object](#itemsObject) | **Required if [`type`](#itemsType) is \"array\".** Describes the type of items in the array.\n<a name=\"itemsCollectionFormat\"></a>collectionFormat | `string` | Determines the format of the array if type array is used. Possible values are: <ul><li>`csv` - comma separated values `foo,bar`. <li>`ssv` - space separated values `foo bar`. <li>`tsv` - tab separated values `foo\\tbar`. <li>`pipes` - pipe separated values <code>foo&#124;bar</code>. </ul> Default value is `csv`.\n<a name=\"itemsDefault\"></a>default | * | Sets a default value to the data type. See http://json-schema.org/latest/json-schema-validation.html#anchor101. Unlike JSON Schema this value MUST conform to the defined [`type`](#itemsType) for the data type.\n<a name=\"itemsMaximum\"></a>maximum | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor17.\n<a name=\"itemsMaximum\"></a>exclusiveMaximum | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor17.\n<a name=\"itemsMinimum\"></a>minimum | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor21.\n<a name=\"itemsExclusiveMinimum\"></a>exclusiveMinimum | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor21.\n<a name=\"itemsMaxLength\"></a>maxLength | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor26.\n<a name=\"itemsMinLength\"></a>minLength | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor29.\n<a name=\"itemsPattern\"></a>pattern | `string` | See http://json-schema.org/latest/json-schema-validation.html#anchor33.\n<a name=\"itemsMaxItems\"></a>maxItems | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor42.\n<a name=\"itemsMinItems\"></a>minItems | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor45.\n<a name=\"itemsUniqueItems\"></a>uniqueItems | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor49.\n<a name=\"itemsEnum\"></a>enum | [*] | See http://json-schema.org/latest/json-schema-validation.html#anchor76.\n<a name=\"itemsMultipleOf\"></a>multipleOf | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor14.\n\n##### Items Object Examples\n\nItems must be of type  string and have the minimum length of  2 characters:\n\n```js\n{\n    \"type\": \"string\",\n    \"minLength\": 2\n}\n```\n\n```yaml\ntype: string\nminLength: 2\n```\n\nAn array of arrays, the internal array being of type integer, numbers must be between 0 and 63 (inclusive):\n\n```js\n{\n    \"type\": \"array\",\n    \"items\": {\n        \"type\": \"integer\",\n        \"minimum\": 0,\n        \"maximum\": 63\n    }\n}\n```\n\n```yaml\ntype: array\nitems:\n  type: integer\n  minimum: 0\n  maximum: 63\n```\n\n#### <a name=\"responsesObject\"></a>Responses Object\n\nA container for the expected responses of an operation. The container maps a HTTP response code to the expected response. It is not expected from the documentation to necessarily cover all possible HTTP response codes, since they may not be known in advance. However, it is expected from the documentation to cover a successful operation response and any known errors.\n\nThe `default` can be used a default response object for all HTTP codes that are not covered individually by the specification.\n\nThe `Responses Object` MUST contain at least one response code, and it SHOULD be the response for a successful operation call.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\n<a name=\"responsesDefault\"></a>default | [Response Object](#responseObject) <span>&#124;</span> [Reference Object](#referenceObject) | The documentation of responses other than the ones declared for specific HTTP response codes. It can be used to cover undeclared responses. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [Swagger Object's responses](#swaggerResponses) section.\n\n##### Patterned Fields\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"responsesCode\"></a>{[HTTP Status Code](#httpCodes)} | [Response Object](#responseObject) <span>&#124;</span> [Reference Object](#referenceObject) | Any [HTTP status code](#httpCodes) can be used as the property name (one property per HTTP status code). Describes the expected response for that HTTP status code.  [Reference Object](#referenceObject) can be used to link to a response that is defined at the [Swagger Object's responses](#swaggerResponses) section.\n<a name=\"parameterExtensions\"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.\n\n\n##### Responses Object Example\n\nA 200 response for successful operation and a default response for others (implying an error):\n\n```js\n{\n  \"200\": {\n    \"description\": \"a pet to be returned\",\n    \"schema\": {\n      \"$ref\": \"#/definitions/Pet\"\n    }\n  },\n  \"default\": {\n    \"description\": \"Unexpected error\",\n    \"schema\": {\n      \"$ref\": \"#/definitions/ErrorModel\"\n    }\n  }\n}\n```\n\n```yaml\n200:\n  description: a pet to be returned\n  schema:\n    $ref: '#/definitions/Pet'\ndefault:\n  description: Unexpected error\n  schema:\n    $ref: '#/definitions/ErrorModel'\n```\n\n#### <a name=\"responseObject\"></a>Response Object\nDescribes a single response from an API Operation.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\n<a name=\"responseDescription\"></a>description | `string` | **Required.** A short description of the response. [GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation.\n<a name=\"responseSchema\"></a>schema | [Schema Object](#schemaObject) | A definition of the response structure. It can be a primitive, an array or an object. If this field does not exist, it means no content is returned as part of the response. As an extension to the [Schema Object](#schemaObject), its root `type` value may also be `\"file\"`. This SHOULD be accompanied by a relevant `produces` mime-type.\n<a name=\"responseHeaders\"></a>headers | [Headers Object](#headersObject) | A list of headers that are sent with the response.\n<a name=\"responseExamples\"></a>examples | [Example Object](#exampleObject) | An example of the response message.\n\n##### Response Object Examples\n\nResponse of an array of a complex type:\n\n```js\n{\n  \"description\": \"A complex object array response\",\n  \"schema\": {\n    \"type\": \"array\",\n    \"items\": {\n      \"$ref\": \"#/definitions/VeryComplexType\"\n    }\n  }\n}\n```\n\n```yaml\ndescription: A complex object array response\nschema:\n  type: array\n  items:\n    $ref: '#/definitions/VeryComplexType'\n```\n\nResponse with a string type:\n\n```js\n{\n  \"description\": \"A simple string response\",\n  \"schema\": {\n    \"type\": \"string\"\n  }\n}\n```\n\n```yaml\ndescription: A simple string response\nschema:\n  type: string\n```\n\nResponse with headers:\n\n```js\n{\n  \"description\": \"A simple string response\",\n  \"schema\": {\n    \"type\": \"string\"\n  },\n  \"headers\": {\n    \"X-Rate-Limit-Limit\": {\n      \"description\": \"The number of allowed requests in the current period\",\n      \"type\": \"integer\"\n    },\n    \"X-Rate-Limit-Remaining\": {\n      \"description\": \"The number of remaining requests in the current period\",\n      \"type\": \"integer\"\n    },\n    \"X-Rate-Limit-Reset\": {\n      \"description\": \"The number of seconds left in the current period\",\n      \"type\": \"integer\"\n    }\n  }\n}\n```\n\n```yaml\ndescription: A simple string response\nschema:\n  type: string\nheaders:\n  X-Rate-Limit-Limit:\n    description: The number of allowed requests in the current period\n    type: integer\n  X-Rate-Limit-Remaining:\n    description: The number of remaining requests in the current period\n    type: integer\n  X-Rate-Limit-Reset:\n    description: The number of seconds left in the current period\n    type: integer\n```\n\nResponse with no return value:\n\n```js\n{\n  \"description\": \"object created\"\n}\n```\n\n```yaml\ndescription: object created\n```\n\n#### <a name=\"headersObject\"></a>Headers Object\nLists the headers that can be sent as part of a response.\n\n##### Patterned Fields\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"headersName\"></a>{name} | [Header Object](#headerObject) | The name of the property corresponds to the name of the header. The value describes the type of the header.\n\n##### Headers Object Example\n\nRate-limit headers:\n\n```js\n{\n    \"X-Rate-Limit-Limit\": {\n        \"description\": \"The number of allowed requests in the current period\",\n        \"type\": \"integer\"\n    },\n    \"X-Rate-Limit-Remaining\": {\n        \"description\": \"The number of remaining requests in the current period\",\n        \"type\": \"integer\"\n    },\n    \"X-Rate-Limit-Reset\": {\n        \"description\": \"The number of seconds left in the current period\",\n        \"type\": \"integer\"\n    }\n}\n```\n\n```yaml\nX-Rate-Limit-Limit:\n  description: The number of allowed requests in the current period\n  type: integer\nX-Rate-Limit-Remaining:\n  description: The number of remaining requests in the current period\n  type: integer\nX-Rate-Limit-Reset:\n  description: The number of seconds left in the current period\n  type: integer\n```\n\n#### <a name=\"exampleObject\"></a>Example Object\n\nAllows sharing examples for operation responses.\n\n##### Patterned Fields\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"exampleMimeType\"></a>{[mime type](#mimeTypes)} | Any | The name of the property MUST be one of the Operation `produces` values (either implicit or inherited). The value SHOULD be an example of what such a response would look like. \n\n##### Example Object Example\n\nExample response for application/json mimetype of a Pet data type:\n\n```js\n{\n  \"application/json\": {\n    \"name\": \"Puma\",\n    \"type\": \"Dog\",\n    \"color\": \"Black\",\n    \"gender\": \"Female\",\n    \"breed\": \"Mixed\"\n  }\n}\n```\n\n```yaml\napplication/json:\n  name: Puma\n  type: Dog\n  color: Black\n  gender: Female\n  breed: Mixed\n```\n\n#### <a name=\"headerObject\"></a>Header Object\n\nField Name | Type | Description\n---|:---:|---\n<a name=\"headerDescription\"></a>description | `string` | A short description of the header.\n<a name=\"headerType\"></a>type | `string` | **Required.** The type of the object. The value MUST be one of `\"string\"`, `\"number\"`, `\"integer\"`, `\"boolean\"`, or `\"array\"`.\n<a name=\"headerFormat\"></a>format | `string` | The extending format for the previously mentioned [`type`](#stType). See [Data Type Formats](#dataTypeFormat) for further details.\n<a name=\"headerItems\"></a>items | [Items Object](#itemsObject) | **Required if [`type`](#stType) is \"array\".** Describes the type of items in the array.\n<a name=\"headerCollectionFormat\"></a>collectionFormat | `string` | Determines the format of the array if type array is used. Possible values are: <ul><li>`csv` - comma separated values `foo,bar`. <li>`ssv` - space separated values `foo bar`. <li>`tsv` - tab separated values `foo\\tbar`. <li>`pipes` - pipe separated values <code>foo&#124;bar</code>. </ul> Default value is `csv`.\n<a name=\"headerDefault\"></a>default | * | Sets a default value for the header. See http://json-schema.org/latest/json-schema-validation.html#anchor101. Unlike JSON Schema this value MUST conform to the defined [`type`](#headerDefault) for the header.\n<a name=\"headerMaximum\"></a>maximum | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor17.\n<a name=\"headerMaximum\"></a>exclusiveMaximum | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor17.\n<a name=\"headerMinimum\"></a>minimum | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor21.\n<a name=\"headerExclusiveMinimum\"></a>exclusiveMinimum | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor21.\n<a name=\"headerMaxLength\"></a>maxLength | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor26.\n<a name=\"headerMinLength\"></a>minLength | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor29.\n<a name=\"headerPattern\"></a>pattern | `string` | See http://json-schema.org/latest/json-schema-validation.html#anchor33.\n<a name=\"headerMaxItems\"></a>maxItems | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor42.\n<a name=\"headerMinItems\"></a>minItems | `integer` | See http://json-schema.org/latest/json-schema-validation.html#anchor45.\n<a name=\"headerUniqueItems\"></a>uniqueItems | `boolean` | See http://json-schema.org/latest/json-schema-validation.html#anchor49.\n<a name=\"headerEnum\"></a>enum | [*] | See http://json-schema.org/latest/json-schema-validation.html#anchor76.\n<a name=\"headerMultipleOf\"></a>multipleOf | `number` | See http://json-schema.org/latest/json-schema-validation.html#anchor14.\n\n##### Header Object Example\n\nA simple header with of an integer type:\n\n```js\n{\n  \"description\": \"The number of allowed requests in the current period\",\n  \"type\": \"integer\"\n}\n```\n\n```yaml\ndescription: The number of allowed requests in the current period\ntype: integer\n```\n\n#### <a name=\"tagObject\"></a>Tag Object\n\nAllows adding meta data to a single tag that is used by the [Operation Object](#operationObject). It is not mandatory to have a Tag Object per tag used there.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\n<a name=\"tagName\"></a>name | `string` | **Required.** The name of the tag.\n<a name=\"tagDescription\"></a>description | `string` | A short description for the tag. [GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation.\n<a name=\"tagExternalDocs\"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this tag.\n\n##### Patterned Fields\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"tagExtensions\"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.\n\n##### Tag Object Example\n\n```js\n{\n\t\"name\": \"pet\",\n\t\"description\": \"Pets operations\"\n}\n```\n\n```yaml\nname: pet\ndescription: Pets operations\n```\n\n#### <a name=\"referenceObject\"></a>Reference Object\n\nA simple object to allow referencing other definitions in the specification. It can be used to reference parameters and responses that are defined at the top level for reuse.\n\nThe Reference Object is a [JSON Reference](http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-02) that uses a [JSON Pointer](http://tools.ietf.org/html/rfc6901) as its value. For this specification, only [canonical dereferencing](http://json-schema.org/latest/json-schema-core.html#anchor27) is supported.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\n<a name=\"referenceRef\"></a>$ref | `string` | **Required.** The reference string. \n\n##### Reference Object Example\n\n```js\n{\n\t\"$ref\": \"#/definitions/Pet\"\n}\n```\n\n```yaml\n$ref: '#/definitions/Pet'\n```\n\n#### <a name=\"schemaObject\"></a>Schema Object\n\nThe Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/) and uses a predefined subset of it. On top of this subset, there are extensions provided by this specification to allow for more complete documentation.\n\nFurther information about the properties can be found in [JSON Schema Core](http://json-schema.org/latest/json-schema-core.html) and [JSON Schema Validation](http://json-schema.org/latest/json-schema-validation.html). Unless stated otherwise, the property definitions follow the JSON Schema specification as referenced here.\n\nThe following properties are taken directly from the JSON Schema definition and follow the same specifications:\n- $ref - As a [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03)\n- format (See [Data Type Formats](#dataTypeFormat) for further details)\n- title\n- description ([GFM syntax](https://help.github.com/articles/github-flavored-markdown) can be used for rich text representation)\n- default (Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object)\n- multipleOf\n- maximum\n- exclusiveMaximum\n- minimum\n- exclusiveMinimum\n- maxLength\n- minLength\n- pattern\n- maxItems\n- minItems\n- uniqueItems\n- maxProperties\n- minProperties\n- required\n- enum\n- type\n\nThe following properties are taken from the JSON Schema definition but their definitions were adjusted to the Swagger Specification. Their definition is the same as the one from JSON Schema, only where the original definition references the JSON Schema definition, the [Schema Object](#schemaObject) definition is used instead.\n- items\n- allOf\n- properties\n- additionalProperties\n\nOther than the JSON Schema subset fields, the following fields may be used for further schema documentation.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\n<a name=\"schemaDiscriminator\"></a>discriminator | `string` | Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the `required` property list. When used, the value MUST be the name of this schema or any schema that inherits it.\n<a name=\"schemaReadOnly\"></a>readOnly | `boolean` | Relevant only for Schema `\"properties\"` definitions. Declares the property as \"read only\". This means that it MAY be sent as part of a response but MUST NOT be sent as part of the request. Properties marked as `readOnly` being `true` SHOULD NOT be in the `required` list of the defined schema. Default value is `false`.\n<a name=\"schemaXml\"></a>xml | [XML Object](#xmlObject) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds Additional metadata to describe the XML representation format of this property.\n<a name=\"schemaExternalDocs\"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this schema.\n<a name=\"schemaExample\"></a>example | Any | A free-form property to include a an example of an instance for this schema.\n\n###### Composition and Inheritance (Polymorphism)\n\nSwagger allows combining and extending model definitions using the `allOf` property of JSON Schema, in effect offering model composition. `allOf` takes in an array of object definitions that are validated *independently* but together compose a single object. \n\nWhile composition offers model extensibility, it does not imply a hierarchy between the models. To support polymorphism, Swagger adds the support of the `discriminator` field. When used, the `discriminator` will be the name of the property used to decide which schema definition is used to validate the structure of the model. As such, the `discriminator` field MUST be a required field. The value of the chosen property has to be the friendly name given to the model under the `definitions` property. As such, inline schema definitions, which do not have a given id, *cannot* be used in polymorphism.\n\n###### XML Modeling\n\nThe [xml](#schemaXml) property allows extra definitions when translating the JSON definition to XML. The [XML Object](#xmlObject) contains additional information about the available options.\n\n##### Schema Object Examples\n\n###### Primitive Sample\n\nUnlike previous versions of Swagger, Schema definitions can be used to describe primitive and arrays as well.\n\n```js\n{\n    \"type\": \"string\",\n    \"format\": \"email\"\n}\n```\n\n```yaml\ntype: string\nformat: email\n```\n\n###### Simple Model\n\n```js\n{\n  \"type\": \"object\",\n  \"required\": [\n    \"name\"\n  ],\n  \"properties\": {\n    \"name\": {\n      \"type\": \"string\"\n    },\n    \"address\": {\n      \"$ref\": \"#/definitions/Address\"\n    },\n    \"age\": {\n      \"type\": \"integer\",\n      \"format\": \"int32\",\n      \"minimum\": 0\n    }\n  }\n}\n```\n\n```yaml\ntype: object\nrequired:\n- name\nproperties:\n  name:\n    type: string\n  address:\n    $ref: '#/definitions/Address'\n  age:\n    type: integer\n    format: int32\n    minimum: 0\n```\n\n###### Model with Map/Dictionary Properties\n\nFor a simple string to string mapping:\n\n```js\n{\n  \"type\": \"object\",\n  \"additionalProperties\": {\n    \"type\": \"string\"\n  }\n}\n```\n\n```yaml\ntype: object\nadditionalProperties:\n  type: string\n```\n\nFor a string to model mapping:\n\n```js\n{\n  \"type\": \"object\",\n  \"additionalProperties\": {\n    \"$ref\": \"#/definitions/ComplexModel\"\n  }\n}\n```\n\n```yaml\ntype: object\nadditionalProperties:\n  $ref: '#/definitions/ComplexModel'\n```\n\n###### Model with Example\n\n```js\n{\n  \"properties\": {\n    \"id\": {\n      \"type\": \"integer\",\n      \"format\": \"int64\"\n    },\n    \"name\": {\n      \"type\": \"string\"\n    }\n  },\n  \"required\": [\n    \"name\"\n  ],\n  \"example\": {\n    \"name\": \"Puma\",\n    \"id\": 1\n  }\n}\n```\n\n```yaml\nproperties:\n  id:\n    type: integer\n    format: int64\n  name:\n    type: string\nrequired:\n- name\nexample:\n  name: Puma\n  id: 1\n```\n\n###### Models with Composition\n\n```js\n{\n  \"definitions\": {\n    \"ErrorModel\": {\n      \"type\": \"object\",\n      \"required\": [\n        \"message\",\n        \"code\"\n      ],\n      \"properties\": {\n        \"message\": {\n          \"type\": \"string\"\n        },\n        \"code\": {\n          \"type\": \"integer\",\n          \"minimum\": 100,\n          \"maximum\": 600\n        }\n      }\n    },\n    \"ExtendedErrorModel\": {\n      \"allOf\": [\n        {\n          \"$ref\": \"#/definitions/ErrorModel\"\n        },\n        {\n          \"type\": \"object\",\n          \"required\": [\n            \"rootCause\"\n          ],\n          \"properties\": {\n            \"rootCause\": {\n              \"type\": \"string\"\n            }\n          }\n        }\n      ]\n    }\n  }\n}\n```\n\n```yaml\ndefinitions:\n  ErrorModel:\n    type: object\n    required:\n    - message\n    - code\n    properties:\n      message:\n        type: string\n      code:\n        type: integer\n        minimum: 100\n        maximum: 600\n  ExtendedErrorModel:\n    allOf:\n    - $ref: '#/definitions/ErrorModel'\n    - type: object\n      required:\n      - rootCause\n      properties:\n        rootCause:\n          type: string\n```\n\n###### Models with Polymorphism Support\n\n```js\n{\n  \"definitions\": {\n    \"Pet\": {\n      \"discriminator\": \"petType\",\n      \"properties\": {\n        \"name\": {\n          \"type\": \"string\"\n        },\n        \"petType\": {\n          \"type\": \"string\"\n        }\n      },\n      \"required\": [\n        \"name\",\n        \"petType\"\n      ]\n    }\n  },\n  \"Cat\": {\n    \"description\": \"A representation of a cat\",\n    \"allOf\": [\n      {\n        \"$ref\": \"#/definitions/Pet\"\n      },\n      {\n        \"properties\": {\n          \"huntingSkill\": {\n            \"type\": \"string\",\n            \"description\": \"The measured skill for hunting\",\n            \"default\": \"lazy\",\n            \"enum\": [\n              \"clueless\",\n              \"lazy\",\n              \"adventurous\",\n              \"aggressive\"\n            ]\n          }\n        },\n        \"required\": [\n          \"huntingSkill\"\n        ]\n      }\n    ]\n  },\n  \"Dog\": {\n    \"description\": \"A representation of a dog\",\n    \"allOf\": [\n      {\n        \"$ref\": \"#/definitions/Pet\"\n      },\n      {\n        \"properties\": {\n          \"packSize\": {\n            \"type\": \"integer\",\n            \"format\": \"int32\",\n            \"description\": \"the size of the pack the dog is from\",\n            \"default\": 0,\n            \"minimum\": 0\n          }\n        },\n        \"required\": [\n          \"packSize\"\n        ]\n      }\n    ]\n  }\n}\n```\n\n```yaml\ndefinitions:\n  Pet:\n    discriminator: petType\n    properties:\n      name:\n        type: string\n      petType:\n        type: string\n    required:\n    - name\n    - petType\nCat:\n  description: A representation of a cat\n  allOf:\n  - $ref: '#/definitions/Pet'\n  - properties:\n      huntingSkill:\n        type: string\n        description: The measured skill for hunting\n        default: lazy\n        enum:\n        - clueless\n        - lazy\n        - adventurous\n        - aggressive\n    required:\n    - huntingSkill\nDog:\n  description: A representation of a dog\n  allOf:\n  - $ref: '#/definitions/Pet'\n  - properties:\n      packSize:\n        type: integer\n        format: int32\n        description: the size of the pack the dog is from\n        default: 0\n        minimum: 0\n    required:\n    - packSize\n```\n\n#### <a name=\"xmlObject\"></a>XML Object\n\nA metadata object that allows for more fine-tuned XML model definitions.\n\nWhen using arrays, XML element names are *not* inferred (for singular/plural forms) and the `name` property should be used to add that information. See examples for expected behavior.\n\n##### Fixed Fields\nField Name | Type | Description\n---|:---:|---\n<a name=\"xmlName\"></a>name | `string` | Replaces the name of the element/attribute used for the described schema property. When defined within the Items Object (`items`), it will affect the name of the individual XML elements within the list. When defined alongside `type` being `array` (outside the `items`), it will affect the wrapping element and only if `wrapped` is `true`. If `wrapped` is `false`, it will be ignored.\n<a name=\"xmlNamespace\"></a>namespace | `string` | The URL of the namespace definition. Value SHOULD be in the form of a URL.\n<a name=\"xmlPrefix\"></a>prefix | `string` | The prefix to be used for the [name](#xmlName).\n<a name=\"xmlAttribute\"></a>attribute | `boolean` | Declares whether the property definition translates to an attribute instead of an element. Default value is `false`.\n<a name=\"xmlWrapped\"></a>wrapped | `boolean` | MAY be used only for an array definition. Signifies whether the array is wrapped (for example, `<books><book/><book/></books>`) or unwrapped (`<book/><book/>`). Default value is `false`. The definition takes effect only when defined alongside `type` being `array` (outside the `items`).\n\n##### XML Object Examples\n\nThe examples of the XML object definitions are included inside a property definition of a [Schema Object](#schemaObject) with a sample of the XML representation of it.\n\n###### No XML Element\n\nBasic string property:\n\n```js\n{\n    \"animals\": {\n        \"type\": \"string\"\n    }\n}\n```\n\n```yaml\nanimals:\n  type: string\n```\n\n```xml\n<animals>...</animals>\n```\n\nBasic string array property ([`wrapped`](#xmlWrapped) is `false` by default):\n\n```js\n{\n    \"animals\": {\n        \"type\": \"array\",\n        \"items\": {\n            \"type\": \"string\"\n        }\n    }\n}\n```\n\n```yaml\nanimals:\n  type: array\n  items:\n    type: string\n```\n\n```xml\n<animals>...</animals>\n<animals>...</animals>\n<animals>...</animals>\n```\n\n###### XML Name Replacement\n\n```js\n{\n  \"animals\": {\n    \"type\": \"string\",\n    \"xml\": {\n      \"name\": \"animal\"\n    }\n  }\n}\n```\n\n```yaml\nanimals:\n  type: string\n  xml:\n    name: animal\n```\n\n```xml\n<animal>...</animal>\n```\n\n\n###### XML Attribute, Prefix and Namespace\n\nIn this example, a full model definition is shown.\n\n```js\n{\n  \"Person\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"id\": {\n        \"type\": \"integer\",\n        \"format\": \"int32\",\n        \"xml\": {\n          \"attribute\": true\n        },\n        \"name\": {\n          \"type\": \"string\",\n          \"xml\": {\n            \"namespace\": \"http://swagger.io/schema/sample\",\n            \"prefix\": \"sample\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n```yaml\nPerson:\n  type: object\n  properties:\n    id:\n      type: integer\n      format: int32\n      xml:\n        attribute: true\n      name:\n        type: string\n        xml:\n          namespace: http://swagger.io/schema/sample\n          prefix: sample\n```\n\n```xml\n<Person id=\"123\">\n    <sample:name xlmns:sample=\"http://swagger.io/schema/sample\">example</sample:name>\n</Person>\n```\n\n###### XML Arrays\n\nChanging the element names:\n\n```js\n{\n  \"animals\": {\n    \"type\": \"array\",\n    \"items\": {\n      \"type\": \"string\",\n      \"xml\": {\n        \"name\": \"animal\"\n      }\n    }\n  }\n}\n```\n\n```yaml\nanimals:\n  type: array\n  items:\n    type: string\n    xml:\n      name: animal\n```\n\n```xml\n<animal>value</animal>\n<animal>value</animal>\n```\n\nThe external `name` property has no effect on the XML:\n\n```js\n{\n  \"animals\": {\n    \"type\": \"array\",\n    \"items\": {\n      \"type\": \"string\",\n      \"xml\": {\n        \"name\": \"animal\"\n      }\n    },\n    \"xml\": {\n      \"name\": \"aliens\"\n    }\n  }\n}\n```\n\n```yaml\nanimals:\n  type: array\n  items:\n    type: string\n    xml:\n      name: animal\n  xml:\n    name: aliens\n```\n\n```xml\n<animal>value</animal>\n<animal>value</animal>\n```\n\nEven when the array is wrapped, if no name is explicitly defined, the same name will be used both internally and externally:\n\n```js\n{\n  \"animals\": {\n    \"type\": \"array\",\n    \"items\": {\n      \"type\": \"string\"\n    },\n    \"xml\": {\n      \"wrapped\": true\n    }\n  }\n}\n```\n\n```yaml\nanimals:\n  type: array\n  items:\n    type: string\n  xml:\n    wrapped: true\n```\n\n```xml\n<animals>\n  <animals>value</animals>\n  <animals>value</animals>\n</animals>\n```\n\nTo overcome the above example, the following definition can be used:\n\n```js\n{\n  \"animals\": {\n    \"type\": \"array\",\n    \"items\": {\n      \"type\": \"string\",\n      \"xml\": {\n        \"name\": \"animal\"\n      }\n    },\n    \"xml\": {\n      \"wrapped\": true\n    }\n  }\n}\n```\n\n```yaml\nanimals:\n  type: array\n  items:\n    type: string\n    xml:\n      name: animal\n  xml:\n    wrapped: true\n```\n\n```xml\n<animals>\n  <animal>value</animal>\n  <animal>value</animal>\n</animals>\n```\n\nAffecting both internal and external names:\n\n```js\n{\n  \"animals\": {\n    \"type\": \"array\",\n    \"items\": {\n      \"type\": \"string\",\n      \"xml\": {\n        \"name\": \"animal\"\n      }\n    },\n    \"xml\": {\n      \"name\": \"aliens\",\n      \"wrapped\": false\n    }\n  }\n}\n```\n\n```yaml\nanimals:\n  type: array\n  items:\n    type: string\n    xml:\n      name: animal\n  xml:\n    name: aliens\n    wrapped: false\n```\n\n```xml\n<aliens>\n  <animal>value</animal>\n  <animal>value</animal>\n</aliens>\n```\n\nIf we change the external element but not the internal ones:\n\n```js\n{\n  \"animals\": {\n    \"type\": \"array\",\n    \"items\": {\n      \"type\": \"string\"\n    },\n    \"xml\": {\n      \"name\": \"aliens\",\n      \"wrapped\": true\n    }\n  }\n}\n```\n\n```yaml\nanimals:\n  type: array\n  items:\n    type: string\n  xml:\n    name: aliens\n    wrapped: true\n```\n\n```xml\n<aliens>\n  <aliens>value</aliens>\n  <aliens>value</aliens>\n</aliens>\n```\n\n#### <a name=\"definitionsObject\"></a>Definitions Object\n\nAn object to hold data types that can be consumed and produced by operations. These data types can be primitives, arrays or models.\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"definitionsName\"></a>{name} | [Schema Object](#schemaObject) | A single definition, mapping a \"name\" to the schema it defines.\n\n##### Definitions Object Example\n\n```js\n{\n  \"Category\": {\n    \"properties\": {\n      \"id\": {\n        \"type\": \"integer\",\n        \"format\": \"int64\"\n      },\n      \"name\": {\n        \"type\": \"string\"\n      }\n    }\n  },\n  \"Tag\": {\n    \"properties\": {\n      \"id\": {\n        \"type\": \"integer\",\n        \"format\": \"int64\"\n      },\n      \"name\": {\n        \"type\": \"string\"\n      }\n    }\n  }\n}\n```\n\n```yaml\nCategory:\n  properties:\n    id:\n      type: integer\n      format: int64\n    name:\n      type: string\nTag:\n  properties:\n    id:\n      type: integer\n      format: int64\n    name:\n      type: string\n```\n\n#### <a name=\"parametersDefinitionsObject\"></a>Parameters Definitions Object\n\nAn object to hold parameters to be reused across operations. Parameter definitions can be referenced to the ones defined here.\n\nThis does *not* define global operation parameters.\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"pdName\"></a>{name} | [Parameter Object](#parameterObject) | A single parameter definition, mapping a \"name\" to the parameter it defines.\n\n##### Parameters Definition Object Example\n\n```js\n{\n  \"skipParam\": {\n    \"name\": \"skip\",\n    \"in\": \"query\",\n    \"description\": \"number of items to skip\",\n    \"required\": true,\n    \"type\": \"integer\",\n    \"format\": \"int32\"\n  },\n  \"limitParam\": {\n    \"name\": \"limit\",\n    \"in\": \"query\",\n    \"description\": \"max records to return\",\n    \"required\": true,\n    \"type\": \"integer\",\n    \"format\": \"int32\"\n  }\n}\n```\n\n```yaml\nskipParam:\n  name: skip\n  in: query\n  description: number of items to skip\n  required: true\n  type: integer\n  format: int32\nlimitParam:\n  name: limit\n  in: query\n  description: max records to return\n  required: true\n  type: integer\n  format: int32\n```\n\n\n#### <a name=\"responsesDefinitionsObject\"></a>Responses Definitions Object\n\nAn object to hold responses to be reused across operations. Response definitions can be referenced to the ones defined here.\n\nThis does *not* define global operation responses.\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"rdName\"></a>{name} | [Response Object](#responseObject) | A single response definition, mapping a \"name\" to the response it defines.\n\n##### Responses Definitions Object Example\n\n```js\n{\n  \"NotFound\": {\n    \"description\": \"Entity not found.\"\n  },\n  \"IllegalInput\": {\n  \t\"description\": \"Illegal input for operation.\"\n  },\n  \"GeneralError\": {\n  \t\"description\": \"General Error\",\n  \t\"schema\": {\n  \t\t\"$ref\": \"#/definitions/GeneralError\"\n  \t}\n  }\n}\n```\n\n```yaml\nNotFound:\n  description: Entity not found.\nIllegalInput:\n  description: Illegal input for operation.\nGeneralError:\n  description: General Error\n  schema:\n    $ref: '#/definitions/GeneralError'\n```\n\n#### <a name=\"securityDefinitionsObject\"></a>Security Definitions Object\n\nA declaration of the security schemes available to be used in the specification. This does not enforce the security schemes on the operations and only serves to provide the relevant details for each scheme.\n\n##### Patterned Fields\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"sdName\"></a>{name} | [Security Scheme Object](#securitySchemeObject) | A single security scheme definition, mapping a \"name\" to the scheme it defines.\n\n##### Security Definitions Object Example\n\n```js\n{\n  \"api_key\": {\n    \"type\": \"apiKey\",\n    \"name\": \"api_key\",\n    \"in\": \"header\"\n  },\n  \"petstore_auth\": {\n    \"type\": \"oauth2\",\n    \"authorizationUrl\": \"http://swagger.io/api/oauth/dialog\",\n    \"flow\": \"implicit\",\n    \"scopes\": {\n      \"write:pets\": \"modify pets in your account\",\n      \"read:pets\": \"read your pets\"\n    }\n  }\n}\n```\n\n```yaml\napi_key:\n  type: apiKey\n  name: api_key\n  in: header\npetstore_auth:\n  type: oauth2\n  authorizationUrl: http://swagger.io/api/oauth/dialog\n  flow: implicit\n  scopes:\n    write:pets: modify pets in your account\n    read:pets: read your pets\n```\n\n#### <a name=\"securitySchemeObject\"></a>Security Scheme Object\n\nAllows the definition of a security scheme that can be used by the operations. Supported schemes are basic authentication, an API key (either as a header or as a query parameter) and OAuth2's common flows (implicit, password, application and access code).\n\n##### Fixed Fields\nField Name | Type | Validity | Description\n---|:---:|---|---\n<a name=\"securitySchemeType\"></a>type | `string` | Any | **Required.** The type of the security scheme. Valid values are `\"basic\"`, `\"apiKey\"` or `\"oauth2\"`.\n<a name=\"securitySchemeDescription\"></a>description | `string` | Any | A short description for security scheme.\n<a name=\"securitySchemeName\"></a>name | `string` | `apiKey` | **Required.** The name of the header or query parameter to be used.\n<a name=\"securitySchemeIn\"></a>in | `string` | `apiKey` | **Required** The location of the API key. Valid values are `\"query\"` or `\"header\"`.\n<a name=\"securitySchemeFlow\"></a>flow | `string` | `oauth2` | **Required.** The flow used by the OAuth2 security scheme. Valid values are `\"implicit\"`, `\"password\"`, `\"application\"` or `\"accessCode\"`.\n<a name=\"securitySchemeAuthorizationUrl\"></a>authorizationUrl | `string` | `oauth2` (`\"implicit\"`, `\"accessCode\"`) | **Required.** The authorization URL to be used for this flow. This SHOULD be in the form of a URL.\n<a name=\"securitySchemeTokenUrl\"></a>tokenUrl | `string` | `oauth2` (`\"password\"`, `\"application\"`, `\"accessCode\"`) | **Required.** The token URL to be used for this flow. This SHOULD be in the form of a URL.\n<a name=\"securitySchemeScopes\"></a>scopes | [Scopes Object](#scopesObject) | `oauth2` | **Required.** The available scopes for the OAuth2 security scheme.\n\n##### Patterned Fields\n\nField Name | Type | Description \n---|:---:|---\n<a name=\"securitySchemeExtensions\"></a>^x- | Any | Allows extensions to the Swagger Schema. The field name MUST begin with `x-`, for example, `x-internal-id`. The value can be `null`, a primitive, an array or an object. See [Vendor Extensions](#vendorExtensions) for further details.\n\n##### Security Scheme Object Example\n\n###### Basic Authentication Sample\n\n```js\n{\n  \"type\": \"basic\"\n}\n```\n\n```yaml\ntype: basic\n```\n\n###### API Key Sample\n\n```js\n{\n  \"type\": \"apiKey\",\n  \"name\": \"api_key\",\n  \"in\": \"header\"\n}\n```\n\n```yaml\ntype: apiKey\nname: api_key\nin: header\n```\n\n###### Implicit OAuth2 Sample\n\n```js\n{\n  \"type\": \"oauth2\",\n  \"authorizationUrl\": \"http://swagger.io/api/oauth/dialog\",\n  \"flow\": \"implicit\",\n  \"scopes\": {\n    \"write:pets\": \"modify pets in your account\",\n    \"read:pets\": \"read your pets\"\n  }\n}\n```\n\n```yaml\ntype: oauth2\nauthorizationUrl: http://swagger.io/api/oauth/dialog\nflow: implicit\nscopes:\n  write:pets: modify pets in your account\n  read:pets: read your pets\n```\n\n#### <a name=\"scopesObject\"></a>Scopes Object\n\nLists the available scopes for an OAuth2 security scheme.\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"scopesName\"></a>{name} | `string` | Maps between a name of a scope to a short description of it (as the value of the property).\n\n##### Scopes Object Example\n\n```js\n{\n  \"write:pets\": \"modify pets in your account\",\n  \"read:pets\": \"read your pets\"\n}\n```\n\n```yaml\nwrite:pets: modify pets in your account\nread:pets: read your pets\n```\n\n#### <a name=\"securityRequirementObject\"></a>Security Requirement Object\n\nLists the required security schemes to execute this operation. The object can have multiple security schemes declared in it which are all required (that is, there is a logical AND between the schemes).\n\nThe name used for each property MUST correspond to a security scheme declared in the [Security Definitions](#securityDefinitionsObject).\n\n##### Patterned Fields\n\nField Pattern | Type | Description\n---|:---:|---\n<a name=\"securityRequirementsName\"></a>{name} | [`string`] | Each name must correspond to a security scheme which is declared in the [Security Definitions](#securityDefinitions). If the security scheme is of type `\"oauth2\"`, then the value is a list of scope names required for the execution. For other security scheme types, the array MUST be empty.\n\n##### Security Requirement Object Examples\n\n###### Non-OAuth2 Security Requirement\n\n```js\n{\n  \"api_key\": []\n}\n```\n\n```yaml\napi_key: []\n```\n\n###### OAuth2 Security Requirement\n\n```js\n{\n  \"petstore_auth\": [\n    \"write:pets\",\n    \"read:pets\"\n  ]\n}\n```\n\n```yaml\npetstore_auth:\n- write:pets\n- read:pets\n```\n\n### <a name=\"vendorExtensions\"></a>Specification Extensions\n\nWhile the Swagger Specification tries to accommodate most use cases, additional data can be added to extend the specification at certain points.\n\nThe extensions properties are always prefixed by `\"x-\"` and can have any valid JSON format value.\n\nThe extensions may or may not be supported by the available tooling, but those may be extended as well to add requested support (if tools are internal or open-sourced).\n\n### <a name=\"securityFiltering\"></a>Security Filtering\n\nSome objects in the Swagger specification may be declared and remain empty, or completely be removed, even though they are inherently the core of the API documentation. \n\nThe reasoning behind it is to allow an additional layer of access control over the documentation itself. While not part of the specification itself, certain libraries may choose to allow access to parts of the documentation based on some form of authentication/authorization.\n\nTwo examples for this:\n1. The [Paths Object](#pathsObject) may be empty. It may be counterintuitive, but this may tell the viewer that they got to the right place, but can't access any documentation. They'd still have access to the [Info Object](#infoObject) which may contain additional information regarding authentication.\n2. The [Path Item Object](#pathItemObject) may be empty. In this case, the viewer will be aware that the path exists, but will not be able to see any of its operations or parameters. This is different than hiding the path itself from the [Paths Object](#pathsObject) so the user will not be aware of its existence. This allows the documentation provider a finer control over what the viewer can see.\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfAttribute.cs",
    "content": "﻿using System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    /// Attribute to enable a class or interface to be scanned by SwaggerWcf\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]\n    public class SwaggerWcfAttribute : Attribute\n    {\n        /// <summary>\n        /// The base path on which the API is served, which is relative to the host. If it is not included,\n        /// the API is served directly under the host. The value MUST start with a leading slash (/). The\n        /// basePath does not support path templating.\n        /// </summary>\n        public string ServicePath { get; set; }\n\n        /// <summary>\n        /// Export this service on Swagger file\n        /// </summary>\n        public SwaggerWcfAttribute()\n        {\n        }\n\n        /// <summary>\n        /// Export this service on Swagger file with base path of <paramref name=\"servicePath\"/>\n        /// </summary>\n        /// <param name=\"servicePath\">Service path</param>\n        public SwaggerWcfAttribute(string servicePath)\n        {\n            ServicePath = servicePath.StartsWith(\"/\") ? servicePath : $\"/{servicePath}\";\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfContactInfoAttribute.cs",
    "content": "﻿using SwaggerWcf.Models;\nusing System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    /// Provides values for Contact information for the exposed API.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]\n    public class SwaggerWcfContactInfoAttribute : Attribute\n    {\n        /// <summary>\n        /// The identifying name of the contact person/organization.\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// The email address of the contact person/organization. MUST be in the format of an email address.\n        /// </summary>\n        public string Email { get; set; }\n\n        /// <summary>\n        /// The URL pointing to the contact information. MUST be in the format of a URL.\n        /// </summary>\n        public string Url { get; set; }\n\n        public static explicit operator InfoContact(SwaggerWcfContactInfoAttribute attr)\n        {\n            return new InfoContact\n            {\n                Name = attr.Name,\n                Url = attr.Url,\n                Email = attr.Email\n            };\n        }\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfContentTypesAttribute.cs",
    "content": "﻿using System;\nusing System.Net;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Overrides the return type\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\n    public class SwaggerWcfContentTypesAttribute : Attribute\n    {\n        /// <summary>\n        ///     Overrides the return type\n        /// </summary>\n        /// <param name=\"returnType\">Method return type</param>\n        public SwaggerWcfContentTypesAttribute(string[] consumeTypes = null, string[] produceTypes = null)\n        {\n            ConsumeTypes = consumeTypes;\n            ProduceTypes = produceTypes;\n        }\n\n        /// <summary>\n        ///     Override Response Content-Types\n        /// </summary>\n        public string[] ConsumeTypes { get; set; }\n\n        /// <summary>\n        ///     Override Response Content-Types\n        /// </summary>\n        public string[] ProduceTypes { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfDefinitionAttribute.cs",
    "content": "﻿using System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Attribute to describe a class as a definition on swagger\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class)]\n    public class SwaggerWcfDefinitionAttribute : Attribute\n    {\n        /// <summary>\n        ///     Description of the external documentation\n        /// </summary>\n        public string ExternalDocsDescription { get; set; }\n\n        /// <summary>\n        ///     URL of the external documentation\n        /// </summary>\n        public string ExternalDocsUrl { get; set; }\n\n        /// <summary>\n        /// Optional custom name for model. Model names default to class's fully qualified name\n        /// </summary>\n        public string ModelName { get; set; }\n\n        /// <summary>\n        ///     Configures a description with more information\n        /// </summary>\n        /// <param name=\"externalDocsDescription\">Description external docs description</param>\n        /// <param name=\"externalDocsUrl\">Description external docs URL</param>\n        public SwaggerWcfDefinitionAttribute(string externalDocsDescription = null,\n                                             string externalDocsUrl = null)\n        {\n            ExternalDocsDescription = externalDocsDescription;\n            ExternalDocsUrl = externalDocsUrl;\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfHeaderAttribute.cs",
    "content": "﻿using System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Describe a parameter\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\n    public class SwaggerWcfHeaderAttribute : Attribute\n    {\n        /// <summary>\n        ///     Describes a parameter\n        /// </summary>\n        /// <param name=\"name\">Parameter name</param>\n        /// <param name=\"required\">Set parameter as required. Defaults is false.</param>\n        /// <param name=\"description\">Parameter description.</param>\n        /// <param name=\"defaultValue\">Parameter default value.</param>\n        public SwaggerWcfHeaderAttribute(string name, bool required = false, string description = null, string defaultValue = null)\n        {\n            Name = name;\n            Required = required;\n            Description = description;\n            DefaultValue = defaultValue;\n        }\n\n        /// <summary>\n        ///     Name of this parameter\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        ///     Defines if this parameter is required in operations\n        /// </summary>\n        public bool Required { get; set; }\n\n        /// <summary>\n        ///     Description of this parameter\n        /// </summary>\n        public string Description { get; set; }\n        \n        /// <summary>\n        ///     Default value of this parameter\n        /// </summary>\n        public string DefaultValue { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfHiddenAttribute.cs",
    "content": "﻿using System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Attribute to hide a method, class, parameter or property from Swagger.\n    ///     This overrides any tag-based settings.\n    /// </summary>\n    [AttributeUsage(\n        AttributeTargets.Method | AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Parameter)]\n    public class SwaggerWcfHiddenAttribute : Attribute\n    {\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfLicenseInfoAttribute.cs",
    "content": "﻿using SwaggerWcf.Models;\nusing System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    /// Provides values for License information for the exposed API.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]\n    public class SwaggerWcfLicenseInfoAttribute : Attribute\n    {\n        /// <summary>\n        /// Required. The license name used for the API.\n        /// </summary>\n        public string Name { get; }\n\n        /// <summary>\n        /// A URL to the license used for the API. MUST be in the format of a URL.\n        /// </summary>\n        public string Url { get; set; }\n\n        /// <summary>\n        ///  Provides values for License information for the exposed API.\n        /// </summary>\n        /// <param name=\"name\">The license name used for the API.</param>\n        public SwaggerWcfLicenseInfoAttribute(string name)\n        {\n            if (string.IsNullOrWhiteSpace(name))\n            {\n                throw new ArgumentNullException(nameof(name));\n            }\n\n            Name = name;\n        }\n\n        public static explicit operator InfoLicense(SwaggerWcfLicenseInfoAttribute attr)\n        {\n            return new InfoLicense\n            {\n                Name = attr.Name,\n                Url = attr.Url\n            };\n        }\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfParameterAttribute.cs",
    "content": "﻿using System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Describe a parameter\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Parameter)]\n    public class SwaggerWcfParameterAttribute : Attribute\n    {\n        /// <summary>\n        ///     Describes a parameter\n        /// </summary>\n        /// <param name=\"required\">Set parameter as required. Defaults is false.</param>\n        /// <param name=\"description\">Parameter description.</param>\n        public SwaggerWcfParameterAttribute(bool required = false, string description = null, Type parameterType = null)\n        {\n            Required = required;\n            Description = description;\n            ParameterType = parameterType;\n        }\n\n\n        /// <summary>\n        ///     Defines if this parameter is required in operations\n        /// </summary>\n        public bool Required { get; set; }\n\n        /// <summary>\n        ///     Description of this parameter\n        /// </summary>\n        public string Description { get; set; }\n\n        /// <summary>\n        ///     Override parameter type\n        /// </summary>\n        public Type ParameterType { get; set; }\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfPathAttribute.cs",
    "content": "﻿using System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Attribute to describe a method exported as a path in swagger\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Method)]\n    public class SwaggerWcfPathAttribute : Attribute\n    {\n        /// <summary>\n        ///     Configures a path with more information\n        /// </summary>\n        /// <param name=\"summary\">Path summary</param>\n        /// <param name=\"description\">Path description</param>\n        /// <param name=\"operationId\">Path Operation ID</param>\n        /// <param name=\"externalDocsDescription\">Path external docs description</param>\n        /// <param name=\"externalDocsUrl\">Path external docs URL</param>\n        /// <param name=\"deprecated\">Path deprecated (defaults to false)</param>\n        public SwaggerWcfPathAttribute(string summary = null, string description = null, string operationId = null,\n                                       string externalDocsDescription = null,\n                                       string externalDocsUrl = null, bool deprecated = false,\n                                       string operationPath = null)\n        {\n            Summary = summary;\n            Description = description;\n            OperationId = operationId;\n            ExternalDocsDescription = externalDocsDescription;\n            ExternalDocsUrl = externalDocsUrl;\n            Deprecated = deprecated;\n            OperationPath = operationPath;\n        }\n\n        /// <summary>\n        ///     Path summary\n        /// </summary>\n        public string Summary { get; set; }\n\n        /// <summary>\n        ///     Path description\n        /// </summary>\n        public string Description { get; set; }\n\n        /// <summary>\n        ///     Path Operation ID\n        /// </summary>\n        public string OperationId { get; set; }\n\n        /// <summary>\n        ///     Path external docs description\n        /// </summary>\n        public string ExternalDocsDescription { get; set; }\n\n        /// <summary>\n        ///     Path external docs URL\n        /// </summary>\n        public string ExternalDocsUrl { get; set; }\n\n        /// <summary>\n        ///     Path deprecated\n        /// </summary>\n        public bool Deprecated { get; set; }\n\n        /// <summary>\n        ///     Operation path, extends service path\n        /// </summary>\n        public string OperationPath { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfPropertyAttribute.cs",
    "content": "﻿using System;\n\nusing SwaggerWcf.Models;\n\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Describe a property\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]\n    public class SwaggerWcfPropertyAttribute : Attribute\n    {\n        /// <summary>\n        ///     Describes a property\n        /// </summary>\n        public SwaggerWcfPropertyAttribute()\n        {\n        }\n\n        public string Title { get; set; }\n\n        /// <summary>\n        ///     Description of this parameter\n        /// </summary>\n        public string Description { get; set; }\n\n        /// <summary>\n        ///     Determines whether this parameter is mandatory.\n        /// </summary>\n        public bool Required { get { return _Required.GetValueOrDefault(); } set { _Required = value; } }\n\n        /// <summary>\n        ///     Sets the ability to pass empty-valued parameters. This is valid\n        ///     only for either query or formData parameters and allows you to\n        ///     send a parameter with a name only or an empty value.\n        /// </summary>\n        //public bool AllowEmptyValue { get { return _AllowEmptyValue ?? false; } set { _AllowEmptyValue = value; } }\n\n        /// <summary>\n        ///     Determines the format of the array if type array is used.\n        /// </summary>\n        //public CollectionFormat? CollectionFormat { get; set; }\n\n        /// <summary>\n        ///     Declares the value of the parameter that the server will use if none is provided\n        /// </summary>\n        public string Default { get; set; }\n\n        /// <summary>\n        ///     Illustrate what the value is supposed to be like.\n        /// </summary>\n        public object Example { get; set; }\n\n        /// <summary>\n        ///     Maximum allowed value, as modified by ExclusiveMaximum.\n        ///     Must be a valid JSON number, and storable as a decimal.\n        /// </summary>\n        public string Maximum {\n            get { return _Maximum.HasValue ? _Maximum.ToString() : null; }\n            set { _Maximum = decimal.Parse(value); }\n        }\n\n        /// <summary>\n        ///     If true, the instance is valid if it is strictly less than the value of Maximum.\n        /// </summary>\n        public bool ExclusiveMaximum {\n            get { return _ExclusiveMaximum.GetValueOrDefault(); }\n            set { _ExclusiveMaximum = value; }\n        }\n\n        /// <summary>\n        ///     Minimum allowed value, as modified by ExclusiveMinimum\n        ///     Must be a valid JSON number, and storable as a decimal.\n        /// </summary>\n        public string Minimum {\n            get { return _Minimum.HasValue ? _Minimum.ToString() : null; }\n            set { _Minimum = decimal.Parse(value); }\n        }\n\n        /// <summary>\n        ///     If true, the instance is valid if it is strictly greatern than the value of Maximum.\n        /// </summary>\n        public bool ExclusiveMinimum {\n            get { return _ExclusiveMinimum.GetValueOrDefault(); }\n            set { _ExclusiveMinimum = value; }\n        }\n\n        /// <summary>\n        ///     Maximum length.\n        /// </summary>\n        public int MaxLength {\n            get { return _MaxLength.GetValueOrDefault(); }\n            set { _MaxLength = value; }\n        }\n\n        /// <summary>\n        ///     Minimum length\n        /// </summary>\n        public int MinLength {\n            get { return _MinLength.GetValueOrDefault(); }\n            set { _MinLength = value; }\n        }\n\n        /// <summary>\n        ///    Should be a valid regular expression, according to the ECMA 262 regular expression dialect.\n        ///    A string instance is considered valid if the regular expression matches the instance successfully.\n        ///    Regular expressions are not implicitly anchored.\n        /// </summary>\n        public string Pattern { get; set; }\n\n        /// <summary>\n        ///     An array instance is valid against MaxItems if its size\n        ///     is less than, or equal to, the value of this keyword.\n        /// </summary>\n        public int MaxItems {\n            get { return _MaxItems.GetValueOrDefault(); }\n            set { _MaxItems = value; }\n        }\n\n        /// <summary>\n        ///     An array instance is valid against MaxItems if its size\n        ///     is greater than, or equal to, the value of this keyword.\n        /// </summary>\n        public int MinItems {\n            get { return _MinItems.GetValueOrDefault(); }\n            set { _MinItems = value; }\n        }\n\n        /// <summary>\n        ///     If true, the instance validates successfully if all of its elements are unique.\n        /// </summary>\n        public bool UniqueItems {\n            get { return _UniqueItems.GetValueOrDefault(); }\n            set { _UniqueItems = value; }\n        }\n\n        /// <summary>\n        ///     A numeric instance is valid against \"multipleOf\" if the result of\n        ///     the division of the instance by this keyword's value is an integer.\n        /// </summary>\n        public decimal MultipleOf {\n            get { return _MultipleOf.GetValueOrDefault(); }\n            set { _MultipleOf = value; }\n        }\n\n        // To be usable as attribute named parameters, parameter types must not be\n        // nullable but we need to be able to see whether each value was set or not,\n        // so hide a nullable value for each available option.\n\n        internal bool?    _Required         { get; set; }\n        internal bool?    _ExclusiveMaximum { get; set; }\n        internal decimal? _Minimum          { get; set; }\n        internal decimal? _Maximum          { get; set; }\n        internal bool?    _ExclusiveMinimum { get; set; }\n        internal int?     _MaxLength        { get; set; }\n        internal int?     _MinLength        { get; set; }\n        internal int?     _MaxItems         { get; set; }\n        internal int?     _MinItems         { get; set; }\n        internal bool?    _UniqueItems      { get; set; }\n        internal decimal? _MultipleOf       { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfRegexAttribute.cs",
    "content": "﻿using System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Apply a Regular Expression\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]\n    public class SwaggerWcfRegexAttribute : Attribute\n    {\n        /// <summary>\n        ///     Applies a Regular Expression to a field or property\n        /// </summary>\n        /// <param name=\"regex\">Regular Expression</param>\n        public SwaggerWcfRegexAttribute(string regex)\n        {\n            Regex = regex;\n        }\n\n        /// <summary>\n        ///     Regular Expression\n        /// </summary>\n        public string Regex { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfRequestTypeAttribute.cs",
    "content": "﻿using System;\nusing System.Net;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Overrides the return type\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]\n    public class SwaggerWcfRequestTypeAttribute : Attribute\n    {\n        /// <summary>\n        ///     Overrides the return type\n        /// </summary>\n        /// <param name=\"name\">Method parameter type name</param>\n        public SwaggerWcfRequestTypeAttribute(string name = null)\n        {\n            Name = name;\n        }\n\n        /// <summary>\n        ///     Override parameter Type in Wrapped Request\n        /// </summary>\n        public string Name { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfResponseAttribute.cs",
    "content": "﻿using System;\nusing System.Net;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Attribute to describe path responses. If none is specified, a 'default' one is created\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\n    public class SwaggerWcfResponseAttribute : Attribute\n    {\n        /// <summary>\n        ///     Configures a response for a path\n        /// </summary>\n        /// <param name=\"code\">Result code</param>\n        /// <param name=\"description\">Result description</param>\n        /// <param name=\"emptyResponseOverride\">Result has empty response body (override default response type)</param>\n        /// <param name=\"headers\">Optional HTTP headers returned</param>\n        /// <param name=\"responseTypeOverride\">Optional response Type override</param>\n        /// <param name=\"exampleMimeType\">Optional Response Example MIME Type</param>\n        /// <param name=\"exampleContent\">Optional Response Example Content</param>\n        public SwaggerWcfResponseAttribute(string code, string description = null, bool emptyResponseOverride = false,\n            string[] headers = null, Type responseTypeOverride = null,\n            string exampleMimeType = null, string exampleContent = null)\n        {\n            Code = code;\n            Description = description;\n            EmptyResponseOverride = emptyResponseOverride;\n            Headers = headers;\n            ResponseTypeOverride = responseTypeOverride;\n            ExampleMimeType = exampleMimeType;\n            ExampleContent = exampleContent;\n        }\n\n        /// <summary>\n        ///     Configures a response for a path\n        /// </summary>\n        /// <param name=\"code\">Result code</param>\n        /// <param name=\"description\">Result description</param>\n        /// <param name=\"emptyResponseOverride\">Result has empty response body (override default response type)</param>\n        /// <param name=\"headers\">Optional HTTP headers returned</param>\n        /// <param name=\"responseTypeOverride\">Optional response Type override</param>\n        /// <param name=\"exampleMimeType\">Optional Response Example MIME Type</param>\n        /// <param name=\"exampleContent\">Optional Response Example Content</param>\n        public SwaggerWcfResponseAttribute(HttpStatusCode code, string description = null,\n            bool emptyResponseOverride = false,\n            string[] headers = null,\n            Type responseTypeOverride = null,\n            string exampleMimeType = null,\n            string exampleContent = null)\n        {\n            Code = ((int) code).ToString();\n            Description = description;\n            EmptyResponseOverride = emptyResponseOverride;\n            Headers = headers;\n            ResponseTypeOverride = responseTypeOverride;\n            ExampleMimeType = exampleMimeType;\n            ExampleContent = exampleContent;\n        }\n\n        /// <summary>\n        ///     Configures a response for a path\n        /// </summary>\n        /// <param name=\"code\">Result code</param>\n        /// <param name=\"description\">Result description</param>\n        /// <param name=\"emptyResponseOverride\">Result has empty response body (override default response type)</param>\n        /// <param name=\"headers\">Optional HTTP headers returned</param>\n        /// <param name=\"responseTypeOverride\">Optional response Type override</param>\n        /// <param name=\"exampleMimeType\">Optional Response Example MIME Type</param>\n        /// <param name=\"exampleContent\">Optional Response Example Content</param>\n        public SwaggerWcfResponseAttribute(int code, string description = null, bool emptyResponseOverride = false,\n            string[] headers = null, Type responseTypeOverride = null,\n            string exampleMimeType = null, string exampleContent = null)\n        {\n            Code = code.ToString();\n            Description = description;\n            EmptyResponseOverride = emptyResponseOverride;\n            Headers = headers;\n            ResponseTypeOverride = responseTypeOverride;\n            ExampleMimeType = exampleMimeType;\n            ExampleContent = exampleContent;\n        }\n\n        /// <summary>\n        ///     Result code\n        /// </summary>\n        public string Code { get; set; }\n\n        /// <summary>\n        ///     Result description\n        /// </summary>\n        public string Description { get; set; }\n\n        /// <summary>\n        ///     Result has empty response body (override default response type)\n        /// </summary>\n        public bool EmptyResponseOverride { get; set; }\n\n        /// <summary>\n        ///     Optional HTTP headers returned\n        /// </summary>\n        public string[] Headers { get; set; }\n\n        /// <summary>\n        ///     Example MIME Type\n        /// </summary>\n        public string ExampleMimeType { get; set; }\n\n        /// <summary>\n        ///     Example Content\n        /// </summary>\n        public string ExampleContent { get; set; }\n\n        /// <summary>\n        ///     Override response type\n        /// </summary>\n        public Type ResponseTypeOverride { get; set; }\n\n        public override bool Equals(object obj)\n        {\n            SwaggerWcfResponseAttribute other = obj as SwaggerWcfResponseAttribute;\n            if (other != null)\n            {\n                return string.Equals(Code, other.Code) &&\n                       string.Equals(Description, other.Description) &&\n                       EmptyResponseOverride == other.EmptyResponseOverride &&\n                       Equals(Headers, other.Headers) &&\n                       ResponseTypeOverride == other.ResponseTypeOverride &&\n                       ExampleMimeType == other.ExampleMimeType &&\n                       ExampleContent == other.ExampleContent;\n            }\n            return base.Equals(obj);\n        }\n\n        public override int GetHashCode()\n        {\n            unchecked\n            {\n                int hashCode = base.GetHashCode();\n                hashCode = (hashCode * 397) ^ (Code != null ? Code.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ EmptyResponseOverride.GetHashCode();\n                hashCode = (hashCode * 397) ^ (Headers != null ? Headers.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ (ResponseTypeOverride != null ? ResponseTypeOverride.GetHashCode() : 0);\n                hashCode = (hashCode * 397) ^ ExampleMimeType?.GetHashCode() ?? 0;\n                hashCode = (hashCode * 397) ^ ExampleContent?.GetHashCode() ?? 0;\n                return hashCode;\n            }\n        }\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfReturnTypeAttribute.cs",
    "content": "﻿using System;\nusing System.Net;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Overrides the return type\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]\n    public class SwaggerWcfReturnTypeAttribute : Attribute\n    {\n        /// <summary>\n        ///     Overrides the return type\n        /// </summary>\n        /// <param name=\"returnType\">Method return type</param>\n        /// <param name=\"name\">Method return type name</param>\n        public SwaggerWcfReturnTypeAttribute(Type returnType = null, string name = null)\n        {\n            ReturnType = returnType;\n            Name = name;\n        }\n\n        /// <summary>\n        ///     Override Return Type\n        /// </summary>\n        public Type ReturnType { get; set; }\n\n        /// <summary>\n        ///     Override Return Type in Wrapped Responses\n        /// </summary>\n        public string Name { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfSecurityAttribute.cs",
    "content": "﻿using System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    /// Attribute to link operation to a security definition\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]\n    public class SwaggerWcfSecurityAttribute : Attribute\n    {\n        /// <summary>\n        /// Specify security definition for this operation\n        /// </summary>\n        /// <param name=\"securityDefinitionName\">Name of the Security Definition</param>\n        /// <param name=\"scopes\">Scopes of the security definition</param>\n        public SwaggerWcfSecurityAttribute(string securityDefinitionName, params string[] scopes)\n        {\n            SecurityDefinitionName = securityDefinitionName;\n            SecurityDefinitionScopes = scopes;\n        }\n\n        /// <summary>\n        /// Name of the Security Definition\n        /// </summary>\n        public string SecurityDefinitionName { get; set; }\n\n        /// <summary>\n        /// Scopes of the Security Definition\n        /// </summary>\n        public string[] SecurityDefinitionScopes { get; set; }\n\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfServiceInfoAttribute.cs",
    "content": "﻿using SwaggerWcf.Models;\nusing System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    /// Provides metadata about the API. The metadata can be used by the clients if needed.\n    /// </summary>\n    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]\n    public class SwaggerWcfServiceInfoAttribute : Attribute\n    {\n        /// <summary>\n        /// Required. The title of the application.\n        /// </summary>\n        public string Title { get; }\n\n        /// <summary>\n        /// Required Provides the version of the application API (not to be confused with the specification version).\n        /// </summary>\n        public string Version { get; }\n\n        /// <summary>\n        /// A short description of the application. GFM syntax can be used for rich text representation.\n        /// </summary>\n        public string Description { get; set; }\n\n        /// <summary>\n        /// The Terms of Service for the API.\n        /// </summary>\n        public string TermsOfService { get; set; }\n\n        /// <summary>\n        /// Assigns service info values\n        /// </summary>\n        /// <param name=\"title\">The title of the application</param>\n        /// <param name=\"version\">Provides the version of the application API (not to be confused with the specification version)</param>\n        public SwaggerWcfServiceInfoAttribute(string title, string version)\n        {\n            if (string.IsNullOrWhiteSpace(title))\n                throw new ArgumentNullException(nameof(title));\n\n            if (string.IsNullOrWhiteSpace(version))\n                throw new ArgumentNullException(nameof(version));\n\n            Title = title;\n            Version = version;\n        }\n\n        public static explicit operator Info(SwaggerWcfServiceInfoAttribute attribute) =>\n            new Info\n            {\n                Title = attribute.Title,\n                Version = attribute.Version,\n                Description = attribute.Description,\n                TermsOfService = attribute.TermsOfService\n            };\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Attributes/SwaggerWcfTagAttribute.cs",
    "content": "﻿using System;\n\nnamespace SwaggerWcf.Attributes\n{\n    /// <summary>\n    ///     Attribute to inject a tag into a class, method, parameter or property.\n    ///     Tags can be used to categorize in Swagger UI and to hide elements using configuration\n    /// </summary>\n    [AttributeUsage(\n        AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Parameter,\n        AllowMultiple = true)]\n    public class SwaggerWcfTagAttribute : Attribute\n    {\n        /// <summary>\n        ///     Injects a tag into an element\n        /// </summary>\n        /// <param name=\"name\">Tag name</param>\n        /// <param name=\"hideFromSpec\">Hide tag from spec</param>\n        public SwaggerWcfTagAttribute(string name, bool hideFromSpec = false)\n        {\n            TagName = name;\n            HideFromSpec = hideFromSpec;\n        }\n\n        /// <summary>\n        ///     Tag name\n        /// </summary>\n        public string TagName { get; set; }\n        \n        /// <summary>\n        ///     Hide tag from spec\n        /// </summary>\n        public bool HideFromSpec { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Configuration/SettingCollection.cs",
    "content": "﻿using System;\nusing System.Configuration;\n\nnamespace SwaggerWcf.Configuration\n{\n    [ConfigurationCollection(typeof(TagElement), AddItemName = \"setting\")]\n    public class SettingCollection : ConfigurationElementCollection\n    {\n        protected override ConfigurationElement CreateNewElement()\n        {\n            return new SettingElement();\n        }\n\n        protected override object GetElementKey(ConfigurationElement element)\n        {\n            if (element == null)\n            {\n                throw new ArgumentException(\"element\");\n            }\n            return ((SettingElement) element).Name;\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Configuration/SettingElement.cs",
    "content": "﻿using System.Configuration;\n\nnamespace SwaggerWcf.Configuration\n{\n    public class SettingElement : ConfigurationElement\n    {\n        [ConfigurationProperty(\"name\", IsRequired = true, IsKey = true)]\n        public string Name\n        {\n            get\n            {\n                return (string) this[\"name\"];\n            }\n            set\n            {\n                this[\"name\"] = value;\n            }\n        }\n\n        [ConfigurationProperty(\"value\", IsRequired = true)]\n        public string Value\n        {\n            get\n            {\n                return (string) this[\"value\"];\n            }\n            set\n            {\n                this[\"value\"] = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Configuration/SwaggerWcfSection.cs",
    "content": "﻿using System.Configuration;\n\nnamespace SwaggerWcf.Configuration\n{\n    public class SwaggerWcfSection : ConfigurationSection\n    {\n        [ConfigurationProperty(\"tags\", IsRequired = true)]\n        public TagCollection Tags\n        {\n            get\n            {\n                return (TagCollection) this[\"tags\"];\n            }\n            set\n            {\n                this[\"tags\"] = value;\n            }\n        }\n\n        [ConfigurationProperty(\"settings\", IsRequired = false)]\n        public SettingCollection Settings\n        {\n            get\n            {\n                return (SettingCollection) this[\"settings\"];\n            }\n            set\n            {\n                this[\"settings\"] = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Configuration/TagCollection.cs",
    "content": "﻿using System;\nusing System.Configuration;\n\nnamespace SwaggerWcf.Configuration\n{\n    [ConfigurationCollection(typeof(TagElement), AddItemName = \"tag\")]\n    public class TagCollection : ConfigurationElementCollection\n    {\n        protected override ConfigurationElement CreateNewElement()\n        {\n            return new TagElement();\n        }\n\n        protected override object GetElementKey(ConfigurationElement element)\n        {\n            if (element == null)\n            {\n                throw new ArgumentNullException(\"element\");\n            }\n            return ((TagElement) element).Name;\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Configuration/TagElement.cs",
    "content": "﻿using System.Configuration;\n\nnamespace SwaggerWcf.Configuration\n{\n    public class TagElement : ConfigurationElement\n    {\n        [ConfigurationProperty(\"name\", IsRequired = true, IsKey = true)]\n        public string Name\n        {\n            get\n            {\n                return (string) this[\"name\"];\n            }\n            set\n            {\n                this[\"name\"] = value;\n            }\n        }\n\n        [ConfigurationProperty(\"visible\", DefaultValue = true, IsRequired = true)]\n        public bool Visibile\n        {\n            get\n            {\n                return (bool) this[\"visible\"];\n            }\n            set\n            {\n                this[\"visible\"] = value;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/ISwaggerWcfEndpoint.cs",
    "content": "﻿using System.IO;\nusing System.ServiceModel;\nusing System.ServiceModel.Web;\n\nnamespace SwaggerWcf\n{\n    [ServiceContract]\n    public interface ISwaggerWcfEndpoint\n    {\n        [OperationContract]\n        [WebGet(UriTemplate = \"/swagger.json\", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]\n        Stream GetSwaggerFile();\n\n        [OperationContract]\n        [WebInvoke(Method = \"GET\", BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = \"/{*content}\")]\n        //[WebGet(UriTemplate = \"/\", BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]\n        Stream StaticContent(string content);\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/CollectionFormat.cs",
    "content": "﻿namespace SwaggerWcf.Models\n{\n    public enum CollectionFormat\n    {\n        Csv = 0,\n        Ssv = 1,\n        Tsv = 2,\n        Pipes = 3,\n        Multi = 4\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Models/Definition.cs",
    "content": "﻿using Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class Definition\n    {\n        public DefinitionSchema Schema { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            if (Schema == null)\n                return;\n            \n            writer.WritePropertyName(Schema.Name);\n\n            writer.WriteStartObject();\n            Schema.Serialize(writer);\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/DefinitionProperty.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class DefinitionProperty\n    {\n        public DefinitionProperty()\n        {\n            Maximum = decimal.MaxValue;\n            Minimum = decimal.MinValue;\n            MaxLength = int.MaxValue;\n            MinLength = int.MinValue;\n            MaxItems = int.MaxValue;\n            MinItems = int.MinValue;\n            MultipleOf = decimal.MinValue;\n        }\n\n        public string Title { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Required { get; set; }\n\n        public TypeFormat TypeFormat { get; set; }\n\n        public string Ref { get; set; }\n\n        public ParameterItems Items { get; set; }\n\n        public string Default { get; set; }\n\n        public object Example { get; set; }\n\n        public decimal Maximum { get; set; }\n\n        public bool ExclusiveMaximum { get; set; }\n\n        public decimal Minimum { get; set; }\n\n        public bool ExclusiveMinimum { get; set; }\n\n        public int MaxLength { get; set; }\n\n        public int MinLength { get; set; }\n\n        public string Pattern { get; set; }\n\n        public int MaxItems { get; set; }\n\n        public int MinItems { get; set; }\n\n        public bool UniqueItems { get; set; }\n\n        public List<int> Enum { get; set; }\n\n        public decimal MultipleOf { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            writer.WritePropertyName(Title);\n            writer.WriteStartObject();\n\n            if (TypeFormat.Type == ParameterType.Object)\n            {\n                writer.WritePropertyName(\"$ref\");\n                writer.WriteValue(string.Format(\"#/definitions/{0}\", Ref));\n            }\n            else\n            {\n                if (!string.IsNullOrWhiteSpace(Description))\n                {\n                    writer.WritePropertyName(\"description\");\n                    writer.WriteValue(Description);\n                }\n\n                if (TypeFormat.Type != ParameterType.Unknown)\n                {\n                    writer.WritePropertyName(\"type\");\n                    writer.WriteValue(TypeFormat.Type.ToString().ToLower());\n                    if (!string.IsNullOrWhiteSpace(TypeFormat.Format))\n                    {\n                        writer.WritePropertyName(\"format\");\n                        writer.WriteValue(TypeFormat.Format);\n                    }\n                }\n                if (TypeFormat.Type == ParameterType.Array && Items != null)\n                {\n                    writer.WritePropertyName(\"items\");\n                    Items.Serialize(writer);\n                }\n                if (!string.IsNullOrWhiteSpace(Default))\n                {\n                    writer.WritePropertyName(\"default\");\n                    writer.WriteValue(Default);\n                }\n                if (Example!=null)\n                {\n                    writer.WritePropertyName(\"example\");\n                    if (Example.GetType().IsArray)\n                    {\n                        writer.WriteStartArray();\n                        foreach (var value in (object[])Example)\n                        {\n                            writer.WriteValue(value);\n                        }\n                        writer.WriteEndArray();\n                    }\n                    else\n                        writer.WriteValue(Example);\n                }\n                if (Maximum != decimal.MaxValue)\n                {\n                    writer.WritePropertyName(\"maximum\");\n                    writer.WriteValue(Maximum);\n                    writer.WritePropertyName(\"exclusiveMaximum\");\n                    writer.WriteValue(ExclusiveMaximum);\n                }\n                if (Minimum != decimal.MinValue)\n                {\n                    writer.WritePropertyName(\"minimum\");\n                    writer.WriteValue(Minimum);\n                    writer.WritePropertyName(\"exclusiveMinimum\");\n                    writer.WriteValue(ExclusiveMinimum);\n                }\n                if (MaxLength != int.MaxValue)\n                {\n                    writer.WritePropertyName(\"maxLength\");\n                    writer.WriteValue(MaxLength);\n                }\n                if (MinLength != int.MinValue)\n                {\n                    writer.WritePropertyName(\"minLength\");\n                    writer.WriteValue(MinLength);\n                }\n                if (!string.IsNullOrWhiteSpace(Pattern))\n                {\n                    writer.WritePropertyName(\"pattern\");\n                    writer.WriteValue(Pattern);\n                }\n                if (MaxItems != int.MaxValue)\n                {\n                    writer.WritePropertyName(\"maxItems\");\n                    writer.WriteValue(MaxItems);\n                }\n                if (MinItems != int.MinValue)\n                {\n                    writer.WritePropertyName(\"minItems\");\n                    writer.WriteValue(MinItems);\n                }\n                writer.WritePropertyName(\"uniqueItems\");\n                writer.WriteValue(UniqueItems);\n                if (Enum != null && Enum.Any())\n                {\n                    writer.WritePropertyName(\"enum\");\n                    writer.WriteStartArray();\n                    foreach (int e in Enum)\n                    {\n                        writer.WriteValue(e);\n                    }\n                    writer.WriteEndArray();\n                }\n                if (MultipleOf != decimal.MinValue)\n                {\n                    writer.WritePropertyName(\"multipleOf\");\n                    writer.WriteValue(MultipleOf);\n                }\n            }\n\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/DefinitionSchema.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class DefinitionSchema\n    {\n        public TypeFormat TypeFormat { get; set; } // for primitives\n\n        public string Ref { get; set; } // for references\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public Schema ParentSchema { get; set; } //TODO: Composition and Polymorphism Support\n\n        public ExternalDocumentation ExternalDocumentation { get; set; }\n\n        public List<string> Required { get; set; }\n\n        public List<DefinitionProperty> Properties { get; set; }\n\n        public List<int> Enum { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            if (TypeFormat.Type == ParameterType.Object)\n            {\n                // complex object\n\n                if (!string.IsNullOrWhiteSpace(Description))\n                {\n                    writer.WritePropertyName(\"description\");\n                    writer.WriteValue(Description);\n                }\n\n                if (ParentSchema != null)\n                {\n                    writer.WritePropertyName(\"allOf\");\n\n                    writer.WriteStartArray();\n\n                    writer.WritePropertyName(\"$ref\");\n                    writer.WriteValue(string.Format(\"#/definitions/{0}\", ParentSchema.Name));\n\n                    writer.WriteStartObject();\n                }\n\n                SerializeRequired(writer);\n\n                SerializeExternalDocs(writer);\n\n                SerializeProperties(writer);\n\n                if (ParentSchema != null)\n                {\n                    writer.WriteEndObject();\n\n                    writer.WriteEndArray();\n                }\n            }\n            if (TypeFormat.Type != ParameterType.Unknown)\n            {\n                writer.WritePropertyName(\"type\");\n                writer.WriteValue(TypeFormat.Type.ToString().ToLower());\n                if (!string.IsNullOrWhiteSpace(TypeFormat.Format))\n                {\n                    writer.WritePropertyName(\"format\");\n                    writer.WriteValue(TypeFormat.Format);\n                }\n\n                if (TypeFormat.Type == ParameterType.Array)\n                {\n                    writer.WritePropertyName(\"items\");\n\n                    writer.WriteStartObject();\n\n                    writer.WritePropertyName(\"$ref\");\n                    writer.WriteValue(string.Format(\"#/definitions/{0}\", Ref));\n\n                    writer.WriteEndObject();\n                }\n                if (Enum != null && Enum.Any())\n                {\n                    writer.WritePropertyName(\"enum\");\n                    writer.WriteStartArray();\n                    foreach (int e in Enum)\n                    {\n                        writer.WriteValue(e);\n                    }\n                    writer.WriteEndArray();\n                }\n            }\n            else if (!string.IsNullOrWhiteSpace(Ref))\n            {\n                writer.WritePropertyName(\"$ref\");\n                writer.WriteValue(string.Format(\"#/definitions/{0}\", Ref));\n            }\n        }\n\n        private void SerializeRequired(JsonWriter writer)\n        {\n            if (Required != null && Required.Any())\n            {\n                writer.WritePropertyName(\"required\");\n                writer.WriteStartArray();\n                foreach (string req in Required)\n                {\n                    writer.WriteValue(req);\n                }\n                writer.WriteEndArray();\n            }\n        }\n\n        private void SerializeExternalDocs(JsonWriter writer)\n        {\n            if (ExternalDocumentation?.Url != null)\n            {\n                writer.WritePropertyName(\"externalDocs\");\n                ExternalDocumentation.Serialize(writer);\n            }\n        }\n\n        private void SerializeProperties(JsonWriter writer)\n        {\n            if (Properties != null && Properties.Any())\n            {\n                writer.WritePropertyName(\"properties\");\n                writer.WriteStartObject();\n                foreach (DefinitionProperty p in Properties)\n                {\n                    p.Serialize(writer);\n                }\n                writer.WriteEndObject();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/Example.cs",
    "content": "﻿namespace SwaggerWcf.Models\n{\n    internal class Example\n    {\n        public string MimeType { get; set; }\n\n        public string Content { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/ExternalDocumentation.cs",
    "content": "﻿using System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class ExternalDocumentation\n    {\n        public string Description { get; set; }\n\n        public string Url { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n\n            if (!string.IsNullOrWhiteSpace(Description))\n            {\n                writer.WritePropertyName(\"description\");\n                writer.WriteValue(Description);\n            }\n            if (!string.IsNullOrWhiteSpace(Url))\n            {\n                writer.WritePropertyName(\"url\");\n                writer.WriteValue(Url);\n            }\n\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/InType.cs",
    "content": "﻿namespace SwaggerWcf.Models\n{\n    internal enum InType\n    {\n        Unknown = 0,\n        Body = 1,\n        Path = 2,\n        Query = 3,\n        FormData = 4,\n        Header = 5\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Models/Info.cs",
    "content": "﻿using System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    public class Info\n    {\n        public string Version { get; set; }\n\n        public string Title { get; set; }\n\n        public string Description { get; set; }\n\n        public string TermsOfService { get; set; }\n\n        public InfoContact Contact { get; set; }\n\n        public InfoLicense License { get; set; }\n\n        internal void Serialize(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n\n            if (!string.IsNullOrWhiteSpace(Version))\n            {\n                writer.WritePropertyName(\"version\");\n                writer.WriteValue(Version);\n            }\n            if (!string.IsNullOrWhiteSpace(Title))\n            {\n                writer.WritePropertyName(\"title\");\n                writer.WriteValue(Title);\n            }\n            if (!string.IsNullOrWhiteSpace(Description))\n            {\n                writer.WritePropertyName(\"description\");\n                writer.WriteValue(Description);\n            }\n            if (!string.IsNullOrWhiteSpace(TermsOfService))\n            {\n                writer.WritePropertyName(\"termsOfService\");\n                writer.WriteValue(TermsOfService);\n            }\n\n            if (Contact != null)\n            {\n                writer.WritePropertyName(\"contact\");\n                Contact.Serialize(writer);\n            }\n\n            if (License != null)\n            {\n                writer.WritePropertyName(\"license\");\n                License.Serialize(writer);\n            }\n\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/InfoContact.cs",
    "content": "﻿using System.Collections.Generic;\nusing Newtonsoft.Json;\nusing System;\n\nnamespace SwaggerWcf.Models\n{\n    public class InfoContact\n    {\n        public string Name { get; set; }\n\n        public string Email { get; set; }\n\n        public string Url\n        {\n            get => _url;\n            set => _url = Uri.TryCreate(value, UriKind.Absolute, out Uri _)\n                    ? value\n                    : throw new ArgumentException(\"Value must be in the format of a URL\", nameof(Url));\n        }\n\n        private string _url;\n\n        internal void Serialize(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n\n            if (!string.IsNullOrWhiteSpace(Name))\n            {\n                writer.WritePropertyName(\"name\");\n                writer.WriteValue(Name);\n            }\n            if (!string.IsNullOrWhiteSpace(Email))\n            {\n                writer.WritePropertyName(\"email\");\n                writer.WriteValue(Email);\n            }\n            if (!string.IsNullOrWhiteSpace(Url))\n            {\n                writer.WritePropertyName(\"url\");\n                writer.WriteValue(Url);\n            }\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/InfoLicense.cs",
    "content": "﻿using System.Collections.Generic;\nusing Newtonsoft.Json;\nusing System;\n\nnamespace SwaggerWcf.Models\n{\n    public class InfoLicense\n    {\n        public string Name { get; set; }\n\n        public string Url\n        {\n            get => _url;\n            set => _url = Uri.TryCreate(value, UriKind.Absolute, out Uri _)\n                    ? value\n                    : throw new ArgumentException(\"Value must be in the format of a URL\", nameof(Url));\n        }\n\n        private string _url;\n\n        internal void Serialize(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n\n            if (!string.IsNullOrWhiteSpace(Name))\n            {\n                writer.WritePropertyName(\"name\");\n                writer.WriteValue(Name);\n            }\n            if (!string.IsNullOrWhiteSpace(Url))\n            {\n                writer.WritePropertyName(\"url\");\n                writer.WriteValue(Url);\n            }\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/ParameterBase.cs",
    "content": "﻿using System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal abstract class ParameterBase\n    {\n        public string Name { get; set; }\n\n        // body, path, query, formData (query and formData can have CollectionFormat as multi)\n        public InType In { get; set; }\n\n        public string Description { get; set; }\n\n        public bool Required { get; set; }\n        \n        public abstract void Serialize(JsonWriter writer);\n        public abstract void Serialize(JsonWriter writer, bool skipStartEndObject);\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/ParameterItems.cs",
    "content": "﻿using System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class ParameterItems\n    {\n        public TypeFormat TypeFormat { get; set; }\n\n        public ParameterBase Items { get; set; }\n        \n        public string Ref { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n\n            if (TypeFormat.Type != ParameterType.Unknown)\n            {\n                writer.WritePropertyName(\"type\");\n                writer.WriteValue(TypeFormat.Type.ToString().ToLower());\n                if (!string.IsNullOrWhiteSpace(TypeFormat.Format))\n                {\n                    writer.WritePropertyName(\"format\");\n                    writer.WriteValue(TypeFormat.Format);\n                }\n            }\n            \n            if (!string.IsNullOrWhiteSpace(Ref))\n            {\n                writer.WritePropertyName(\"$ref\");\n                writer.WriteValue($\"#/definitions/{Ref}\");\n            }\n\n            Items?.Serialize(writer, true);\n\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/ParameterPrimitive.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class ParameterPrimitive : ParameterBase\n    {\n        public ParameterPrimitive()\n        {\n            Maximum = decimal.MaxValue;\n            Minimum = decimal.MinValue;\n            MaxLength = int.MaxValue;\n            MinLength = int.MinValue;\n            MaxItems = int.MaxValue;\n            MinItems = int.MinValue;\n            MultipleOf = decimal.MinValue;\n        }\n\n        public TypeFormat TypeFormat { get; set; }\n\n        public bool AllowEmptyValue { get; set; }\n\n        public ParameterItems Items { get; set; }\n\n        public CollectionFormat CollectionFormat { get; set; }\n\n        public string Default { get; set; }\n\n        public decimal Maximum { get; set; }\n\n        public bool ExclusiveMaximum { get; set; }\n\n        public decimal Minimum { get; set; }\n\n        public bool ExclusiveMinimum { get; set; }\n\n        public int MaxLength { get; set; }\n\n        public int MinLength { get; set; }\n\n        public string Pattern { get; set; }\n\n        public int MaxItems { get; set; }\n\n        public int MinItems { get; set; }\n\n        public bool UniqueItems { get; set; }\n\n        public List<int> Enum { get; set; }\n\n        public decimal MultipleOf { get; set; }\n\n        public override void Serialize(JsonWriter writer)\n        {\n            Serialize(writer, false);\n        }\n        public override void Serialize(JsonWriter writer, bool skipStartEndObject)\n        {\n            if (!skipStartEndObject)\n                writer.WriteStartObject();\n\n            if (!string.IsNullOrWhiteSpace(Name))\n            {\n                writer.WritePropertyName(\"name\");\n                writer.WriteValue(Name);\n            }\n            if (In != InType.Unknown)\n            {\n                writer.WritePropertyName(\"in\");\n                writer.WriteValue(In.ToString().ToLower());\n            }\n            if (!string.IsNullOrWhiteSpace(Description))\n            {\n                writer.WritePropertyName(\"description\");\n                writer.WriteValue(Description);\n            }\n            if (Required)\n            {\n                writer.WritePropertyName(\"required\");\n                writer.WriteValue(Required);\n            }\n            if (TypeFormat.Type != ParameterType.Unknown)\n            {\n                if (In == InType.Body)\n                {\n                    writer.WritePropertyName(\"schema\");\n                    writer.WriteStartObject();\n\n                    writer.WritePropertyName(\"type\");\n                    writer.WriteValue(TypeFormat.Type.ToString().ToLower());\n\n                    if (TypeFormat.Type == ParameterType.Array && Items != null)\n                    {\n                        writer.WritePropertyName(\"items\");\n\n                        writer.WriteStartObject();\n\n                        writer.WritePropertyName(\"$ref\");\n                        writer.WriteValue($\"#/definitions/{Items?.Ref ?? (Items?.Items as ParameterSchema)?.SchemaRef}\");\n                        //writer.WriteValue($\"#/definitions/{Items?.Ref}\");\n\n                        writer.WriteEndObject();\n                    }\n\n                    if (!string.IsNullOrWhiteSpace(TypeFormat.Format))\n                    {\n                        writer.WritePropertyName(\"format\");\n                        writer.WriteValue(TypeFormat.Format);\n                    }\n\n                    writer.WriteEndObject();\n                }\n                else\n                {\n                    writer.WritePropertyName(\"type\");\n                    writer.WriteValue(TypeFormat.Type.ToString().ToLower());\n                    if (!string.IsNullOrWhiteSpace(TypeFormat.Format))\n                    {\n                        writer.WritePropertyName(\"format\");\n                        writer.WriteValue(TypeFormat.Format);\n                    }\n                }\n            }\n            if (AllowEmptyValue)\n            {\n                writer.WritePropertyName(\"allowEmptyValue\");\n                writer.WriteValue(AllowEmptyValue);\n            }\n            if (In != InType.Body && TypeFormat.Type == ParameterType.Array && Items != null)\n            {\n                writer.WritePropertyName(\"items\");\n                Items.Serialize(writer);\n            }\n            if (In != InType.Body && TypeFormat.Type == ParameterType.Array && Items != null)\n            {\n                writer.WritePropertyName(\"collectionFormat\");\n                writer.WriteValue(CollectionFormat);\n            }\n            if (!string.IsNullOrWhiteSpace(Default))\n            {\n                writer.WritePropertyName(\"default\");\n                writer.WriteValue(Default);\n            }\n            if (Maximum != decimal.MaxValue)\n            {\n                writer.WritePropertyName(\"maximum\");\n                writer.WriteValue(Maximum);\n                writer.WritePropertyName(\"exclusiveMaximum\");\n                writer.WriteValue(ExclusiveMaximum);\n            }\n            if (Minimum != decimal.MinValue)\n            {\n                writer.WritePropertyName(\"minimum\");\n                writer.WriteValue(Minimum);\n                writer.WritePropertyName(\"exclusiveMinimum\");\n                writer.WriteValue(ExclusiveMinimum);\n            }\n            if (MaxLength != int.MaxValue)\n            {\n                writer.WritePropertyName(\"maxLength\");\n                writer.WriteValue(MaxLength);\n            }\n            if (MinLength != int.MinValue)\n            {\n                writer.WritePropertyName(\"minLength\");\n                writer.WriteValue(MinLength);\n            }\n            if (!string.IsNullOrWhiteSpace(Pattern))\n            {\n                writer.WritePropertyName(\"pattern\");\n                writer.WriteValue(Pattern);\n            }\n            if (MaxItems != int.MaxValue)\n            {\n                writer.WritePropertyName(\"maxItems\");\n                writer.WriteValue(MaxItems);\n            }\n            if (MinItems != int.MinValue)\n            {\n                writer.WritePropertyName(\"minItems\");\n                writer.WriteValue(MinItems);\n            }\n            if (UniqueItems)\n            {\n                writer.WritePropertyName(\"uniqueItems\");\n                writer.WriteValue(UniqueItems);\n            }\n            if (Enum != null && Enum.Any())\n            {\n                writer.WritePropertyName(\"enum\");\n                writer.WriteStartArray();\n                foreach (int e in Enum)\n                {\n                    writer.WriteValue(e);\n                }\n                writer.WriteEndArray();\n            }\n            if (MultipleOf != decimal.MinValue)\n            {\n                writer.WritePropertyName(\"multipleOf\");\n                writer.WriteValue(MultipleOf);\n            }\n\n            if (!skipStartEndObject)\n                writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/ParameterSchema.cs",
    "content": "﻿using System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class ParameterSchema : ParameterBase\n    {\n        public string SchemaRef { get; set; }\n\n        public override void Serialize(JsonWriter writer)\n        {\n            Serialize(writer, false);\n        }\n        public override void Serialize(JsonWriter writer, bool skipStartEndObject)\n        {\n            if (!skipStartEndObject)\n                writer.WriteStartObject();\n\n            if (!string.IsNullOrWhiteSpace(Name))\n            {\n                writer.WritePropertyName(\"name\");\n                writer.WriteValue(Name);\n            }\n            if (In != InType.Unknown)\n            {\n                writer.WritePropertyName(\"in\");\n                writer.WriteValue(In.ToString().ToLower());\n            }\n            if (!string.IsNullOrWhiteSpace(Description))\n            {\n                writer.WritePropertyName(\"description\");\n                writer.WriteValue(Description);\n            }\n            if (Required)\n            {\n                writer.WritePropertyName(\"required\");\n                writer.WriteValue(Required);\n            }\n            if (!string.IsNullOrWhiteSpace(SchemaRef))\n            {\n                writer.WritePropertyName(\"schema\");\n                writer.WriteStartObject();\n\n                writer.WritePropertyName(\"$ref\");\n                writer.WriteValue(string.Format(\"#/definitions/{0}\", SchemaRef));\n\n                writer.WriteEndObject();\n            }\n\n            if (!skipStartEndObject)\n                writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/ParameterType.cs",
    "content": "﻿namespace SwaggerWcf.Models\n{\n    public enum ParameterType\n    {\n        Unknown = 0,\n        Void = 1,\n        String = 2,\n        Number = 3,\n        Integer = 4,\n        Boolean = 5,\n        Array = 6,\n        File = 7,\n        Object = 8\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Models/Path.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class Path\n    {\n        public Path()\n        {\n            Actions = new List<PathAction>();\n        }\n\n        public string Id { get; set; }\n        \n        public List<PathAction> Actions { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            writer.WritePropertyName(Id);\n\n            writer.WriteStartObject();\n\n            foreach (PathAction pathAction in Actions)\n            {\n                pathAction.Serialize(writer);\n            }\n\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/PathAction.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class PathAction\n    {\n        public PathAction()\n        {\n            Tags = new List<string>();\n            Consumes = new List<string>();\n            Produces = new List<string>();\n            Parameters = new List<ParameterBase>();\n            Responses = new List<Response>();\n            Schemes = new List<string>();\n        }\n\n        public string Id { get; set; }\n        \n        public List<string> Tags { get; set; }\n\n        public string Summary { get; set; }\n\n        public string Description { get; set; }\n\n        public ExternalDocumentation ExternalDocs { get; set; }\n\n        public string OperationId { get; set; }\n\n        public List<string> Consumes { get; set; }\n\n        public List<string> Produces { get; set; }\n\n        public List<ParameterBase> Parameters { get; set; }\n\n        public List<Response> Responses { get; set; }\n\n        public List<string> Schemes { get; set; }\n\n        public bool Deprecated { get; set; }\n        \n        public List<KeyValuePair<string, string[]>> Security { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            writer.WritePropertyName(Id);\n\n            writer.WriteStartObject();\n            \n            if (Tags != null && Tags.Any())\n            {\n                writer.WritePropertyName(\"tags\");\n                writer.WriteStartArray();\n                foreach (string tag in Tags)\n                {\n                    writer.WriteValue(tag);\n                }\n                writer.WriteEndArray();\n            }\n\n            if (!string.IsNullOrWhiteSpace(Summary))\n            {\n                writer.WritePropertyName(\"summary\");\n                writer.WriteValue(Summary);\n            }\n\n            if (!string.IsNullOrWhiteSpace(Description))\n            {\n                writer.WritePropertyName(\"description\");\n                writer.WriteValue(Description);\n            }\n\n            if (ExternalDocs != null)\n            {\n                writer.WritePropertyName(\"externalDocs\");\n                ExternalDocs.Serialize(writer);\n            }\n\n            if (!string.IsNullOrWhiteSpace(OperationId))\n            {\n                writer.WritePropertyName(\"operationId\");\n                writer.WriteValue(OperationId);\n            }\n\n            if (Consumes != null && Consumes.Any())\n            {\n                writer.WritePropertyName(\"consumes\");\n                writer.WriteStartArray();\n                foreach (string cons in Consumes)\n                {\n                    writer.WriteValue(cons);\n                }\n                writer.WriteEndArray();\n            }\n\n            if (Produces != null && Produces.Any())\n            {\n                writer.WritePropertyName(\"produces\");\n                writer.WriteStartArray();\n                foreach (string prod in Produces)\n                {\n                    writer.WriteValue(prod);\n                }\n                writer.WriteEndArray();\n            }\n\n            if (Parameters != null && Parameters.Any())\n            {\n                writer.WritePropertyName(\"parameters\");\n                writer.WriteStartArray();\n                foreach (ParameterBase p in Parameters)\n                {\n                    p.Serialize(writer);\n                }\n                writer.WriteEndArray();\n            }\n\n            if (Responses != null && Responses.Any())\n            {\n                writer.WritePropertyName(\"responses\");\n                writer.WriteStartObject();\n                foreach (Response r in Responses)\n                {\n                    r.Serialize(writer);\n                }\n                writer.WriteEndObject();\n            }\n\n            if (Schemes != null && Schemes.Any())\n            {\n                writer.WritePropertyName(\"schemes\");\n                writer.WriteStartArray();\n                foreach (string sch in Schemes)\n                {\n                    writer.WriteValue(sch);\n                }\n                writer.WriteEndArray();\n            }\n\n            if (Deprecated)\n            {\n                writer.WritePropertyName(\"deprecated\");\n                writer.WriteValue(Deprecated);\n            }\n\n            if (Security != null && Security.Any())\n            {\n                writer.WritePropertyName(\"security\");\n                writer.WriteStartArray();\n\n                foreach (var security in Security)\n                {\n                    writer.WriteStartObject();\n                    writer.WritePropertyName(security.Key);\n                    writer.WriteStartArray();\n\n                    if (security.Value != null && security.Value.Any())\n                    {\n                        foreach (var scopename in security.Value)\n                        {\n                            writer.WriteValue(scopename);\n                        }\n                    }\n                    writer.WriteEndArray();\n                    writer.WriteEndObject();\n                }\n\n                writer.WriteEndArray();\n            }\n\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/Property.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class Property\n    {\n        public Property()\n        {\n            Maximum = decimal.MaxValue;\n            Minimum = decimal.MinValue;\n            MaxLength = int.MaxValue;\n            MinLength = int.MinValue;\n            MaxItems = int.MaxValue;\n            MinItems = int.MinValue;\n            MultipleOf = decimal.MinValue;\n        }\n        \n        public string Title { get; set; }\n        \n        public string Description { get; set; }\n\n        public bool Required { get; set; }\n\n        public TypeFormat TypeFormat { get; set; }\n\n        public bool AllowEmptyValue { get; set; }\n\n        public ParameterItems Items { get; set; }\n\n        public CollectionFormat CollectionFormat { get; set; }\n\n        public string Default { get; set; }\n\n        public decimal Maximum { get; set; }\n\n        public bool ExclusiveMaximum { get; set; }\n\n        public decimal Minimum { get; set; }\n\n        public bool ExclusiveMinimum { get; set; }\n\n        public int MaxLength { get; set; }\n\n        public int MinLength { get; set; }\n\n        public string Pattern { get; set; }\n\n        public int MaxItems { get; set; }\n\n        public int MinItems { get; set; }\n\n        public bool UniqueItems { get; set; }\n\n        public List<int> Enum { get; set; }\n\n        public decimal MultipleOf { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n\n            if (!string.IsNullOrWhiteSpace(Title))\n            {\n                writer.WritePropertyName(\"title\");\n                writer.WriteValue(Title);\n            }\n            if (!string.IsNullOrWhiteSpace(Description))\n            {\n                writer.WritePropertyName(\"description\");\n                writer.WriteValue(Description);\n            }\n            writer.WritePropertyName(\"required\");\n            writer.WriteValue(Required);\n            if (TypeFormat.Type != ParameterType.Unknown)\n            {\n                writer.WritePropertyName(\"type\");\n                writer.WriteValue(TypeFormat.Type.ToString().ToLower());\n                if (!string.IsNullOrWhiteSpace(TypeFormat.Format))\n                {\n                    writer.WritePropertyName(\"format\");\n                    writer.WriteValue(TypeFormat.Format);\n                }\n            }\n            writer.WritePropertyName(\"allowEmptyValue\");\n            writer.WriteValue(AllowEmptyValue);\n            if (TypeFormat.Type == ParameterType.Array && Items != null)\n            {\n                writer.WritePropertyName(\"items\");\n                Items.Serialize(writer);\n            }\n            if (TypeFormat.Type == ParameterType.Array)\n            {\n                writer.WritePropertyName(\"collectionFormat\");\n                writer.WriteValue(CollectionFormat);\n            }\n            if (!string.IsNullOrWhiteSpace(Default))\n            {\n                writer.WritePropertyName(\"default\");\n                writer.WriteValue(Default);\n            }\n            if (Maximum != decimal.MaxValue)\n            {\n                writer.WritePropertyName(\"maximum\");\n                writer.WriteValue(Maximum);\n                writer.WritePropertyName(\"exclusiveMaximum\");\n                writer.WriteValue(ExclusiveMaximum);\n            }\n            if (Minimum != decimal.MinValue)\n            {\n                writer.WritePropertyName(\"minimum\");\n                writer.WriteValue(Minimum);\n                writer.WritePropertyName(\"exclusiveMinimum\");\n                writer.WriteValue(ExclusiveMinimum);\n            }\n            if (MaxLength != int.MaxValue)\n            {\n                writer.WritePropertyName(\"maxLength\");\n                writer.WriteValue(MaxLength);\n            }\n            if (MinLength != int.MinValue)\n            {\n                writer.WritePropertyName(\"minLength\");\n                writer.WriteValue(MinLength);\n            }\n            if (!string.IsNullOrWhiteSpace(Pattern))\n            {\n                writer.WritePropertyName(\"pattern\");\n                writer.WriteValue(Pattern);\n            }\n            if (MaxItems != int.MaxValue)\n            {\n                writer.WritePropertyName(\"maxItems\");\n                writer.WriteValue(MaxItems);\n            }\n            if (MinItems != int.MinValue)\n            {\n                writer.WritePropertyName(\"minItems\");\n                writer.WriteValue(MinItems);\n            }\n            writer.WritePropertyName(\"uniqueItems\");\n            writer.WriteValue(UniqueItems);\n            if (Enum != null && Enum.Any())\n            {\n                writer.WritePropertyName(\"enum\");\n                writer.WriteStartArray();\n                foreach (int e in Enum)\n                {\n                    writer.WriteValue(e);\n                }\n                writer.WriteEndArray();\n            }\n            if (MultipleOf != decimal.MinValue)\n            {\n                writer.WritePropertyName(\"multipleOf\");\n                writer.WriteValue(MultipleOf);\n            }\n            \n            writer.WriteEndObject();\n        }\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Models/Response.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class Response\n    {\n        public string Code { get; set; }\n\n        public string Description { get; set; }\n\n        public Schema Schema { get; set; }\n\n        public List<string> Headers { get; set; }\n\n        public Example Example { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            writer.WritePropertyName(Code);\n\n            writer.WriteStartObject();\n\n            if (!string.IsNullOrWhiteSpace(Description))\n            {\n                writer.WritePropertyName(\"description\");\n                writer.WriteValue(Description);\n            }\n            else\n            {\n                writer.WritePropertyName(\"description\");\n                writer.WriteValue(\"not available\");\n            }\n\n            if (Schema != null)\n            {\n                writer.WritePropertyName(\"schema\");\n                writer.WriteStartObject();\n                Schema.Serialize(writer);\n                writer.WriteEndObject();\n            }\n\n            if (Example != null)\n            {\n                writer.WritePropertyName(\"examples\");\n                writer.WriteStartObject();\n                writer.WritePropertyName(Example.MimeType);\n                writer.WriteRawValue(Example.Content);\n                writer.WriteEndObject();\n            }\n\n            if (Headers != null && Headers.Any())\n            {\n                writer.WritePropertyName(\"headers\");\n\n                writer.WriteStartObject();\n\n                foreach (var header in Headers)\n                {\n                    writer.WritePropertyName(header);\n                    writer.WriteStartObject();\n                    writer.WritePropertyName(\"type\");\n                    writer.WriteValue(\"string\");\n                    writer.WriteEndObject();\n                }\n\n                writer.WriteEndObject();\n            }\n            \n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/Schema.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal class Schema\n    {\n        public TypeFormat TypeFormat { get; set; } // for primitives\n\n        public TypeFormat ArrayTypeFormat { get; set; } // for primitives\n\n        public string Ref { get; set; } // for references\n\n        public string Name { get; set; }\n\n        public string Description { get; set; }\n\n        public Schema ParentSchema { get; set; } //TODO: Composition and Polymorphism Support\n\n        public ExternalDocumentation ExternalDocumentation { get; set; }\n\n        public List<string> Required { get; set; }\n\n        public List<Property> Properties { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            if (TypeFormat.Type == ParameterType.Object)\n            {\n                // complex object\n\n                if (!string.IsNullOrWhiteSpace(Description))\n                {\n                    writer.WritePropertyName(\"description\");\n                    writer.WriteValue(Description);\n                }\n\n                if (ParentSchema != null)\n                {\n                    writer.WritePropertyName(\"allOf\");\n\n                    writer.WriteStartArray();\n\n                    writer.WritePropertyName(\"$ref\");\n                    writer.WriteValue(string.Format(\"#/definitions/{0}\", ParentSchema.Name));\n\n                    writer.WriteStartObject();\n                }\n\n                SerializeRequired(writer);\n\n                SerializeExternalDocs(writer);\n\n                SerializeProperties(writer);\n\n                if (ParentSchema != null)\n                {\n                    writer.WriteEndObject();\n\n                    writer.WriteEndArray();\n                }\n            }\n            if (TypeFormat.Type != ParameterType.Unknown)\n            {\n                writer.WritePropertyName(\"type\");\n                writer.WriteValue(TypeFormat.Type.ToString().ToLower());\n                if (!string.IsNullOrWhiteSpace(TypeFormat.Format))\n                {\n                    writer.WritePropertyName(\"format\");\n                    writer.WriteValue(TypeFormat.Format);\n                }\n\n                if (TypeFormat.Type == ParameterType.Array)\n                {\n                    writer.WritePropertyName(\"items\");\n\n                    writer.WriteStartObject();\n\n                    if (ArrayTypeFormat.IsPrimitiveType)\n                    {\n                        writer.WritePropertyName(\"type\");\n                        writer.WriteValue(ArrayTypeFormat.Type.ToString().ToLower());\n                        if (!string.IsNullOrWhiteSpace(ArrayTypeFormat.Format))\n                        {\n                            writer.WritePropertyName(\"format\");\n                            writer.WriteValue(ArrayTypeFormat.Format);\n                        }\n                    }\n                    else\n                    {\n                        writer.WritePropertyName(\"$ref\");\n                        writer.WriteValue(string.Format(\"#/definitions/{0}\", Ref));\n                    }\n\n                    writer.WriteEndObject();\n                }\n            }\n            else if (!string.IsNullOrWhiteSpace(Ref))\n            {\n                writer.WritePropertyName(\"$ref\");\n                writer.WriteValue(string.Format(\"#/definitions/{0}\", Ref));\n            }\n        }\n\n        private void SerializeRequired(JsonWriter writer)\n        {\n            if (Required != null && Required.Any())\n            {\n                writer.WritePropertyName(\"required\");\n                writer.WriteStartArray();\n                foreach (string req in Required)\n                {\n                    writer.WriteValue(req);\n                }\n                writer.WriteEndArray();\n            }\n        }\n\n        private void SerializeExternalDocs(JsonWriter writer)\n        {\n            if (ExternalDocumentation != null)\n            {\n                writer.WritePropertyName(\"externalDocs\");\n                ExternalDocumentation.Serialize(writer);\n            }\n        }\n\n        private void SerializeProperties(JsonWriter writer)\n        {\n            if (Properties != null && Properties.Any())\n            {\n                writer.WritePropertyName(\"properties\");\n                writer.WriteStartArray();\n                foreach (Property p in Properties)\n                {\n                    p.Serialize(writer);\n                }\n                writer.WriteEndArray();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/SecurityAuthorization.cs",
    "content": "﻿using System.Collections.Generic;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    public class SecurityAuthorization\n    {\n        /// <summary>\n        /// (Required) The type of the security scheme. Valid values are \"basic\", \"apiKey\" or \"oauth2\".\n        /// </summary>\n        public string Type { get; set; }\n\n        /// <summary>\n        /// A short description for security scheme.\n        /// </summary>\n        public string Description { get; set; }\n\n        /// <summary>\n        /// (Required) The name of the header or query parameter to be used.\n        /// WARNING: Use only, when <see cref=\"Type\"/> equals \"apiKey\"\n        /// </summary>\n        public string Name { get; set; }\n\n        /// <summary>\n        /// (Required) The location of the API key. Valid values are \"query\" or \"header\".\n        /// WARNING: Use only, when <see cref=\"Type\"/> equals \"apiKey\"\n        /// </summary>\n        public string In { get; set; }\n\n        /// <summary>\n        /// (Required) The flow used by the OAuth2 security scheme. Valid values are \"implicit\", \"password\", \"application\" or \"accessCode\".\n        /// WARNING: Use only, when <see cref=\"Type\"/> equals \"oauth2\"\n        /// </summary>\n        public string Flow { get; set; }\n\n        /// <summary>\n        /// (Required) The authorization URL to be used for this flow. This SHOULD be in the form of a URL.\n        /// WARNING: Use only, when <see cref=\"Type\"/> equals \"oauth2\" and <see cref=\"Flow\"/> equals \"implicit\" or \"accessCode\"\n        /// </summary>\n        public string AuthorizationUrl { get; set; }\n\n        /// <summary>\n        /// (Required) The token URL to be used for this flow. This SHOULD be in the form of a URL.\n        /// WARNING: Use only, when <see cref=\"Type\"/> equals \"oauth2\" and <see cref=\"Flow\"/> equals \"password\" or \"application\" or \"accessCode\"\n        /// </summary>\n        public string TokenUrl { get; set; }\n\n        /// <summary>\n        /// (Required) The available scopes for the OAuth2 security scheme.\n        /// This maps between a name of a scope to a short description of it (as the value of the property).\n        /// WARNING: Use only, when <see cref=\"Type\"/> equals \"oauth2\"\n        /// </summary>\n        public Dictionary<string, string> Scopes { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n\n            if (Type != null)\n            {\n                writer.WritePropertyName(\"type\");\n                writer.WriteValue(Type);\n            }\n\n            if (Description != null)\n            {\n                writer.WritePropertyName(\"description\");\n                writer.WriteValue(Description);\n            }\n\n            if (Name != null)\n            {\n                writer.WritePropertyName(\"name\");\n                writer.WriteValue(Name);\n            }\n\n            if (In != null)\n            {\n                writer.WritePropertyName(\"in\");\n                writer.WriteValue(In);\n            }\n\n            if (Flow != null)\n            {\n                writer.WritePropertyName(\"flow\");\n                writer.WriteValue(Flow);\n            }\n\n            if (AuthorizationUrl != null)\n            {\n                writer.WritePropertyName(\"authorizationUrl\");\n                writer.WriteValue(AuthorizationUrl);\n            }\n\n            if (TokenUrl != null)\n            {\n                writer.WritePropertyName(\"tokenUrl\");\n                writer.WriteValue(TokenUrl);\n            }\n\n            if (Scopes != null)\n            {\n                writer.WritePropertyName(\"scopes\");\n                writer.WriteStartObject();\n\n                foreach (var scope in Scopes)\n                {\n                    writer.WritePropertyName(scope.Key);\n                    writer.WriteValue(scope.Value);\n                }\n\n                writer.WriteEndObject();\n            }\n         \n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/SecurityDefinitions.cs",
    "content": "﻿using System.Collections.Generic;\n\nnamespace SwaggerWcf.Models\n{\n    public class SecurityDefinitions : Dictionary<string, SecurityAuthorization>\n    {\n        //This is just a wrapper\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Models/Service.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.Linq;\nusing Newtonsoft.Json;\n\nnamespace SwaggerWcf.Models\n{\n    internal sealed class Service\n    {\n        public Service()\n        {\n            Swagger = \"2.0\";\n            Paths = new List<Path>();\n            Definitions = new List<Definition>();\n        }\n\n        public string Swagger { get; set; }\n\n        public Info Info { get; set; }\n\n        public string Host { get; set; }\n\n        public string BasePath { get; set; }\n\n        public List<string> Schemes { get; set; }\n\n        public List<Path> Paths { get; set; }\n\n        public List<Definition> Definitions { get; set; }\n\n        public SecurityDefinitions SecurityDefinitions { get; set; }\n\n        public void Serialize(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n\n            writer.WritePropertyName(\"swagger\");\n            writer.WriteValue(Swagger);\n            if (Info != null)\n            {\n                writer.WritePropertyName(\"info\");\n                Info.Serialize(writer);\n            }\n            if (Host != null)\n            {\n                writer.WritePropertyName(\"host\");\n                writer.WriteValue(Host);\n            }\n            if (BasePath != null)\n            {\n                writer.WritePropertyName(\"basePath\");\n                writer.WriteValue(BasePath);\n            }\n            if (Schemes != null && Schemes.Any())\n            {\n                writer.WritePropertyName(\"schemes\");\n                writer.WriteStartArray();\n                foreach (string sch in Schemes)\n                {\n                    writer.WriteValue(sch);\n                }\n                writer.WriteEndArray();\n            }\n            if (Paths != null && Paths.Any())\n            {\n                writer.WritePropertyName(\"paths\");\n                WritePaths(writer);\n            }\n\n            if (Definitions != null && Definitions.Any())\n            {\n                writer.WritePropertyName(\"definitions\");\n                WriteDefinitions(writer);\n            }\n\n            if (SecurityDefinitions != null && SecurityDefinitions.Any())\n            {\n                writer.WritePropertyName(\"securityDefinitions\");\n                WriteSecurityDefinitions(writer);\n            }\n\n            writer.WriteEndObject();\n        }\n\n        private void WritePaths(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n            foreach (Path p in Paths.OrderBy(p => p.Id))\n            {\n                p.Serialize(writer);\n            }\n            writer.WriteEndObject();\n        }\n\n        private void WriteDefinitions(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n            foreach (Definition d in Definitions.OrderBy(d => d.Schema.Name))\n            {\n                d.Serialize(writer);\n            }\n            writer.WriteEndObject();\n        }\n\n        private void WriteSecurityDefinitions(JsonWriter writer)\n        {\n            writer.WriteStartObject();\n            foreach (var d in SecurityDefinitions)\n            {\n                writer.WritePropertyName(d.Key);\n                d.Value.Serialize(writer);\n            }\n            writer.WriteEndObject();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Models/TypeFormat.cs",
    "content": "﻿namespace SwaggerWcf.Models\n{\n    public struct TypeFormat\n    {\n        public ParameterType Type;\n\n        public string Format;\n\n        public TypeFormat(ParameterType type, string format)\n        {\n            Type = type;\n            Format = format;\n        }\n\n        internal bool IsPrimitiveType => Type == ParameterType.Boolean ||\n                                         Type == ParameterType.Integer ||\n                                         Type == ParameterType.Number ||\n                                         Type == ParameterType.String && !string.Equals(Format, \"stream\");\n\n        // possible that enum should be included in primitive type?\n        internal bool IsEnum => Type == ParameterType.Integer && Format == \"enum\";\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"SwaggerWcf\")]\n[assembly: AssemblyDescription(\"Swagger for WCF\")]\n[assembly: AssemblyCompany(\"abelsilva\")]\n[assembly: AssemblyProduct(\"SwaggerWcf\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2018\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n#if DEBUG\n[assembly: AssemblyConfiguration(\"Debug\")]\n#else\n[assembly: AssemblyConfiguration(\"Release\")]\n#endif\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"d2eeaa63-60e5-4fda-8b62-e05dc8be8b5f\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"0.2.15\")]\n[assembly: AssemblyFileVersion(\"0.2.15\")]\n[assembly: AssemblyInformationalVersion(\"0.2.15\")]\n"
  },
  {
    "path": "src/SwaggerWcf/Support/DefinitionsBuilder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing SwaggerWcf.Attributes;\nusing SwaggerWcf.Models;\n\nnamespace SwaggerWcf.Support\n{\n    internal sealed class DefinitionsBuilder\n    {\n        public static List<Definition> Process(IList<string> hiddenTags, IList<string> visibleTags, List<Type> definitionsTypes)\n        {\n            if (definitionsTypes == null || !definitionsTypes.Any())\n                return new List<Definition>(0);\n\n            List<Definition> definitions = new List<Definition>();\n            List<Type> processedTypes = new List<Type>();\n            Stack<Type> typesStack =\n                new Stack<Type>(definitionsTypes.GroupBy(t => t.FullName).Select(grp => grp.First()));\n\n            while (typesStack.Any())\n            {\n                Type t = typesStack.Pop();\n                if (IsHidden(t, hiddenTags, visibleTags) || processedTypes.Contains(t))\n                    continue;\n\n                processedTypes.Add(t);\n                Definition definition = ConvertTypeToDefinition(t, hiddenTags, typesStack);\n                if (definition != null)\n                    definitions.Add(definition);\n            }\n\n            return definitions;\n        }\n\n        private static bool IsHidden(Type type, ICollection<string> hiddenTags, ICollection<string> visibleTags)\n        {\n            if (hiddenTags.Contains(type.FullName))\n                return true;\n\n            if (type.GetCustomAttribute<SwaggerWcfHiddenAttribute>() != null)\n            {\n                return !type.GetCustomAttributes<SwaggerWcfTagAttribute>().Select(t => t.TagName).Any(visibleTags.Contains);\n            }\n\n            return type.GetCustomAttributes<SwaggerWcfTagAttribute>().Select(t => t.TagName).Any(hiddenTags.Contains);\n        }\n\n        private static Definition ConvertTypeToDefinition(Type definitionType, IList<string> hiddenTags,\n                                                          Stack<Type> typesStack)\n        {\n            DefinitionSchema schema = new DefinitionSchema\n            {\n                Name = definitionType.GetModelName()\n            };\n\n            ProcessTypeAttributes(definitionType, schema);\n\n            // process\n            schema.TypeFormat = Helpers.MapSwaggerType(definitionType, null);\n\n            if (schema.TypeFormat.IsPrimitiveType)\n                return null;\n\n            if (schema.TypeFormat.Type == ParameterType.Integer && schema.TypeFormat.Format == \"enum\")\n            {\n                schema.Enum = new List<int>();\n\n                Type propType = definitionType;\n\n                if (propType.IsGenericType && propType.GetGenericTypeDefinition() == typeof(Nullable<>))\n                    propType = propType.GetEnumerableType();\n\n                List<string> listOfEnumNames = propType.GetEnumNames().ToList();\n                foreach (string enumName in listOfEnumNames)\n                {\n                    schema.Enum.Add(GetEnumMemberValue(propType, enumName));\n                }\n            }\n            else if (schema.TypeFormat.Type == ParameterType.Array)\n            {\n                Type t = GetEnumerableType(definitionType);\n\n                if (t != null)\n                {\n                    schema.Ref = definitionType.GetModelName();\n                    typesStack.Push(t);\n                }\n            }\n            else\n            {\n                schema.Properties = new List<DefinitionProperty>();\n                TypePropertiesProcessor.ProcessProperties(definitionType, schema, hiddenTags, typesStack);\n                TypeFieldsProcessor.ProcessFields(definitionType, schema, hiddenTags, typesStack);\n            }\n\n            return new Definition\n            {\n                Schema = schema\n            };\n        }\n\n        private static void ProcessTypeAttributes(Type definitionType, DefinitionSchema schema)\n        {\n            DescriptionAttribute descAttr = definitionType.GetCustomAttribute<DescriptionAttribute>();\n            if (descAttr != null)\n                schema.Description = descAttr.Description;\n\n            SwaggerWcfDefinitionAttribute definitionAttr =\n                definitionType.GetCustomAttribute<SwaggerWcfDefinitionAttribute>();\n            if (definitionAttr != null)\n            {\n                if (!string.IsNullOrWhiteSpace(definitionAttr.ExternalDocsDescription) ||\n                    !string.IsNullOrWhiteSpace(definitionAttr.ExternalDocsUrl))\n                {\n                    schema.ExternalDocumentation = new ExternalDocumentation\n                    {\n                        Description = definitionAttr.ExternalDocsDescription,\n                        Url = definitionAttr.ExternalDocsUrl\n                    };\n                }\n\n                if (!string.IsNullOrWhiteSpace(definitionAttr.ModelName))\n                    schema.Name = definitionAttr.ModelName;\n            }\n        }\n\n        public static Type GetEnumerableType(Type type)\n        {\n            if (type == null)\n                return null;\n\n            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>))\n                return type.GetGenericArguments()[0];\n\n            Type iface = (from i in type.GetInterfaces()\n                          where i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IEnumerable<>)\n                          select i).FirstOrDefault();\n\n            return iface == null ? null : GetEnumerableType(iface);\n        }\n\n        private static T LastValidValue<T>(IEnumerable<SwaggerWcfPropertyAttribute> attrs,\n                                           Func<SwaggerWcfPropertyAttribute, T> getter)\n        {\n            return attrs.Select(getter).LastOrDefault(x => x != null);\n        }\n\n        private static void ApplyIfValid<T>(T opt, Action<T> setter)\n        {\n            if (opt != null)\n            {\n                setter(opt);\n            }\n        }\n\n        public static void ApplyAttributeOptions(PropertyInfo propertyInfo, DefinitionProperty prop)\n        {\n            // Use the DataContract [DefaultValue] as the default, by default\n            var defAttr = propertyInfo.GetCustomAttributes<DefaultValueAttribute>().LastOrDefault();\n            if (defAttr != null)\n            {\n                prop.Default = defAttr.Value.ToString();\n            }\n\n            // Apply any [SwaggerWcfProperty]s in order.\n            var attrs = propertyInfo.GetCustomAttributes<SwaggerWcfPropertyAttribute>().ToList();\n            if (!attrs.Any())\n            {\n                return;\n            }\n            ApplyAttributeOptions(attrs, prop);\n        }\n\n        public static void ApplyAttributeOptions(FieldInfo fieldInfo, DefinitionProperty prop)\n        {\n            // Use the DataContract [DefaultValue] as the default, by default\n            var defAttr = fieldInfo.GetCustomAttributes<DefaultValueAttribute>().LastOrDefault();\n            if (defAttr != null)\n            {\n                prop.Default = defAttr.Value.ToString();\n            }\n\n            // Apply any [SwaggerWcfProperty]s in order.\n            var attrs = fieldInfo.GetCustomAttributes<SwaggerWcfPropertyAttribute>().ToList();\n            if (!attrs.Any())\n            {\n                return;\n            }\n            ApplyAttributeOptions(attrs, prop);\n        }\n\n        public static void ApplyAttributeOptions(IEnumerable<SwaggerWcfPropertyAttribute> attrs, DefinitionProperty prop)\n        {\n            ApplyIfValid(LastValidValue(attrs, a => a.Title), x => prop.Title = x);\n            ApplyIfValid(LastValidValue(attrs, a => a.Description), x => prop.Description = x);\n            ApplyIfValid(LastValidValue(attrs, a => a._Required), x => prop.Required = x.Value);\n            //ApplyIfValid(LastValidValue(attrs, a => a._AllowEmptyValue),  x => prop.AllowEmptyValue  = x.Value);\n            //ApplyIfValid(LastValidValue(attrs, a => a._CollectionFormat), x => prop.CollectionFormat = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a.Default), x => prop.Default = x);\n            ApplyIfValid(LastValidValue(attrs, a => a.Example), x => prop.Example = x);\n            ApplyIfValid(LastValidValue(attrs, a => a._Maximum), x => prop.Maximum = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a._ExclusiveMaximum), x => prop.ExclusiveMaximum = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a._Minimum), x => prop.Minimum = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a._ExclusiveMinimum), x => prop.ExclusiveMinimum = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a._MaxLength), x => prop.MaxLength = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a._MinLength), x => prop.MinLength = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a.Pattern), x => prop.Pattern = x);\n            ApplyIfValid(LastValidValue(attrs, a => a._MaxItems), x => prop.MaxItems = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a._MinItems), x => prop.MinItems = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a._UniqueItems), x => prop.UniqueItems = x.Value);\n            ApplyIfValid(LastValidValue(attrs, a => a._MultipleOf), x => prop.MultipleOf = x.Value);\n        }\n        \n        public static int GetEnumMemberValue(Type enumType, string enumName)\n        {\n            if (string.IsNullOrWhiteSpace(enumName))\n                return 0;\n            var enumVal = Enum.Parse(enumType, enumName, true);\n            var underlyingType = Enum.GetUnderlyingType(enumType);\n            var val = Convert.ChangeType(enumVal, underlyingType);\n            return Convert.ToInt32(val);\n        }\n\n        public static string GetEnumDescription(Enum value)\n        {\n            FieldInfo fi = value.GetType().GetField(value.ToString());\n\n            DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false);\n\n            if (attributes.Length > 0)\n            {\n                return attributes[0].Description;\n            }\n\n            return \"\";\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Support/EnumerableExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace SwaggerWcf.Support\n{\n    public static class EnumerableExtensions\n    {\n        public static IEnumerable<T> FilterUnique<T>(this IEnumerable<T> list)\n        {\n            return list.GroupBy(e => e).Select(g => g.Key);\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Support/Helpers.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Web;\nusing SwaggerWcf.Configuration;\nusing SwaggerWcf.Models;\n\nnamespace SwaggerWcf.Support\n{\n    internal static class Helpers\n    {\n        public static TypeFormat MapSwaggerType(Type type, IList<Type> definitions = null)\n        {\n            //built-in types\n            if (type == typeof(bool))\n            {\n                return new TypeFormat(ParameterType.Boolean, null);\n            }\n            if (type == typeof(byte))\n            {\n                return new TypeFormat(ParameterType.String, \"byte\");\n            }\n            if (type == typeof(sbyte))\n            {\n                return new TypeFormat(ParameterType.String, \"sbyte\");\n            }\n            if (type == typeof(char))\n            {\n                return new TypeFormat(ParameterType.String, \"char\");\n            }\n            if (type == typeof(decimal))\n            {\n                return new TypeFormat(ParameterType.Number, \"decimal\");\n            }\n            if (type == typeof(double))\n            {\n                return new TypeFormat(ParameterType.Number, \"double\");\n            }\n            if (type == typeof(float))\n            {\n                return new TypeFormat(ParameterType.Number, \"float\");\n            }\n            if (type == typeof(int))\n            {\n                return new TypeFormat(ParameterType.Integer, \"int32\");\n            }\n            if (type == typeof(uint))\n            {\n                return new TypeFormat(ParameterType.Number, \"uint32\");\n            }\n            if (type == typeof(long))\n            {\n                return new TypeFormat(ParameterType.Integer, \"int64\");\n            }\n            if (type == typeof(ulong))\n            {\n                return new TypeFormat(ParameterType.Integer, \"uint64\");\n            }\n            if (type == typeof(short))\n            {\n                return new TypeFormat(ParameterType.Integer, \"int16\");\n            }\n            if (type == typeof(ushort))\n            {\n                return new TypeFormat(ParameterType.Integer, \"uint16\");\n            }\n            if (type == typeof(string))\n            {\n                return new TypeFormat(ParameterType.String, null);\n            }\n            if (type == typeof(DateTime))\n            {\n                return new TypeFormat(ParameterType.String, \"date-time\");\n            }\n            if (type == typeof(DateTimeOffset))\n            {\n                return new TypeFormat(ParameterType.String, \"date-time\");\n            }\n            if (type == typeof(Guid))\n            {\n                return new TypeFormat(ParameterType.String, \"guid\");\n            }\n            if (type == typeof(Stream))\n            {\n                return new TypeFormat(ParameterType.String, \"stream\");\n            }\n\n            if (type == typeof(void))\n            {\n                return new TypeFormat(ParameterType.Void, null);\n            }\n\n            //it's an enum, use string as the property type and enum values will be serialized later\n            if (type.IsEnum)\n            {\n                return new TypeFormat(ParameterType.Integer, \"enum\");\n            }\n\n            //it's a collection/array, so it will use the swagger \"container\" syntax\n            if (type.GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IEnumerable<>)))\n            {\n                return new TypeFormat(ParameterType.Array, null);\n            }\n\n            //it's a collection/array, so it will use the swagger \"container\" syntax\n            if (type.GetInterfaces().Any(i => i == typeof(System.Collections.IEnumerable)))\n            {\n                return new TypeFormat(ParameterType.Array, null);\n            }\n\n            //it's a Nullable<T> so treat it as T - we'll handle making it not-required later\n            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))\n            {\n                return MapSwaggerType(type.GenericTypeArguments[0], definitions);\n            }\n\n            //it's a complex type, so we'll need to map it later\n            if (definitions != null && !definitions.Contains(type))\n            {\n                definitions.Add(type);\n            }\n\n            return new TypeFormat(ParameterType.Object, HttpUtility.HtmlEncode(type.GetModelName()));\n        }\n\n        private static string BuildTypeString(string typeName, string defaultNote = null, string typeNote = null)\n        {\n            const string resultFormat = \"{0}({1})\";\n\n            if (string.IsNullOrEmpty(defaultNote) && string.IsNullOrEmpty(typeNote))\n            {\n                return typeName;\n            }\n\n            return string.IsNullOrEmpty(typeNote)\n                       ? string.Format(resultFormat, typeName, defaultNote)\n                       : string.Format(resultFormat, typeName, typeNote);\n        }\n\n        public static T1 GetCustomAttributeValue<T1, T2>(MethodInfo method, string propertyName)\n            where T1 : class\n            where T2 : Attribute\n        {\n            var attr = method.GetCustomAttribute<T2>();\n            if (attr == null)\n            {\n                return null;\n            }\n\n            PropertyInfo prop = typeof(T2).GetProperty(propertyName);\n            if (prop == null || prop.PropertyType != typeof(T1))\n            {\n                return null;\n            }\n\n            return prop.GetValue(attr) as T1;\n        }\n\n        public static bool GetCustomAttributeValue<T>(MethodInfo method, string propertyName, bool defaultVal = false)\n            where T : Attribute\n        {\n            var attr = method.GetCustomAttribute<T>();\n            if (attr == null)\n            {\n                return defaultVal;\n            }\n\n            PropertyInfo prop = typeof(T).GetProperty(propertyName);\n            if (prop == null || prop.PropertyType != typeof(bool))\n            {\n                return defaultVal;\n            }\n\n            return (bool)prop.GetValue(attr);\n        }\n\n        internal static TypeFormat MapElementType(Type type, List<Type> definitions)\n        {\n            Type enumType =\n                type.GetInterfaces()\n                    .FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IEnumerable<>));\n            if (enumType == null)\n            {\n                throw new ArgumentException(\"Type must be an IEnumerable<T>.\");\n            }\n\n            Type elementType = enumType.GetGenericArguments().First();\n\n            return MapSwaggerType(elementType, definitions);\n        }\n\n        internal static bool TagIsHidden(this Dictionary<string, TagElement> tagConfigurations,\n                                         IEnumerable<string> itemTags)\n        {\n            return tagConfigurations.Values.Any(t => t.Visibile.Equals(false) && itemTags.Contains(t.Name));\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Support/ListExtensions.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace SwaggerWcf.Support\n{\n    public static class ListExtensions\n    {\n        public static string ClosestMatch(this List<string> list, string value)\n        {\n            int matchValue = int.MaxValue;\n            string result = null;\n            foreach (string s in list)\n            {\n                int val = Compute(s, value);\n                if (val > matchValue)\n                    continue;\n\n                matchValue = val;\n                result = s;\n            }\n\n            return result;\n        }\n\n        // from https://stackoverflow.com/a/13793600/4309405\n        /// <summary>\n        /// Compute the distance between two strings.\n        /// </summary>\n        private static int Compute(string s, string t)\n        {\n            int n = s.Length;\n            int m = t.Length;\n            int[,] d = new int[n + 1, m + 1];\n\n            // Step 1\n            if (n == 0)\n                return m;\n\n            if (m == 0)\n                return n;\n\n            // Step 2\n            for (int i = 0; i <= n; d[i, 0] = i++)\n            {\n            }\n            \n            for (int j = 0; j <= m; d[0, j] = j++)\n            {\n            }\n\n            // Step 3\n            for (int i = 1; i <= n; i++)\n            {\n                //Step 4\n                for (int j = 1; j <= m; j++)\n                {\n                    // Step 5\n                    int cost = (t[j - 1] == s[i - 1]) ? 0 : 1;\n\n                    // Step 6\n                    d[i, j] = Math.Min(Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1), d[i - 1, j - 1] + cost);\n                }\n            }\n            // Step 7\n            return d[n, m];\n        }\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Support/Mapper.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing System.ServiceModel;\nusing System.ServiceModel.Web;\nusing System.Text.RegularExpressions;\nusing System.Threading.Tasks;\nusing System.Web;\nusing SwaggerWcf.Attributes;\nusing SwaggerWcf.Models;\n\nnamespace SwaggerWcf.Support\n{\n    internal class Mapper\n    {\n        internal Mapper(IList<string> hiddenTags, List<string> visibleTags)\n        {\n            HiddenTags = hiddenTags ?? new List<string>();\n            VisibleTags = visibleTags ?? new List<string>();\n        }\n\n        internal readonly IEnumerable<string> HiddenTags;\n        internal readonly IEnumerable<string> VisibleTags;\n\n        internal IEnumerable<Path> FindMethods(Type markedType, IList<Type> definitionsTypesList, string basePath = null)\n        {\n            List<Path> paths = new List<Path>();\n            List<Tuple<string, PathAction>> pathActions = new List<Tuple<string, PathAction>>();\n\n            List <Type> types;\n            Type serviceType;\n            if (markedType.IsInterface)\n            {\n                //search for service impl type\n                var allTypes = AppDomain.CurrentDomain\n                    .GetAssemblies()\n                    .SelectMany(s => s.GetTypes())\n                    .Where(type => markedType.IsAssignableFrom(type) && !type.IsInterface)\n                    .ToList();\n\n                serviceType = allTypes.Except(allTypes.Select(type => type.BaseType)).Single();\n\n                types = new List<Type> { markedType };\n            }\n            else\n            {\n                serviceType = markedType;\n\n                //search all interfaces for this type for potential DataContracts, and build a set of items\n                types = serviceType.GetInterfaces().ToList();\n                types.Add(serviceType);\n            }\n\n            foreach (Type i in types)\n            {\n                Attribute dc = i.GetCustomAttribute(typeof(ServiceContractAttribute));\n                if (dc == null)\n                    continue;\n\n                //found a DataContract, now get a service map and inspect the methods for WebGet/WebInvoke\n                if (i.IsInterface)\n                {\n                    InterfaceMapping map = serviceType.GetInterfaceMap(i);\n                    pathActions.AddRange(GetActions(map.TargetMethods, map.InterfaceMethods, definitionsTypesList));\n\n                    //Nested Interface\n                    var baseInterfaces = i.GetInterfaces();\n                    if (baseInterfaces != null)\n                    {\n                        foreach (var baseInterface in baseInterfaces)\n                        {\n                            var _map = serviceType.GetInterfaceMap(baseInterface);\n                            pathActions.AddRange(GetActions(_map.TargetMethods, _map.InterfaceMethods, definitionsTypesList));\n                        }\n                    }\n                }\n                else\n                {\n                    pathActions.AddRange(GetActions(i.GetMethods(), i.GetMethods(), definitionsTypesList));\n                }\n            }\n\n            foreach (var pathAction in pathActions)\n            {\n                var path = pathAction.Item1;\n                if (!path.StartsWith(\"/\"))\n                    path = \"/\" + path;\n\n                if (string.IsNullOrWhiteSpace(basePath) == false)\n                    path = basePath + path;\n\n                GetPath(path, paths).Actions.Add(pathAction.Item2);\n            }\n\n            return paths;\n        }\n\n        private Path GetPath(string id, List<Path> paths)\n        {\n            var path = paths.FirstOrDefault(p => p.Id == id);\n            if (path == null)\n            {\n                path = new Path\n                {\n                    Id = id,\n                    Actions = new List<PathAction>()\n                };\n                paths.Add(path);\n            }\n\n            return path;\n        }\n\n        private static string ConcatPaths(string basePath, string pathUrl)\n        {\n            string path = basePath;\n            if (basePath.EndsWith(\"/\") && pathUrl.StartsWith(\"/\"))\n                path += pathUrl.Substring(1);\n            else if (!basePath.EndsWith(\"/\") && !string.IsNullOrWhiteSpace(pathUrl) && !pathUrl.StartsWith(\"/\"))\n                path += \"/\" + pathUrl;\n            else\n                path += pathUrl;\n            return path;\n        }\n\n        internal IEnumerable<Tuple<string, PathAction>> GetActions(MethodInfo[] targetMethods,\n                                                                   MethodInfo[] interfaceMethods,\n                                                                   IList<Type> definitionsTypesList)\n        {\n            int methodsCounts = interfaceMethods.Count();\n            for (int index = 0; index < methodsCounts; index++)\n            {\n                MethodInfo implementation = targetMethods[index];\n                MethodInfo declaration = interfaceMethods[index];\n\n                //if a tag from either implementation or declaration is marked as not visible, skip it\n                List<SwaggerWcfTagAttribute> methodTags =\n                    implementation.GetCustomAttributes<SwaggerWcfTagAttribute>().ToList();\n                methodTags =\n                    methodTags.Concat(declaration.GetCustomAttributes<SwaggerWcfTagAttribute>()).ToList();\n\n                methodTags = methodTags.Distinct().ToList();\n\n                if (methodTags.Select(t => t.TagName).Any(HiddenTags.Contains))\n                    continue;\n\n                //if the method is marked Hidden anywhere, skip it\n                if ((implementation.GetCustomAttribute<SwaggerWcfHiddenAttribute>() != null ||\n                     declaration.GetCustomAttribute<SwaggerWcfHiddenAttribute>() != null) &&\n                    !methodTags.Select(t => t.TagName).Any(VisibleTags.Contains))\n                    continue;\n\n                //find the WebGet/Invoke attributes, or skip if neither is present\n                WebGetAttribute wg = declaration.GetCustomAttribute<WebGetAttribute>();\n                WebInvokeAttribute wi = declaration.GetCustomAttribute<WebInvokeAttribute>();\n                if (wg == null && wi == null)\n                    continue;\n\n                string httpMethod = (wi == null) ? \"GET\" : wi.Method ?? \"POST\";\n                string uriTemplate = GetUriTemplate(wi, wg, declaration);\n\n                bool wrappedRequest = IsRequestWrapped(wg, wi);\n                bool wrappedResponse = IsResponseWrapped(wg, wi);\n\n                //implementation description overrides interface description\n                string description =\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(implementation, \"Description\") ??\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(declaration, \"Description\") ??\n                    Helpers.GetCustomAttributeValue<string, DescriptionAttribute>(implementation, \"Description\") ??\n                    Helpers.GetCustomAttributeValue<string, DescriptionAttribute>(declaration, \"Description\") ??\n                    \"\";\n\n                string summary =\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(implementation, \"Summary\") ??\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(declaration, \"Summary\") ??\n                    \"\";\n\n                string operationId =\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(implementation, \"OperationId\") ??\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(declaration, \"OperationId\") ??\n                    \"\";\n                if (operationId == \"\")\n                {\n                    if (implementation.DeclaringType != null)\n                        operationId = implementation.DeclaringType.FullName + \".\";\n                    operationId += implementation.Name;\n                }\n\n                string externalDocsDescription =\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(implementation,\n                                                                                     \"ExternalDocsDescription\") ??\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(declaration,\n                                                                                     \"ExternalDocsDescription\") ??\n                    \"\";\n\n                string externalDocsUrl =\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(implementation, \"ExternalDocsUrl\") ??\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(declaration, \"ExternalDocsUrl\") ??\n                    \"\";\n\n                ExternalDocumentation externalDocs = null;\n                if (!string.IsNullOrWhiteSpace(externalDocsDescription) || !string.IsNullOrWhiteSpace(externalDocsUrl))\n                {\n                    externalDocs = new ExternalDocumentation\n                    {\n                        Description = externalDocsDescription,\n                        Url = HttpUtility.HtmlEncode(externalDocsUrl)\n                    };\n                }\n\n                bool deprecated =\n                    Helpers.GetCustomAttributeValue<SwaggerWcfPathAttribute>(implementation, \"Deprecated\");\n                if (!deprecated)\n                    deprecated = Helpers.GetCustomAttributeValue<SwaggerWcfPathAttribute>(declaration, \"Deprecated\");\n\n                string operationPath =\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(implementation, \"OperationPath\") ??\n                    Helpers.GetCustomAttributeValue<string, SwaggerWcfPathAttribute>(declaration, \"OperationPath\");\n                if (!string.IsNullOrWhiteSpace(operationPath))\n                {\n                    uriTemplate = ConcatPaths(operationPath, uriTemplate);\n                }\n\n                PathAction operation = new PathAction\n                {\n                    Id = httpMethod.ToLowerInvariant(),\n                    Summary = summary,\n                    Description = description,\n                    Tags =\n                        methodTags.Where(t => !t.HideFromSpec).Select(t => HttpUtility.HtmlEncode(t.TagName)).ToList(),\n                    Consumes = new List<string>(GetConsumes(implementation, declaration)),\n                    Produces = new List<string>(GetProduces(implementation, declaration)),\n                    Deprecated = deprecated,\n                    OperationId = HttpUtility.HtmlEncode(operationId),\n                    ExternalDocs = externalDocs,\n                    Responses = GetResponseCodes(implementation, declaration, wrappedResponse, definitionsTypesList),\n                    Security = GetMethodSecurity(implementation, declaration)\n                    // Schemes = TODO: how to get available schemes for this WCF service? (schemes: http/https)\n                };\n\n                //try to map each implementation parameter to the uriTemplate.\n                ParameterInfo[] parameters = declaration.GetParameters();\n                if (parameters.Any())\n                    operation.Parameters = new List<ParameterBase>();\n\n                List<SwaggerWcfHeaderAttribute> headers =\n                    implementation.GetCustomAttributes<SwaggerWcfHeaderAttribute>().ToList();\n                headers = headers.Concat(declaration.GetCustomAttributes<SwaggerWcfHeaderAttribute>()).ToList();\n\n                // remove duplicates\n                headers = headers.GroupBy(h => h.Name).Select(g => g.First()).ToList();\n\n                // parameters - headers\n                foreach (SwaggerWcfHeaderAttribute attr in headers)\n                {\n                    operation.Parameters.Add(new ParameterPrimitive\n                    {\n                        Name = attr.Name,\n                        Description = attr.Description,\n                        Default = attr.DefaultValue,\n                        In = InType.Header,\n                        Required = attr.Required,\n                        TypeFormat = new TypeFormat(ParameterType.String, null)\n                    });\n                }\n\n                bool isGetRequest = httpMethod == \"GET\";\n                int bodyParameterCount = parameters.Where(p => GetInType(uriTemplate, p.Name) == InType.Body).Count();\n                TypeBuilder typeBuilder = null;\n                if (!wrappedRequest && !isGetRequest && bodyParameterCount > 1)\n                {\n                    wrappedRequest = true;\n                }\n                if (wrappedRequest)\n                {\n                    typeBuilder = new TypeBuilder(implementation.GetWrappedName(declaration));\n                }\n\n                var declarationName = declaration.Name;\n                foreach (ParameterInfo parameter in parameters)\n                {\n                    SwaggerWcfParameterAttribute settings =\n                        implementation.GetParameters()\n                            .First(p => p.Position.Equals(parameter.Position))\n                            .GetCustomAttribute<SwaggerWcfParameterAttribute>() ??\n                        parameter.GetCustomAttribute<SwaggerWcfParameterAttribute>();\n\n                    if (implementation.GetParameters()\n                            .First(p => p.Position.Equals(parameter.Position))\n                            .GetCustomAttribute<SwaggerWcfHiddenAttribute>() != null ||\n                        parameter.GetCustomAttribute<SwaggerWcfHiddenAttribute>() != null)\n                        continue;\n\n                    List<SwaggerWcfTagAttribute> piTags =\n                        methodTags.Concat(parameter.GetCustomAttributes<SwaggerWcfTagAttribute>())\n                            .ToList();\n\n                    InType inType = GetInType(uriTemplate, parameter.Name);\n\n                    if (inType == InType.Body && wrappedRequest)\n                    {\n                        bool required = settings != null && settings.Required;\n\n                        if (!required && !parameter.HasDefaultValue)\n                            required = true;\n\n                        typeBuilder.AddField(parameter.Name, parameter.ParameterType, required);\n\n                        continue;\n                    }\n\n                    if (piTags.Select(t => t.TagName).Any(HiddenTags.Contains))\n                        continue;\n\n                    Type type = settings == null || settings.ParameterType == null\n                        ? parameter.ParameterType\n                        : settings.ParameterType;\n\n                    TypeFormat typeFormat = Helpers.MapSwaggerType(type, definitionsTypesList);\n\n                    operation.Parameters.Add(GetParameter(typeFormat, declaration, implementation, parameter, settings, uriTemplate, wrappedRequest,\n                                                          definitionsTypesList, inType));\n                }\n\n                if (wrappedRequest)\n                {\n                    TypeFormat typeFormat = Helpers.MapSwaggerType(typeBuilder.Type, definitionsTypesList);\n\n                    operation.Parameters.Add(new ParameterSchema\n                    {\n                        Name = implementation.GetWrappedName(declaration) + \"Wrapper\",\n                        In = InType.Body,\n                        Required = true,\n                        SchemaRef = typeFormat.Format\n                    });\n                }\n\n                if (!string.IsNullOrWhiteSpace(uriTemplate))\n                {\n                    int indexOfQuestionMark = uriTemplate.IndexOf('?');\n                    if (indexOfQuestionMark >= 0)\n                        uriTemplate = uriTemplate.Substring(0, indexOfQuestionMark);\n\n                    uriTemplate = RemoveParametersDefaultValuesFromUri(uriTemplate);\n                }\n                yield return new Tuple<string, PathAction>(uriTemplate, operation);\n            }\n        }\n\n        private string GetUriTemplate(WebInvokeAttribute wi, WebGetAttribute wg, MethodInfo declaration)\n        {\n            return ((wi == null) ? wg.UriTemplate : wi.UriTemplate) ?? declaration.Name;\n        }\n\n        private string RemoveParametersDefaultValuesFromUri(string uriTemplate)\n        {\n            Regex regWithDefaultValue = new Regex(@\"\\{[a-zA-Z0-9_]+(=[a-zA-Z0-9_]+)\\}\");\n            if (!regWithDefaultValue.Match(uriTemplate).Success)\n                return uriTemplate;\n\n            string res = uriTemplate;\n            int currIndex = 0;\n            Match match;\n            while ((match = regWithDefaultValue.Match(res)).Success)\n            {\n                res = res.Substring(currIndex, match.Groups[1].Index) +\n                      res.Substring(match.Groups[1].Index + match.Groups[1].Length);\n            }\n\n            return res;\n        }\n\n        private static bool IsRequestWrapped(WebGetAttribute wg, WebInvokeAttribute wi)\n        {\n            return (wg != null) &&\n                   (wg.BodyStyle == WebMessageBodyStyle.Wrapped || wg.BodyStyle == WebMessageBodyStyle.WrappedRequest)\n                   ||\n                   (wi != null) &&\n                   (wi.BodyStyle == WebMessageBodyStyle.Wrapped || wi.BodyStyle == WebMessageBodyStyle.WrappedRequest);\n        }\n\n        private static bool IsResponseWrapped(WebGetAttribute wg, WebInvokeAttribute wi)\n        {\n            return (wg != null) &&\n                   (wg.BodyStyle == WebMessageBodyStyle.Wrapped || wg.BodyStyle == WebMessageBodyStyle.WrappedResponse)\n                   ||\n                   (wi != null) &&\n                   (wi.BodyStyle == WebMessageBodyStyle.Wrapped || wi.BodyStyle == WebMessageBodyStyle.WrappedResponse);\n        }\n\n        private ParameterBase GetParameter(TypeFormat typeFormat,\n                                           MethodInfo declaration,\n                                           MethodInfo implementation,\n                                           ParameterInfo parameter,\n                                           SwaggerWcfParameterAttribute settings,\n                                           string uriTemplate,\n                                           bool wrappedRequest,\n                                           IList<Type> definitionsTypesList,\n                                           InType inType)\n        {\n            string description = settings?.Description;\n            bool required = settings != null && settings.Required;\n            string name = inType == InType.Query ? ResolveParameterNameFromUri(uriTemplate, parameter) : parameter.Name;\n\n            if (inType == InType.Path)\n                required = true;\n\n            if (!required && !parameter.HasDefaultValue)\n                required = true;\n\n            Type paramType = settings == null || settings.ParameterType == null\n                ? parameter.ParameterType\n                : settings.ParameterType;\n            if (paramType.IsGenericType && paramType.GetGenericTypeDefinition() == typeof(Nullable<>))\n            {\n                required = false;\n                paramType = paramType.GenericTypeArguments[0];\n            }\n\n            if (typeFormat.Type == ParameterType.Object)\n            {\n                return new ParameterSchema\n                {\n                    Name = name,\n                    Description = description,\n                    In = inType,\n                    Required = required,\n                    SchemaRef = typeFormat.Format\n                };\n            }\n\n            if (inType == InType.Body)\n            {\n                if (typeFormat.Type == ParameterType.Array)\n                {\n                    Type t = paramType.GetElementType() ?? GetEnumerableType(paramType);\n                    TypeFormat subTypeFormat = Helpers.MapSwaggerType(t);\n\n                    ParameterItems items;\n\n                    if (subTypeFormat.IsPrimitiveType || subTypeFormat.IsEnum)\n                    {\n                        items = new ParameterItems\n                        {\n                            TypeFormat = subTypeFormat\n                        };\n                    }\n                    else\n                    {\n                        items = new ParameterItems\n                        {\n                            Items = new ParameterSchema\n                            {\n\n                                SchemaRef = t.GetModelName()\n                            }\n                        };\n                    }\n\n                    ParameterPrimitive arrayParam = new ParameterPrimitive\n                    {\n                        Name = name,\n                        Description = description,\n                        In = inType,\n                        Required = required,\n                        TypeFormat = typeFormat,\n                        Items = items,\n                        CollectionFormat = CollectionFormat.Csv\n                    };\n\n                    //it's a complex type, so we'll need to map it later\n                    if (definitionsTypesList != null && !definitionsTypesList.Contains(t))\n                    {\n                        definitionsTypesList.Add(t);\n                    }\n\n                    return arrayParam;\n                }\n                if (typeFormat.IsPrimitiveType || typeFormat.IsEnum)\n                {\n                    bool isGetRequest = implementation.GetCustomAttributes<WebGetAttribute>().Any() ||\n                                        declaration.GetCustomAttributes<WebGetAttribute>().Any();\n                    if (!isGetRequest)\n                    {\n                        WebInvokeAttribute webInvoke = implementation.GetCustomAttribute<WebInvokeAttribute>()\n                                                       ?? declaration.GetCustomAttribute<WebInvokeAttribute>();\n                        if (webInvoke != null && webInvoke.Method == \"GET\")\n                            isGetRequest = true;\n                    }\n                    if (!wrappedRequest && isGetRequest)\n                    {\n                        ParameterPrimitive paramPrimitive = new ParameterPrimitive\n                        {\n                            Name = name,\n                            Description = description,\n                            In = InType.Query,\n                            Required = required,\n                            TypeFormat = typeFormat\n                        };\n                        return paramPrimitive;\n                    }\n                    else\n                    {\n                        ParameterPrimitive paramPrimitive = new ParameterPrimitive\n                        {\n                            Name = name,\n                            Description = description,\n                            In = inType,\n                            Required = required,\n                            TypeFormat = typeFormat\n                        };\n                        return paramPrimitive;\n                    }\n                }\n\n                //it's a complex type, so we'll need to map it later\n                if (definitionsTypesList != null && !definitionsTypesList.Contains(paramType))\n                {\n                    definitionsTypesList.Add(paramType);\n                }\n\n                typeFormat = new TypeFormat(ParameterType.Object,\n                                             HttpUtility.HtmlEncode(paramType.GetModelName()));\n\n                return new ParameterSchema\n                {\n                    Name = name,\n                    Description = description,\n                    In = inType,\n                    Required = required,\n                    SchemaRef = typeFormat.Format\n                };\n            }\n\n            ParameterPrimitive param = new ParameterPrimitive\n            {\n                Name = name,\n                Description = description,\n                In = inType,\n                Required = required,\n                TypeFormat = typeFormat\n            };\n\n            return param;\n        }\n\n        private static string ResolveParameterNameFromUri(string uriTemplate, ParameterInfo parameter)\n        {\n            int questionMarkPosition = uriTemplate.IndexOf(\"?\", StringComparison.Ordinal);\n            var uriParameters = HttpUtility.ParseQueryString(uriTemplate.Substring(questionMarkPosition + 1));\n\n            string parameterTemplate = GetParameterNameTemplate(parameter.Name);\n\n            var resolvedParameter = uriParameters\n                .AllKeys\n                .Select(k => new { Name = k, Template = uriParameters.Get(k) })\n                .FirstOrDefault(p => p.Template.Equals(parameterTemplate, StringComparison.Ordinal));\n\n            return resolvedParameter != null ? resolvedParameter.Name : parameter.Name;\n        }\n\n        private static string GetParameterNameTemplate(string parameterName)\n        {\n            return $\"{{{parameterName}}}\";\n        }\n\n        private InType GetInType(string uriTemplate, string parameterName)\n        {\n            Match match = new Regex(GetParameterNameTemplate(parameterName)).Match(uriTemplate);\n\n            if (!match.Success)\n                return InType.Body;\n\n            int questionMarkPosition = uriTemplate.IndexOf(\"?\", StringComparison.Ordinal);\n\n            if (questionMarkPosition == -1)\n                return InType.Path;\n\n            return questionMarkPosition > match.Index ? InType.Path : InType.Query;\n        }\n\n        private IEnumerable<string> GetConsumes(MethodInfo implementation, MethodInfo declaration)\n        {\n            string[] overrides = implementation\n                .GetCustomAttributes<SwaggerWcfContentTypesAttribute>()\n                .Concat(declaration.GetCustomAttributes<SwaggerWcfContentTypesAttribute>())\n                .Select(attr => attr.ConsumeTypes)\n                .FirstOrDefault(types => types != null && types.Length > 0);\n\n            if (overrides != null)\n            {\n                return overrides;\n            }\n\n            List<string> contentTypes = new List<string>();\n            if (declaration.GetCustomAttributes<WebGetAttribute>().Any(a => a.IsRequestFormatSetExplicitly))\n            {\n                contentTypes.AddRange(\n                    declaration.GetCustomAttributes<WebGetAttribute>()\n                        .Select(a => ConvertWebMessageFormatToContentType(a.RequestFormat)));\n            }\n            else if (declaration.GetCustomAttributes<WebInvokeAttribute>().Any(a => a.IsRequestFormatSetExplicitly))\n            {\n                contentTypes.AddRange(\n                    declaration.GetCustomAttributes<WebInvokeAttribute>()\n                        .Select(a => ConvertWebMessageFormatToContentType(a.RequestFormat)));\n            }\n            if (!contentTypes.Any())\n                contentTypes.AddRange(new[] { \"application/json\", \"application/xml\" });\n\n            return contentTypes;\n        }\n\n        private IEnumerable<string> GetProduces(MethodInfo implementation, MethodInfo declaration)\n        {\n            string[] overrides = implementation.GetCustomAttributes<SwaggerWcfContentTypesAttribute>()\n                .Concat(declaration.GetCustomAttributes<SwaggerWcfContentTypesAttribute>())\n                .Select(attr => attr.ProduceTypes)\n                .FirstOrDefault(types => types != null && types.Length > 0);\n\n            if (overrides != null)\n            {\n                return overrides;\n            }\n\n            List<string> contentTypes = new List<string>();\n            if (declaration.GetCustomAttributes<WebGetAttribute>().Any(a => a.IsResponseFormatSetExplicitly))\n            {\n                contentTypes.AddRange(\n                    declaration.GetCustomAttributes<WebGetAttribute>()\n                        .Select(a => ConvertWebMessageFormatToContentType(a.ResponseFormat)));\n            }\n            else if (declaration.GetCustomAttributes<WebInvokeAttribute>().Any(a => a.IsResponseFormatSetExplicitly))\n            {\n                contentTypes.AddRange(\n                    declaration.GetCustomAttributes<WebInvokeAttribute>()\n                        .Select(a => ConvertWebMessageFormatToContentType(a.ResponseFormat)));\n            }\n            if (!contentTypes.Any())\n                contentTypes.AddRange(new[] { \"application/json\", \"application/xml\" });\n\n            return contentTypes;\n        }\n\n        private string ConvertWebMessageFormatToContentType(WebMessageFormat format)\n        {\n            switch (format)\n            {\n                case WebMessageFormat.Xml:\n                    return \"application/xml\";\n                case WebMessageFormat.Json:\n                default:\n                    return \"application/json\";\n            }\n        }\n\n        private List<Response> GetResponseCodes(MethodInfo implementation, MethodInfo declaration, bool wrappedResponse,\n                                                IList<Type> definitionsTypesList)\n        {\n            Type returnType = implementation.GetCustomAttributes<SwaggerWcfReturnTypeAttribute>()\n                                  .Concat(declaration.GetCustomAttributes<SwaggerWcfReturnTypeAttribute>())\n                                  .Select(attr => attr.ReturnType)\n                                  .FirstOrDefault()\n                              ?? declaration.ReturnType;\n\n            if (returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(Nullable<>))\n                returnType = returnType.GenericTypeArguments[0];\n\n            Schema schema = returnType.IsEnum\n                                ? BuildSchemaForEnum(returnType, definitionsTypesList)\n                                : BuildSchema(returnType, implementation, declaration, wrappedResponse, definitionsTypesList);\n\n            List<SwaggerWcfResponseAttribute> responses =\n                implementation.GetCustomAttributes<SwaggerWcfResponseAttribute>().ToList();\n            responses = responses.Concat(declaration.GetCustomAttributes<SwaggerWcfResponseAttribute>()).FilterUnique().ToList();\n\n            List<Response> res =\n                responses.Select(ra => ConvertResponse(ra, schema, implementation, declaration, wrappedResponse, definitionsTypesList))\n                    .ToList();\n\n            if (!res.Any())\n            {\n                res.Add(new Response\n                {\n                    Code = \"default\",\n                    Schema = schema\n                });\n            }\n\n            return res;\n        }\n\n        private Response ConvertResponse(SwaggerWcfResponseAttribute ra, Schema schema, MethodInfo implementation, MethodInfo declaration,\n                                         bool wrappedResponse, IList<Type> definitionsTypesList)\n        {\n            Schema s = schema;\n\n            if (ra.EmptyResponseOverride)\n                s = null;\n            else if (ra.ResponseTypeOverride != null)\n                s = BuildSchema(ra.ResponseTypeOverride, implementation, declaration, wrappedResponse, definitionsTypesList);\n            else if (schema != null && schema.TypeFormat.Type == ParameterType.Array)\n            {\n                Type type = schema.Ref != null ? Type.GetType(schema.Ref) : null;\n                if (type != null)\n                {\n                    TypeFormat arrayTypeFormat = Helpers.MapSwaggerType(type);\n                    if (arrayTypeFormat.IsPrimitiveType)\n                    {\n                        schema.ArrayTypeFormat = arrayTypeFormat;\n                    }\n                }\n            }\n            return new Response\n            {\n                Code = ra.Code,\n                Description = ra.Description,\n                Schema = s,\n                Headers = (ra.Headers != null) ? ra.Headers.ToList() : null,\n                Example = GetExample(ra)\n            };\n        }\n\n        private Example GetExample(SwaggerWcfResponseAttribute ra)\n        {\n            if (string.IsNullOrWhiteSpace(ra.ExampleContent))\n                return null;\n\n            return new Example\n            {\n                MimeType = ra.ExampleMimeType,\n                Content = ra.ExampleContent\n            };\n        }\n\n        private Schema BuildSchemaForEnum(Type returnType, IList<Type> definitionsTypesList)\n        {\n            //it's a complex type, so we'll need to map it later\n            if (definitionsTypesList != null && !definitionsTypesList.Contains(returnType))\n            {\n                definitionsTypesList.Add(returnType);\n            }\n            TypeFormat typeFormat = new TypeFormat(ParameterType.Unknown, null);\n\n            return new Schema\n            {\n                TypeFormat = typeFormat,\n                Ref = HttpUtility.HtmlEncode(returnType.GetModelName())\n            };\n        }\n\n        private Schema BuildSchema(Type type, MethodInfo implementation, MethodInfo declaration, bool wrappedResponse, IList<Type> definitionsTypesList)\n        {\n            if (type == typeof(void) || type == typeof(Task))\n                return null;\n\n            if (type.BaseType == typeof(Task))\n                type = GetTaskInnerType(type);\n\n            TypeFormat typeFormat;\n            if (wrappedResponse)\n            {\n                string funcName = implementation.Name;\n\n                string typeName = implementation.GetCustomAttribute<SwaggerWcfReturnTypeAttribute>()?.Name\n                                  ?? declaration.GetCustomAttribute<SwaggerWcfReturnTypeAttribute>()?.Name\n                                  ?? funcName + \"Result\";\n\n                TypeBuilder typeBuilder = new TypeBuilder(typeName + \"Wrapper\");\n\n                typeBuilder.AddField(typeName, type, true);\n\n                typeFormat = Helpers.MapSwaggerType(typeBuilder.Type, definitionsTypesList);\n            }\n            else\n            {\n                typeFormat = Helpers.MapSwaggerType(type, definitionsTypesList);\n            }\n\n            switch (typeFormat.Type)\n            {\n                case ParameterType.Object:\n                    return new Schema\n                    {\n                        Ref = typeFormat.Format\n                    };\n                case ParameterType.Array:\n                    Type t = type.GetElementType() ?? GetEnumerableType(type);\n                    if (t == null)\n                        return null;\n\n                    TypeFormat arrayTypeFormat = Helpers.MapSwaggerType(t);\n                    if (arrayTypeFormat.IsPrimitiveType)\n                    {\n                        return new Schema\n                        {\n                            TypeFormat = typeFormat,\n                            ArrayTypeFormat = arrayTypeFormat\n                        };\n                    }\n                    else\n                    {\n                        definitionsTypesList.Add(t);\n                        return new Schema\n                        {\n                            TypeFormat = typeFormat,\n                            Ref = HttpUtility.HtmlEncode(t.GetModelName())\n                        };\n                    }\n                default:\n                    definitionsTypesList.Add(type);\n                    return new Schema\n                    {\n                        TypeFormat = typeFormat\n                    };\n            }\n        }\n\n        private static object GetDefaultValue(Type type)\n        {\n            try\n            {\n                return Activator.CreateInstance(type);\n            }\n            catch (Exception)\n            {\n                return null;\n            }\n        }\n\n        private static Type GetTaskInnerType(Type type)\n        {\n            if (type == null)\n                return null;\n\n            return type.BaseType == typeof(Task) ? type.GetGenericArguments()[0] : type;\n        }\n\n        private static List<KeyValuePair<string, string[]>> GetMethodSecurity(MethodInfo implementation, MethodInfo declaration)\n        {\n            var securityMethodAttributes = implementation.GetCustomAttributes<SwaggerWcfSecurityAttribute>().ToList();\n            var securityInterfaceAttributes = declaration.GetCustomAttributes<SwaggerWcfSecurityAttribute>().ToList();\n\n            var securityAttributes = securityMethodAttributes.Concat(securityInterfaceAttributes).ToList();\n\n            if (securityAttributes.Any() == false)\n                return null;\n\n            var security = new List<KeyValuePair<string, string[]>>();\n\n            foreach (var securityAttribute in securityAttributes)\n            {\n                security.Add(new KeyValuePair<string, string[]>(securityAttribute.SecurityDefinitionName, securityAttribute.SecurityDefinitionScopes));\n            }\n\n\n            return security;\n        }\n\n        public static Type GetEnumerableType(Type type)\n        {\n            if (type == null)\n                return null;\n\n            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(IEnumerable<>))\n                return type.GetGenericArguments()[0];\n\n            Type iface = (from i in type.GetInterfaces()\n                          where i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IEnumerable<>)\n                          select i).FirstOrDefault();\n\n            return iface == null ? null : GetEnumerableType(iface);\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Support/MethodInfoExtensions.cs",
    "content": "﻿using System;\nusing System.Linq;\nusing System.Reflection;\nusing SwaggerWcf.Attributes;\n\nnamespace SwaggerWcf.Support\n{\n    public static class MethodInfoExtensions\n    {\n        public static string GetWrappedName(this MethodInfo implementation, MethodInfo declaration)\n        {\n            return implementation.GetCustomAttribute<SwaggerWcfRequestTypeAttribute>()?.Name\n                   ?? declaration.GetCustomAttribute<SwaggerWcfRequestTypeAttribute>()?.Name\n                   ?? (implementation.Name.Contains('.')\n                       ? implementation.Name.Substring(implementation.Name.LastIndexOf(\".\", StringComparison.Ordinal) + 1)\n                       : implementation.Name);\n        }\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf/Support/Serializer.cs",
    "content": "﻿using System.Collections.Generic;\nusing System.IO;\nusing System.Text;\nusing Newtonsoft.Json;\nusing SwaggerWcf.Models;\n\nnamespace SwaggerWcf.Support\n{\n    internal class Serializer\n    {\n        internal static string Process(Service service)\n        {\n            var sb = new StringBuilder();\n            var sw = new StringWriter(sb);\n            using (JsonWriter writer = new JsonTextWriter(sw))\n            {\n                service.Serialize(writer);\n            }\n            return sb.ToString();\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Support/ServiceBuilder.cs",
    "content": "﻿using System;\r\nusing System.Collections.Generic;\r\nusing System.Configuration;\r\nusing System.Linq;\r\nusing System.Reflection;\r\nusing Newtonsoft.Json;\r\nusing SwaggerWcf.Attributes;\r\nusing SwaggerWcf.Configuration;\r\nusing SwaggerWcf.Models;\r\nusing SettingElement = SwaggerWcf.Configuration.SettingElement;\r\n\r\nnamespace SwaggerWcf.Support\r\n{\r\n    internal class ServiceBuilder\r\n    {\r\n        public static Service Build(string path)\r\n        {\r\n            return BuildServiceCommon(path, BuildPaths);\r\n        }\r\n\r\n        public static Service Build<TBusiness>(string path)\r\n        {\r\n            return BuildServiceCommon(path, BuildPaths<TBusiness>);\r\n        }\r\n\r\n        private static Service BuildServiceCommon(string path, Action<Service, IList<string>, List<string>, IList<Type>> buildPaths)\r\n        {\r\n            const string sectionName = \"swaggerwcf\";\r\n            SwaggerWcfSection config =\r\n                (SwaggerWcfSection)(ConfigurationManager.GetSection(sectionName) ?? new SwaggerWcfSection());\r\n\r\n            List<Type> definitionsTypesList = new List<Type>();\r\n            Service service = new Service();\r\n            List<string> hiddenTags = SwaggerWcfEndpoint.FilterHiddenTags(path, GetHiddenTags(config));\r\n            List<string> visibleTags = SwaggerWcfEndpoint.FilterVisibleTags(path, GetVisibleTags(config));\r\n            IReadOnlyDictionary<string, string> settings = GetSettings(config);\r\n\r\n            ProcessSettings(service, settings);\r\n\r\n            buildPaths(service, hiddenTags, visibleTags, definitionsTypesList);\r\n\r\n            service.Definitions = DefinitionsBuilder.Process(hiddenTags, visibleTags, definitionsTypesList);\r\n\r\n            return service;\r\n        }\r\n\r\n\r\n        private static List<string> GetHiddenTags(SwaggerWcfSection config)\r\n        {\r\n            return config.Tags?.OfType<TagElement>()\r\n                       .Where(t => t.Visibile.Equals(false))\r\n                       .Select(t => t.Name)\r\n                       .ToList() ?? new List<string>();\r\n        }\r\n\r\n        private static List<string> GetVisibleTags(SwaggerWcfSection config)\r\n        {\r\n            return config.Tags?.OfType<TagElement>()\r\n                       .Where(t => t.Visibile.Equals(true))\r\n                       .Select(t => t.Name)\r\n                       .ToList() ?? new List<string>();\r\n        }\r\n\r\n        private static IReadOnlyDictionary<string, string> GetSettings(SwaggerWcfSection config)\r\n        {\r\n            return config.Settings?.OfType<SettingElement>().ToDictionary(se => se.Name, se => se.Value)\r\n                ?? new Dictionary<string, string>();\r\n        }\r\n\r\n        private static void ProcessSettings(Service service, IReadOnlyDictionary<string, string> settings)\r\n        {\r\n            if (settings.ContainsKey(\"BasePath\"))\r\n                service.BasePath = settings[\"BasePath\"];\r\n            if (settings.ContainsKey(\"Host\"))\r\n                service.Host = settings[\"Host\"];\r\n            if (settings.ContainsKey(\"Schemes\"))\r\n                service.Schemes = settings[\"Schemes\"].Split(';').ToList();\r\n\r\n            if (settings.Keys.Any(k => k.StartsWith(\"Info\")))\r\n                service.Info = new Info();\r\n            if (settings.ContainsKey(\"InfoDescription\"))\r\n                service.Info.Description = settings[\"InfoDescription\"];\r\n            if (settings.ContainsKey(\"InfoVersion\"))\r\n                service.Info.Version = settings[\"InfoVersion\"];\r\n            if (settings.ContainsKey(\"InfoTermsOfService\"))\r\n                service.Info.TermsOfService = settings[\"InfoTermsOfService\"];\r\n            if (settings.ContainsKey(\"InfoTitle\"))\r\n                service.Info.Title = settings[\"InfoTitle\"];\r\n\r\n            if (settings.Keys.Any(k => k.StartsWith(\"InfoContact\")))\r\n                service.Info.Contact = new InfoContact();\r\n            if (settings.ContainsKey(\"InfoContactName\"))\r\n                service.Info.Contact.Name = settings[\"InfoContactName\"];\r\n            if (settings.ContainsKey(\"InfoContactUrl\"))\r\n                service.Info.Contact.Url = settings[\"InfoContactUrl\"];\r\n            if (settings.ContainsKey(\"InfoContactEmail\"))\r\n                service.Info.Contact.Email = settings[\"InfoContactEmail\"];\r\n\r\n            if (settings.Keys.Any(k => k.StartsWith(\"InfoLicense\")))\r\n                service.Info.License = new InfoLicense();\r\n            if (settings.ContainsKey(\"InfoLicenseUrl\"))\r\n                service.Info.License.Url = settings[\"InfoLicenseUrl\"];\r\n            if (settings.ContainsKey(\"InfoLicenseName\"))\r\n                service.Info.License.Name = settings[\"InfoLicenseName\"];\r\n        }\r\n\r\n        private static void BuildPaths(Service service, IList<string> hiddenTags, List<string> visibleTags, IList<Type> definitionsTypesList)\r\n        {\r\n            service.Paths = new List<Path>();\r\n\r\n            var types = GetAssemblyTypes(hiddenTags);\r\n            var useBasePathProperty = types.Select(t => t.GetCustomAttribute<SwaggerWcfAttribute>().ServicePath)\r\n                                   .Distinct()\r\n                                   .Count() == 1;\r\n            \r\n            foreach (var ti in types)\r\n            {\r\n                var da = ti.GetCustomAttribute<SwaggerWcfAttribute>();\r\n\r\n                if (service.Info is null)\r\n                    service.Info = ti.GetServiceInfo();\r\n\r\n                var mapper = new Mapper(hiddenTags, visibleTags);\r\n                  \r\n                if (string.IsNullOrWhiteSpace(service.BasePath) && useBasePathProperty)\r\n                    service.BasePath = da.ServicePath;\r\n\r\n                if (service.BasePath != null && service.BasePath.EndsWith(\"/\"))\r\n                    service.BasePath = service.BasePath.Substring(0, service.BasePath.Length - 1);\r\n\r\n                string basePath = null;\r\n                if (!useBasePathProperty)\r\n                {\r\n                    basePath = da.ServicePath;\r\n\r\n                    if (basePath != null && basePath.EndsWith(\"/\"))\r\n                        basePath = basePath.Substring(0, basePath.Length - 1);\r\n                    if (basePath != null && basePath.StartsWith(\"/\") == false)\r\n                        basePath = \"/\" + basePath;\r\n                }\r\n\r\n                var paths = mapper.FindMethods(ti.AsType(), definitionsTypesList, basePath);\r\n                service.Paths.AddRange(paths);\r\n            }\r\n        }\r\n\r\n        private static IEnumerable<TypeInfo> GetAssemblyTypes(IList<string> hiddenTags)\r\n        {\r\n            var assemblies = AppDomain.CurrentDomain.GetAssemblies();\r\n\r\n            foreach (var assembly in assemblies)\r\n            {\r\n                IEnumerable<TypeInfo> types;\r\n                try\r\n                {\r\n                    types = assembly.DefinedTypes;\r\n                }\r\n                catch (Exception)\r\n                {\r\n                    // ignore assembly and continue\r\n                    continue;\r\n                }\r\n\r\n                foreach (TypeInfo ti in types)\r\n                {\r\n                    var da = ti.GetCustomAttribute<SwaggerWcfAttribute>();\r\n                    if (da == null || hiddenTags.Any(ht => ht == ti.AsType().Name))\r\n                        continue;\r\n\r\n                    yield return ti;\r\n                }\r\n            }\r\n        }\r\n\r\n        private static void BuildPaths<TBusiness>(Service service, IList<string> hiddenTags, List<string> visibleTags, IList<Type> definitionsTypesList)\r\n        {\r\n            var type = typeof(TBusiness);\r\n            service.Paths = new List<Path>();\r\n\r\n            var da = type.GetCustomAttribute<SwaggerWcfAttribute>();\r\n            if (da == null || hiddenTags.Any(ht => ht == type.Name))\r\n                return;\r\n\r\n            var mapper = new Mapper(hiddenTags, visibleTags);\r\n\r\n            if (string.IsNullOrWhiteSpace(service.BasePath))\r\n                service.BasePath = da.ServicePath;\r\n\r\n            if (service.BasePath.EndsWith(\"/\"))\r\n                service.BasePath = service.BasePath.Substring(0, service.BasePath.Length - 1);\r\n\r\n            var paths = mapper.FindMethods(type, definitionsTypesList);\r\n            service.Paths.AddRange(paths);\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "src/SwaggerWcf/Support/StaticContent.cs",
    "content": "﻿using System.IO;\nusing System.IO.Compression;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace SwaggerWcf.Support\n{\n    public class StaticContent\n    {\n        private const string ZipFileName = \"SwaggerWcf.www.swagger-ui.zip\";\n        private static readonly ZipArchive Archive;\n        private static ZipArchive _archiveCustom;\n\n        internal static GetFileCustomDelegate GetFileCustom;\n\n        static StaticContent()\n        {\n            try\n            {\n                Assembly assembly = Assembly.GetAssembly(typeof(StaticContent));\n                Stream zipStream = assembly.GetManifestResourceStream(ZipFileName);\n\n                if (zipStream == null)\n                    return;\n\n                Archive = new ZipArchive(zipStream);\n            }\n            catch { }\n        }\n\n        internal static void SetArchiveCustom(Stream zipCustomStream)\n        {\n            try\n            {\n                if (zipCustomStream == null)\n                    return;\n\n                _archiveCustom = new ZipArchive(zipCustomStream);\n            }\n            catch { }\n        }\n\n        public static Stream GetFile(string filename, out string contentType, out long contentLength)\n        {\n            if (GetFileCustom != null)\n            {\n                Stream output = GetFileCustom(filename, out contentType, out contentLength);\n                if (output != null)\n                    return output;\n            }\n\n            contentType = GetContentType(filename);\n\n            if (_archiveCustom != null)\n            {\n                ZipArchiveEntry file = _archiveCustom.Entries.FirstOrDefault(entry => entry.FullName == filename);\n                if (file != null && contentType != null)\n                {\n                    contentLength = file.Length;\n                    return file.Open();\n                }\n            }\n\n            if (Archive != null)\n            {\n                ZipArchiveEntry file = Archive.Entries.FirstOrDefault(entry => entry.FullName == filename);\n                if (file != null && contentType != null)\n                {\n                    contentLength = file.Length;\n                    return file.Open();\n                }\n            }\n\n            return ReturnError(out contentType, out contentLength);\n        }\n\n        private static Stream ReturnError(out string contentType, out long contentLength)\n        {\n            contentType = \"\";\n            contentLength = 0;\n            return Stream.Null;\n        }\n\n        private static string GetContentType(string filename)\n        {\n            int lastIndexOfDot = filename.LastIndexOf('.');\n            if (lastIndexOfDot < 0)\n                return null;\n\n            string extension = filename.Substring(lastIndexOfDot + 1);\n            switch (extension.ToLower())\n            {\n                case \"html\":\n                    return \"text/html\";\n\n                case \"js\":\n                    return \"application/javascript\";\n\n                case \"css\":\n                    return \"text/css\";\n\n                case \"svg\":\n                    return \"image/svg+xml\";\n\n                case \"ttf\":\n                    return \"application/x-font-ttf\";\n\n                case \"eot\":\n                    return \"application/vnd.ms-fontobject\";\n\n                case \"woff\":\n                    return \"application/font-woff\";\n\n                case \"woff2\":\n                    return \"application/font-woff2\";\n\n                case \"gif\":\n                    return \"image/gif\";\n\n                case \"ico\":\n                    return \"image/x-icon\";\n\n                case \"png\":\n                    return \"image/png\";\n\n                default:\n                    return null;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Support/TypeBuilder.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Reflection;\nusing System.Reflection.Emit;\nusing System.Runtime.Serialization;\n\nnamespace SwaggerWcf.Support\n{\n    public class TypeBuilder\n    {\n        public TypeBuilder(string typeName)\n        {\n            TypeName = typeName;\n            Fields = new Dictionary<string, Tuple<Type,bool>>();\n        }\n\n        private string TypeName { get; set; }\n        private Dictionary<string, Tuple<Type,bool>> Fields { get; set; }\n\n        public Type Type\n        {\n            get\n            {\n                return CompileResultType();\n            }\n        }\n\n        public void AddField(string fieldName, Type fieldType, bool required)\n        {\n            if (Fields.ContainsKey(fieldName))\n                Fields[fieldName] = new Tuple<Type, bool>(fieldType, required);\n            else\n                Fields.Add(fieldName, new Tuple<Type, bool>(fieldType, required));\n        }\n\n\n        public Type CompileResultType()\n        {\n            System.Reflection.Emit.TypeBuilder tb = GetTypeBuilder();\n            ConstructorBuilder constructor =\n                tb.DefineDefaultConstructor(MethodAttributes.Public | MethodAttributes.SpecialName |\n                                            MethodAttributes.RTSpecialName);\n            \n            // NOTE: assuming your list contains Field objects with fields FieldName(string) and FieldType(Type)\n            foreach (KeyValuePair<string, Tuple<Type,bool>> field in Fields)\n                CreateProperty(tb, field.Key, field.Value.Item1, field.Value.Item2);\n\n            Type objectType = tb.CreateType();\n            return objectType;\n        }\n\n        private System.Reflection.Emit.TypeBuilder GetTypeBuilder()\n        {\n            string typeSignature = TypeName;\n            AssemblyName an = new AssemblyName(typeSignature);\n            AssemblyBuilder assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(an, AssemblyBuilderAccess.Run);\n            ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule(\"MainModule\");\n            System.Reflection.Emit.TypeBuilder tb = moduleBuilder.DefineType(typeSignature,\n                                                                             TypeAttributes.Public |\n                                                                             TypeAttributes.Class |\n                                                                             TypeAttributes.AutoClass |\n                                                                             TypeAttributes.AnsiClass |\n                                                                             TypeAttributes.BeforeFieldInit |\n                                                                             TypeAttributes.AutoLayout,\n                                                                             null);\n            return tb;\n        }\n\n        private static void CreateProperty(System.Reflection.Emit.TypeBuilder tb, string propertyName, Type propertyType, bool required)\n        {\n            FieldBuilder fieldBuilder = tb.DefineField(\"_\" + propertyName, propertyType, FieldAttributes.Private);\n\n            PropertyBuilder propertyBuilder = tb.DefineProperty(propertyName, PropertyAttributes.HasDefault, propertyType, null);\n            MethodBuilder getPropMthdBldr = tb.DefineMethod(\"get_\" + propertyName,\n                                                            MethodAttributes.Public | MethodAttributes.SpecialName |\n                                                            MethodAttributes.HideBySig, propertyType, Type.EmptyTypes);\n            ILGenerator getIl = getPropMthdBldr.GetILGenerator();\n\n            getIl.Emit(OpCodes.Ldarg_0);\n            getIl.Emit(OpCodes.Ldfld, fieldBuilder);\n            getIl.Emit(OpCodes.Ret);\n\n            MethodBuilder setPropMthdBldr =\n                tb.DefineMethod(\"set_\" + propertyName,\n                                MethodAttributes.Public |\n                                MethodAttributes.SpecialName |\n                                MethodAttributes.HideBySig,\n                                null, new[] { propertyType });\n\n            ILGenerator setIl = setPropMthdBldr.GetILGenerator();\n            Label modifyProperty = setIl.DefineLabel();\n            Label exitSet = setIl.DefineLabel();\n\n            setIl.MarkLabel(modifyProperty);\n            setIl.Emit(OpCodes.Ldarg_0);\n            setIl.Emit(OpCodes.Ldarg_1);\n            setIl.Emit(OpCodes.Stfld, fieldBuilder);\n\n            setIl.Emit(OpCodes.Nop);\n            setIl.MarkLabel(exitSet);\n            setIl.Emit(OpCodes.Ret);\n\n            Type[] ctorParams = { };\n            ConstructorInfo contructorInfo = typeof(DataMemberAttribute).GetConstructor(ctorParams);\n\n            CustomAttributeBuilder customAttrBuilder = new CustomAttributeBuilder(contructorInfo, new object[] { });\n            //TODO: set IsRequired here ??\n\n            propertyBuilder.SetCustomAttribute(customAttrBuilder);\n\n            propertyBuilder.SetGetMethod(getPropMthdBldr);\n            propertyBuilder.SetSetMethod(setPropMthdBldr);\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Support/TypeExtensions.cs",
    "content": "﻿using SwaggerWcf.Attributes;\nusing SwaggerWcf.Models;\nusing System;\nusing System.Linq;\nusing System.Reflection;\n\nnamespace SwaggerWcf.Support\n{\n    internal static class TypeExtensions\n    {\n        public static Type GetEnumerableType(this Type type)\n        {\n            Type elementType = type.GetElementType();\n            if (elementType != null)\n                return elementType;\n\n            Type[] genericArguments = type.GetGenericArguments();\n\n            return genericArguments.Any() ? genericArguments[0] : null;\n        }\n\n        public static string GetModelName(this Type type) =>\n            type.GetCustomAttribute<SwaggerWcfDefinitionAttribute>()?.ModelName ?? type.FullName;\n\n        public static string GetModelWrappedName(this Type type) =>\n            type.GetCustomAttribute<SwaggerWcfDefinitionAttribute>()?.ModelName ?? type.FullName;\n\n        internal static Info GetServiceInfo(this TypeInfo typeInfo)\n        {\n            var infoAttr = typeInfo.GetCustomAttribute<SwaggerWcfServiceInfoAttribute>() ??\n                throw new ArgumentException($\"{typeInfo.FullName} does not have {nameof(SwaggerWcfServiceInfoAttribute)}\");\n\n            var info = (Info)infoAttr;\n\n            var contactAttr = typeInfo.GetCustomAttribute<SwaggerWcfContactInfoAttribute>();\n            if (contactAttr != null)\n            {\n                info.Contact = (InfoContact)contactAttr;\n            }\n\n            var licenseAttr = typeInfo.GetCustomAttribute<SwaggerWcfLicenseInfoAttribute>();\n            if (licenseAttr != null)\n            {\n                info.License = (InfoLicense)licenseAttr;\n            }\n\n            return info;\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Support/TypeFieldsProcessor.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.ComponentModel.DataAnnotations;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing SwaggerWcf.Attributes;\nusing SwaggerWcf.Models;\n\nnamespace SwaggerWcf.Support\n{\n    internal static class TypeFieldsProcessor\n    {\n\n        public static void ProcessFields(Type definitionType, DefinitionSchema schema, IList<string> hiddenTags,\n                                              Stack<Type> typesStack)\n        {\n            var properties = definitionType.GetFields();\n\n            foreach (var fieldInfo in properties)\n            {\n                DefinitionProperty prop = ProcessField(fieldInfo, hiddenTags, typesStack);\n\n                if (prop == null)\n                    continue;\n\n                if (prop.TypeFormat.Type == ParameterType.Array)\n                {\n                    Type propType = fieldInfo.FieldType;\n\n                    Type t = propType.GetElementType() ?? DefinitionsBuilder.GetEnumerableType(propType);\n\n                    if (t != null)\n                    {\n                        //prop.TypeFormat = new TypeFormat(prop.TypeFormat.Type, HttpUtility.HtmlEncode(t.FullName));\n                        prop.TypeFormat = new TypeFormat(prop.TypeFormat.Type, null);\n\n                        TypeFormat st = Helpers.MapSwaggerType(t);\n                        if (st.Type == ParameterType.Array || st.Type == ParameterType.Object)\n                        {\n                            prop.Items.TypeFormat = new TypeFormat(ParameterType.Unknown, null);\n                            prop.Items.Ref = t.GetModelName();\n                        }\n                        else\n                        {\n                            prop.Items.TypeFormat = st;\n                        }\n                    }\n                }\n\n                if (prop.Required)\n                {\n                    if (schema.Required == null)\n                        schema.Required = new List<string>();\n\n                    schema.Required.Add(prop.Title);\n                }\n                schema.Properties.Add(prop);\n            }\n        }\n\n        private static DefinitionProperty ProcessField(FieldInfo propertyInfo, IList<string> hiddenTags,\n                                                          Stack<Type> typesStack)\n        {\n            if (propertyInfo.GetCustomAttribute<SwaggerWcfHiddenAttribute>() != null\n                || propertyInfo.GetCustomAttributes<SwaggerWcfTagAttribute>()\n                               .Select(t => t.TagName)\n                               .Any(hiddenTags.Contains))\n                return null;\n\n            TypeFormat typeFormat = Helpers.MapSwaggerType(propertyInfo.FieldType, null);\n\n            DefinitionProperty prop = new DefinitionProperty { Title = propertyInfo.Name };\n\n            DataMemberAttribute dataMemberAttribute = propertyInfo.GetCustomAttribute<DataMemberAttribute>();\n            if (dataMemberAttribute != null)\n            {\n                if (!string.IsNullOrEmpty(dataMemberAttribute.Name))\n                    prop.Title = dataMemberAttribute.Name;\n\n                prop.Required = dataMemberAttribute.IsRequired;\n            }\n\n            // Special case - if it came out required, but we unwrapped a null-able type,\n            // then it's necessarily not required.  Ideally this would only set the default,\n            // but we can't tell the difference between an explicit declaration of\n            // IsRequired =false on the DataMember attribute and no declaration at all.\n            if (prop.Required && propertyInfo.FieldType.IsGenericType &&\n                propertyInfo.FieldType.GetGenericTypeDefinition() == typeof(Nullable<>))\n            {\n                prop.Required = false;\n            }\n\n            DescriptionAttribute descriptionAttribute = propertyInfo.GetCustomAttribute<DescriptionAttribute>();\n            if (descriptionAttribute != null)\n                prop.Description = descriptionAttribute.Description;\n\n            SwaggerWcfRegexAttribute regexAttr = propertyInfo.GetCustomAttribute<SwaggerWcfRegexAttribute>();\n            if (regexAttr != null)\n                prop.Pattern = regexAttr.Regex;\n\n            prop.TypeFormat = typeFormat;\n\n            if (prop.TypeFormat.Type == ParameterType.Object)\n            {\n                typesStack.Push(propertyInfo.FieldType);\n\n                prop.Ref = propertyInfo.FieldType.GetModelName();\n\n                return prop;\n            }\n\n            if (prop.TypeFormat.Type == ParameterType.Array)\n            {\n                Type subType = DefinitionsBuilder.GetEnumerableType(propertyInfo.FieldType);\n                if (subType != null)\n                {\n                    TypeFormat subTypeFormat = Helpers.MapSwaggerType(subType, null);\n\n                    if (subTypeFormat.Type == ParameterType.Object)\n                        typesStack.Push(subType);\n\n                    prop.Items = new ParameterItems\n                    {\n                        TypeFormat = subTypeFormat\n                    };\n                }\n            }\n\n            if ((prop.TypeFormat.Type == ParameterType.Integer && prop.TypeFormat.Format == \"enum\") || (prop.TypeFormat.Type == ParameterType.Array && prop.Items.TypeFormat.Format == \"enum\"))\n            {\n                prop.Enum = new List<int>();\n\n                Type propType = propertyInfo.FieldType;\n\n                if (propType.IsGenericType && (propType.GetGenericTypeDefinition() == typeof(Nullable<>) || propType.GetGenericTypeDefinition() == typeof(List<>)))\n                    propType = propType.GetEnumerableType();\n\n                string enumDescription = \"\";\n                List<string> listOfEnumNames = propType.GetEnumNames().ToList();\n                foreach (string enumName in listOfEnumNames)\n                {\n                    var enumMemberItem = Enum.Parse(propType, enumName, true);\n                    string enumMemberDescription = DefinitionsBuilder.GetEnumDescription((Enum)enumMemberItem);\n                    enumMemberDescription = (string.IsNullOrWhiteSpace(enumMemberDescription)) ? \"\" : $\"({enumMemberDescription})\";\n                    int enumMemberValue = DefinitionsBuilder.GetEnumMemberValue(propType, enumName);\n                    if (prop.Description != null) prop.Enum.Add(enumMemberValue);\n                    enumDescription += $\"    {enumName}{System.Web.HttpUtility.HtmlEncode(\" = \")}{enumMemberValue} {enumMemberDescription}\\r\\n\";\n                }\n\n                if (enumDescription != \"\")\n                {\n                    prop.Description += $\"\\r\\n\\r\\n{enumDescription}\";\n                }\n            }\n\n            // Apply any options set in a [SwaggerWcfProperty]\n            DefinitionsBuilder.ApplyAttributeOptions(propertyInfo, prop);\n\n            return prop;\n        }\n\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/Support/TypePropertiesProcessor.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.ComponentModel.DataAnnotations;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.Serialization;\nusing SwaggerWcf.Attributes;\nusing SwaggerWcf.Models;\n\nnamespace SwaggerWcf.Support\n{\n    internal static class TypePropertiesProcessor\n    {\n\n        public static void ProcessProperties(Type definitionType, DefinitionSchema schema, IList<string> hiddenTags,\n                                              Stack<Type> typesStack)\n        {\n            PropertyInfo[] properties = definitionType.GetProperties();\n\n            foreach (PropertyInfo propertyInfo in properties)\n            {\n                DefinitionProperty prop = ProcessProperty(propertyInfo, hiddenTags, typesStack);\n\n                if (prop == null)\n                    continue;\n\n                if (prop.TypeFormat.Type == ParameterType.Array)\n                {\n                    Type propType = propertyInfo.PropertyType;\n\n                    Type t = propType.GetElementType() ?? DefinitionsBuilder.GetEnumerableType(propType);\n\n                    if (t != null)\n                    {\n                        //prop.TypeFormat = new TypeFormat(prop.TypeFormat.Type, HttpUtility.HtmlEncode(t.FullName));\n                        prop.TypeFormat = new TypeFormat(prop.TypeFormat.Type, null);\n\n                        TypeFormat st = Helpers.MapSwaggerType(t);\n                        if (st.Type == ParameterType.Array || st.Type == ParameterType.Object)\n                        {\n                            prop.Items.TypeFormat = new TypeFormat(ParameterType.Unknown, null);\n                            prop.Items.Ref = t.GetModelName();\n                        }\n                        else\n                        {\n                            prop.Items.TypeFormat = st;\n                        }\n                    }\n                }\n\n                if (prop.Required)\n                {\n                    if (schema.Required == null)\n                        schema.Required = new List<string>();\n\n                    schema.Required.Add(prop.Title);\n                }\n                schema.Properties.Add(prop);\n            }\n        }\n\n        private static DefinitionProperty ProcessProperty(PropertyInfo propertyInfo, IList<string> hiddenTags,\n                                                          Stack<Type> typesStack)\n        {\n            if (propertyInfo.GetCustomAttribute<SwaggerWcfHiddenAttribute>() != null\n                || propertyInfo.GetCustomAttributes<SwaggerWcfTagAttribute>()\n                               .Select(t => t.TagName)\n                               .Any(hiddenTags.Contains))\n                return null;\n\n            TypeFormat typeFormat = Helpers.MapSwaggerType(propertyInfo.PropertyType, null);\n\n            DefinitionProperty prop = new DefinitionProperty { Title = propertyInfo.Name };\n\n            DataMemberAttribute dataMemberAttribute = propertyInfo.GetCustomAttribute<DataMemberAttribute>();\n            if (dataMemberAttribute != null)\n            {\n                if (!string.IsNullOrEmpty(dataMemberAttribute.Name))\n                    prop.Title = dataMemberAttribute.Name;\n\n                prop.Required = dataMemberAttribute.IsRequired;\n            }\n\n            // Special case - if it came out required, but we unwrapped a null-able type,\n            // then it's necessarily not required.  Ideally this would only set the default,\n            // but we can't tell the difference between an explicit declaration of\n            // IsRequired =false on the DataMember attribute and no declaration at all.\n            if (prop.Required && propertyInfo.PropertyType.IsGenericType &&\n                propertyInfo.PropertyType.GetGenericTypeDefinition() == typeof(Nullable<>))\n            {\n                prop.Required = false;\n            }\n\n            DescriptionAttribute descriptionAttribute = propertyInfo.GetCustomAttribute<DescriptionAttribute>();\n            if (descriptionAttribute != null)\n                prop.Description = descriptionAttribute.Description;\n\n            SwaggerWcfRegexAttribute regexAttr = propertyInfo.GetCustomAttribute<SwaggerWcfRegexAttribute>();\n            if (regexAttr != null)\n                prop.Pattern = regexAttr.Regex;\n\n            prop.TypeFormat = typeFormat;\n\n            if (prop.TypeFormat.Type == ParameterType.Object)\n            {\n                typesStack.Push(propertyInfo.PropertyType);\n\n                prop.Ref = propertyInfo.PropertyType.GetModelName();\n\n                return prop;\n            }\n\n            if (prop.TypeFormat.Type == ParameterType.Array)\n            {\n                Type subType = DefinitionsBuilder.GetEnumerableType(propertyInfo.PropertyType);\n                if (subType != null)\n                {\n                    TypeFormat subTypeFormat = Helpers.MapSwaggerType(subType, null);\n\n                    if (subTypeFormat.Type == ParameterType.Object)\n                        typesStack.Push(subType);\n\n                    prop.Items = new ParameterItems\n                    {\n                        TypeFormat = subTypeFormat\n                    };\n                }\n            }\n\n            if ((prop.TypeFormat.Type == ParameterType.Integer && prop.TypeFormat.Format == \"enum\") || (prop.TypeFormat.Type == ParameterType.Array && prop.Items.TypeFormat.Format == \"enum\"))\n            {\n                prop.Enum = new List<int>();\n\n                Type propType = propertyInfo.PropertyType;\n\n                if (propType.IsGenericType && (propType.GetGenericTypeDefinition() == typeof(Nullable<>) || propType.GetGenericTypeDefinition() == typeof(List<>)))\n                    propType = propType.GetEnumerableType();\n\n                string enumDescription = \"\";\n                List<string> listOfEnumNames = propType.GetEnumNames().ToList();\n                foreach (string enumName in listOfEnumNames)\n                {\n                    var enumMemberItem = Enum.Parse(propType, enumName, true);\n                    string enumMemberDescription = DefinitionsBuilder.GetEnumDescription((Enum)enumMemberItem);\n                    enumMemberDescription = (string.IsNullOrWhiteSpace(enumMemberDescription)) ? \"\" : $\"({enumMemberDescription})\";\n                    int enumMemberValue = DefinitionsBuilder.GetEnumMemberValue(propType, enumName);\n                    if (prop.Description != null) prop.Enum.Add(enumMemberValue);\n                    enumDescription += $\"    {enumName}{System.Web.HttpUtility.HtmlEncode(\" = \")}{enumMemberValue} {enumMemberDescription}\\r\\n\";\n                }\n\n                if (enumDescription != \"\")\n                {\n                    prop.Description += $\"\\r\\n\\r\\n{enumDescription}\";\n                }\n            }\n\n            // Apply any options set in a [SwaggerWcfProperty]\n            DefinitionsBuilder.ApplyAttributeOptions(propertyInfo, prop);\n\n            return prop;\n        }\n\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/SwaggerWcf.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\r\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\r\n  <PropertyGroup>\r\n    <Configuration Condition=\" '$(Configuration)' == '' \">Release</Configuration>\r\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\r\n    <ProjectGuid>{0AD6EFBC-412F-4C0E-8E0A-0FAF28151B55}</ProjectGuid>\r\n    <OutputType>Library</OutputType>\r\n    <AppDesignerFolder>Properties</AppDesignerFolder>\r\n    <RootNamespace>SwaggerWcf</RootNamespace>\r\n    <AssemblyName>SwaggerWcf</AssemblyName>\r\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\r\n    <FileAlignment>512</FileAlignment>\r\n    <SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\</SolutionDir>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\r\n    <DebugSymbols>true</DebugSymbols>\r\n    <DebugType>full</DebugType>\r\n    <Optimize>false</Optimize>\r\n    <OutputPath>bin\\Debug\\</OutputPath>\r\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\r\n    <DebugType>pdbonly</DebugType>\r\n    <Optimize>true</Optimize>\r\n    <OutputPath>bin\\Release\\</OutputPath>\r\n    <DefineConstants>TRACE</DefineConstants>\r\n    <ErrorReport>prompt</ErrorReport>\r\n    <WarningLevel>4</WarningLevel>\r\n  </PropertyGroup>\r\n  <ItemGroup>\r\n    <Reference Include=\"Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL\">\r\n      <HintPath>..\\packages\\Newtonsoft.Json.8.0.3\\lib\\net45\\Newtonsoft.Json.dll</HintPath>\r\n      <Private>True</Private>\r\n    </Reference>\r\n    <Reference Include=\"System\" />\r\n    <Reference Include=\"System.Configuration\" />\r\n    <Reference Include=\"System.Core\" />\r\n    <Reference Include=\"System.IO.Compression\" />\r\n    <Reference Include=\"System.Runtime.Serialization\" />\r\n    <Reference Include=\"System.ServiceModel\" />\r\n    <Reference Include=\"System.ServiceModel.Activation\" />\r\n    <Reference Include=\"System.ServiceModel.Routing\" />\r\n    <Reference Include=\"System.ServiceModel.Web\" />\r\n    <Reference Include=\"System.Web\" />\r\n    <Reference Include=\"System.Web.ApplicationServices\" />\r\n    <Reference Include=\"System.Web.Extensions\" />\r\n    <Reference Include=\"System.Web.Routing\" />\r\n    <Reference Include=\"System.Web.Services\" />\r\n    <Reference Include=\"System.Xml.Linq\" />\r\n    <Reference Include=\"System.Data.DataSetExtensions\" />\r\n    <Reference Include=\"Microsoft.CSharp\" />\r\n    <Reference Include=\"System.Data\" />\r\n    <Reference Include=\"System.Xml\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <Compile Include=\"Attributes\\SwaggerWcfContactInfoAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfRegexAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfLicenseInfoAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfServiceInfoAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfRequestTypeAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfSecurityAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfContentTypesAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfDefinitionAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfHeaderAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfPropertyAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfReturnTypeAttribute.cs\" />\r\n    <Compile Include=\"Support\\EnumerableExtensions.cs\" />\r\n    <Compile Include=\"Support\\MethodInfoExtensions.cs\" />\r\n    <Compile Include=\"Models\\SecurityAuthorization.cs\" />\r\n    <Compile Include=\"Models\\DefinitionSchema.cs\" />\r\n    <Compile Include=\"Models\\DefinitionProperty.cs\" />\r\n    <Compile Include=\"Models\\InType.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfHiddenAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfPathAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfParameterAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfResponseAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfAttribute.cs\" />\r\n    <Compile Include=\"Attributes\\SwaggerWcfTagAttribute.cs\" />\r\n    <Compile Include=\"Configuration\\SettingCollection.cs\" />\r\n    <Compile Include=\"Configuration\\SettingElement.cs\" />\r\n    <Compile Include=\"Configuration\\SwaggerWcfSection.cs\" />\r\n    <Compile Include=\"Configuration\\TagCollection.cs\" />\r\n    <Compile Include=\"Configuration\\TagElement.cs\" />\r\n    <Compile Include=\"Models\\CollectionFormat.cs\" />\r\n    <Compile Include=\"Models\\Definition.cs\" />\r\n    <Compile Include=\"Models\\Example.cs\" />\r\n    <Compile Include=\"Models\\ExternalDocumentation.cs\" />\r\n    <Compile Include=\"Models\\InfoLicense.cs\" />\r\n    <Compile Include=\"Models\\InfoContact.cs\" />\r\n    <Compile Include=\"Models\\Info.cs\" />\r\n    <Compile Include=\"Models\\SecurityDefinitions.cs\" />\r\n    <Compile Include=\"Support\\ListExtensions.cs\" />\r\n    <Compile Include=\"Support\\TypeBuilder.cs\" />\r\n    <Compile Include=\"Support\\TypeFieldsProcessor.cs\" />\r\n    <Compile Include=\"Support\\TypePropertiesProcessor.cs\" />\r\n    <Compile Include=\"SwaggerWcfEndpoint.cs\" />\r\n    <Compile Include=\"ISwaggerWcfEndpoint.cs\" />\r\n    <Compile Include=\"Models\\PathAction.cs\" />\r\n    <Compile Include=\"Support\\Mapper.cs\" />\r\n    <Compile Include=\"Models\\ParameterSchema.cs\" />\r\n    <Compile Include=\"Models\\ParameterPrimitive.cs\" />\r\n    <Compile Include=\"Models\\ParameterItems.cs\" />\r\n    <Compile Include=\"Models\\ParameterType.cs\" />\r\n    <Compile Include=\"Models\\Path.cs\" />\r\n    <Compile Include=\"Models\\ParameterBase.cs\" />\r\n    <Compile Include=\"Models\\Property.cs\" />\r\n    <Compile Include=\"Models\\Response.cs\" />\r\n    <Compile Include=\"Models\\Schema.cs\" />\r\n    <Compile Include=\"Models\\Service.cs\" />\r\n    <Compile Include=\"Models\\TypeFormat.cs\" />\r\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\r\n    <Compile Include=\"Support\\Helpers.cs\" />\r\n    <Compile Include=\"Support\\Serializer.cs\" />\r\n    <Compile Include=\"Support\\DefinitionsBuilder.cs\" />\r\n    <Compile Include=\"Support\\ServiceBuilder.cs\" />\r\n    <Compile Include=\"Support\\StaticContent.cs\" />\r\n    <Compile Include=\"Support\\TypeExtensions.cs\" />\r\n    <Compile Include=\"SwaggerWcfEndpointGeneric.cs\" />\r\n  </ItemGroup>\r\n  <ItemGroup>\r\n    <EmbeddedResource Include=\"www\\swagger-ui.zip\" />\r\n    <None Include=\"packages.config\" />\r\n    <None Include=\"SwaggerWcf.nuspec\" />\r\n  </ItemGroup>\r\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\r\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r\n       Other similar extension points exist, see Microsoft.Common.targets.\r\n  <Target Name=\"BeforeBuild\">\r\n  </Target>\r\n  <Target Name=\"AfterBuild\">\r\n  </Target>\r\n  -->\r\n</Project>"
  },
  {
    "path": "src/SwaggerWcf/SwaggerWcf.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:String x:Key=\"/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue\">CSharp70</s:String></wpf:ResourceDictionary>"
  },
  {
    "path": "src/SwaggerWcf/SwaggerWcf.nuspec",
    "content": "﻿<?xml version=\"1.0\"?>\n<package>\n  <metadata>\n    <id>$title$</id>\n    <version>$version$</version>\n    <title>$title$</title>\n    <authors>$author$</authors>\n    <owners>$author$</owners>\n    <licenseUrl>https://raw.githubusercontent.com/abelsilva/swaggerwcf/master/LICENSE</licenseUrl>\n    <projectUrl>https://github.com/abelsilva/swaggerwcf</projectUrl>\n    <requireLicenseAcceptance>false</requireLicenseAcceptance>\n    <description>$description$</description>\n    <releaseNotes>#160</releaseNotes>\n    <copyright>Copyright 2018</copyright>\n    <tags>swagger wcf .net c#</tags>\n  </metadata>\n</package>"
  },
  {
    "path": "src/SwaggerWcf/SwaggerWcfEndpoint.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.ServiceModel;\nusing System.ServiceModel.Activation;\nusing System.ServiceModel.Web;\nusing System.Text;\nusing SwaggerWcf.Models;\nusing SwaggerWcf.Support;\nusing System.Runtime.CompilerServices;\n\nnamespace SwaggerWcf\n{\n    public delegate Stream GetFileCustomDelegate(string filename, out string contentType, out long contentLength);\n\n    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]\n    public class SwaggerWcfEndpoint : ISwaggerWcfEndpoint\n    {\n        public SwaggerWcfEndpoint()\n        {\n            Init(ServiceBuilder.Build);\n        }\n\n        internal SwaggerWcfEndpoint(Func<string, Service> buildService)\n        {\n            Init(buildService);\n        }\n\n        internal static Info Info { get; private set; }\n\n        internal static SecurityDefinitions SecurityDefinitions { get; private set; }\n\n        internal static string BasePath { get; private set; }\n\n        private static Dictionary<string, string> SwaggerFiles { get; } = new Dictionary<string, string>();\n\n        public static bool DisableSwaggerUI { get; set; }\n\n        public static Func<string, List<string>, List<string>> FilterVisibleTags { get; set; } =\n            (string path, List<string> visibleTags) => visibleTags;\n\n        public static Func<string, List<string>, List<string>> FilterHiddenTags { get; set; } =\n            (string path, List<string> hiddenTags) => hiddenTags;\n\n        public static void Configure(Info info, SecurityDefinitions securityDefinitions = null, string basePath = null)\n        {\n            Info = info;\n            SecurityDefinitions = securityDefinitions;\n            BasePath = basePath;\n        }\n\n        [MethodImpl(MethodImplOptions.Synchronized)]\n        internal static void Init(Func<string, Service> buildService)\n        {\n            string[] paths = GetAllPaths().Where(p => !SwaggerFiles.Keys.Contains(p)).ToArray();\n\n            foreach (string path in paths)\n            {\n                Service service = buildService(path);\n                if (Info != null)\n                    service.Info = Info;\n                if (SecurityDefinitions != null)\n                    service.SecurityDefinitions = SecurityDefinitions;\n                if (BasePath != null)\n                    service.BasePath = BasePath;\n\n                string swagger = Serializer.Process(service);\n                if (SwaggerFiles.ContainsKey(path) == false)\n                    SwaggerFiles.Add(path, swagger);\n            }\n        }\n\n        private static string[] GetAllPaths()\n        {\n            return OperationContext.Current?.Host?.BaseAddresses.Select(ba => ba.AbsolutePath).ToArray()\n                   ?? new[] { \"\" };\n        }\n\n        private static string GetSwaggerFileContents()\n        {\n            string fullPath = WebOperationContext.Current?.IncomingRequest.UriTemplateMatch?.RequestUri?.AbsolutePath ?? \"\";\n            string key = SwaggerFiles.Keys.ToList().ClosestMatch(fullPath);\n\n            return key != null ? SwaggerFiles[key] : \"\";\n        }\n\n        public static void SetCustomZip(Stream customSwaggerUiZipStream)\n        {\n            if (customSwaggerUiZipStream != null)\n                Support.StaticContent.SetArchiveCustom(customSwaggerUiZipStream);\n        }\n\n        public static void SetCustomGetFile(GetFileCustomDelegate getFileCustom)\n        {\n            Support.StaticContent.GetFileCustom = getFileCustom;\n        }\n\n        public Stream GetSwaggerFile()\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n            if (woc != null)\n            {\n                //TODO: create a parameter in settings to configure this\n                woc.OutgoingResponse.Headers.Add(\"Access-Control-Allow-Origin\", \"*\");\n                woc.OutgoingResponse.ContentType = \"application/json\";\n            }\n\n            return new MemoryStream(Encoding.UTF8.GetBytes(GetSwaggerFileContents()));\n        }\n\n        public Stream StaticContent(string content)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return Stream.Null;\n\n            if (DisableSwaggerUI)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n                return null;\n            }\n\n            if (string.IsNullOrWhiteSpace(content))\n            {\n                string swaggerUrl = woc.IncomingRequest.UriTemplateMatch.BaseUri.LocalPath + \"/swagger.json\";\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.Redirect;\n                woc.OutgoingResponse.Location = \"index.html?url=\" + swaggerUrl;\n                return null;\n            }\n\n            string filename = content.Contains(\"?\")\n                ? content.Substring(0, content.IndexOf(\"?\", StringComparison.Ordinal))\n                : content;\n\n            string contentType;\n            long contentLength;\n            Stream stream = Support.StaticContent.GetFile(filename, out contentType, out contentLength);\n\n            if (stream == Stream.Null)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n                return null;\n            }\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.OK;\n            woc.OutgoingResponse.ContentLength = contentLength;\n            woc.OutgoingResponse.ContentType = contentType;\n\n            return stream;\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf/SwaggerWcfEndpointGeneric.cs",
    "content": "﻿using System.ServiceModel.Activation;\r\nusing SwaggerWcf.Support;\r\n\r\nnamespace SwaggerWcf\r\n{\r\n    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]\r\n    public class SwaggerWcfEndpoint<TBusiness> : SwaggerWcfEndpoint\r\n    {\r\n        public SwaggerWcfEndpoint() : base(ServiceBuilder.Build<TBusiness>)\r\n        {\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "src/SwaggerWcf/packages.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n  <package id=\"Newtonsoft.Json\" version=\"8.0.3\" targetFramework=\"net45\" />\n</packages>"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/AuthorService.cs",
    "content": "﻿using SwaggerWcf.Attributes;\nusing SwaggerWcf.Test.Service.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\n\nnamespace SwaggerWcf.Test.Service\n{\n    [SwaggerWcf(\"/v1/authors\")]\n    [SwaggerWcfTag(\"Authors\")]\n    [SwaggerWcfServiceInfo(\n        title: \"SampleAuthorService\",\n        version: \"0.0.1\",\n        Description = \"Sample Author Service to test SwaggerWCF\",\n        TermsOfService = \"Terms of Service\"\n    )]\n    [SwaggerWcfContactInfo(\n        Name = \"Abel Silva\",\n        Url = \"http://github.com/abelsilva\",\n        Email = \"no@e.mail\"\n    )]\n    [SwaggerWcfLicenseInfo(\n        name: \"Apache License 2.0\",\n        Url = \"https://github.com/abelsilva/SwaggerWCF/blob/master/LICENSE\"\n    )]\n    public class AuthorService : BaseService<Author>, IAuthorService\n    {\n        [SwaggerWcfTag(\"GenericAuthor\")]\n        public override Author Get(string id)\n        {\n            return new Author { Id = id };\n        }\n\n        [SwaggerWcfTag(\"GenericAuthor\")]\n        public override Author Create(Author item)\n        {\n            return item;\n        }\n\n        [SwaggerWcfTag(\"GenericAuthor\")]\n        public override Author Update(string id, Author item)\n        {\n            return new Author { Id = id };\n        }\n\n        [SwaggerWcfTag(\"GenericAuthor\")]\n        public override Author Delete(string id)\n        {\n            return new Author { Id = id };\n        }\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/BaseService.cs",
    "content": "﻿using SwaggerWcf.Test.Service.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\n\nnamespace SwaggerWcf.Test.Service\n{\n    public abstract class BaseService<T> : IBaseService, IBaseCRUDService<T>\n    {\n        public abstract T Create(T item);\n        public abstract T Delete(string id);\n        public abstract T Get(string id);\n        public abstract T Update(string id, T item);\n\n        public virtual string TestService(string input)\n        {\n            return $\"input = {input}. Now = {DateTime.Now}\";\n        }\n\n        public string TestServicePost(string input, string postObj)\n        {\n            return $\"input = {input}. Now = {DateTime.Now}\";\n        }\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Data/Author.cs",
    "content": "﻿using System.Runtime.Serialization;\nusing SwaggerWcf.Attributes;\n\nnamespace SwaggerWcf.Test.Service.Data\n{\n    [DataContract]\n    [SwaggerWcfDefinition(\"author\")]\n    public class Author\n    {\n        [DataMember]\n        public string Id { get; set; }\n\n        [DataMember]\n        public string Name { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Data/Book.cs",
    "content": "﻿using System.ComponentModel;\nusing System.Runtime.Serialization;\nusing SwaggerWcf.Attributes;\n\nnamespace SwaggerWcf.Test.Service.Data\n{\n    [DataContract]\n    [Description(\"Book with title, first publish date, author and language\")]\n    [SwaggerWcfDefinition(ExternalDocsUrl = \"http://en.wikipedia.org/wiki/Book\", ExternalDocsDescription = \"Description of a book\")]\n    public class Book\n    {\n        [DataMember]\n        [Description(\"Book ID\")]\n        [SwaggerWcfRegex(\"[\\\\w\\\\d]*\")]\n        public string Id { get; set; }\n\n        [DataMember]\n        [Description(\"Book Title\")]\n        public string Title { get; set; }\n\n        [DataMember]\n        [Description(\"Book First Publish Date\")]\n        public int FirstPublished { get; set; }\n\n        [DataMember]\n        [Description(\"Book Author\")]\n        public Author Author { get; set; }\n\n        [DataMember]\n        [Description(\"Book Language\")]\n        public Language Language { get; set; }\n\n        [DataMember]\n        [Description(\"Book Tags\")]\n        public string[] Tags { get; set; }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Data/Language.cs",
    "content": "﻿using System.ComponentModel;\nusing System.Runtime.Serialization;\n\nnamespace SwaggerWcf.Test.Service.Data\n{\n    [DataContract(Name = \"language\")]\n    public enum Language\n    {\n        [Description(\"Undefined language\")]\n        Unknown = 0,\n        English = 1,\n        Spanish = 2,\n        French = 3,\n        Chinese = 4,\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Data/Store.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\n\nnamespace SwaggerWcf.Test.Service.Data\n{\n    public class Store\n    {\n        static Store()\n        {\n            Books = new List<Book>();\n            Authors = new List<Author>();\n            \n            var authorMiguelCervantes = new Author\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Name = \"Miguel de Cervantes\"\n            };\n            var authorCharlesDickens = new Author\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Name = \"Charles Dickens\"\n            };\n            var authorJRRTolkien = new Author\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Name = \"J. R. R. Tolkien\"\n            };\n            var authorAntoineSaintExupery = new Author\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Name = \"Antoine de Saint-Exupéry\"\n            };\n            var authorJKRowling = new Author\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Name = \"J. K. Rowling\"\n            };\n            var authorAgathaChristie = new Author\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Name = \"Agatha Christie\"\n            };\n            var authorCaoXueqin = new Author\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Name = \"Cao Xueqin\"\n            };\n            var authorHRiderHaggard = new Author\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Name = \"H. Rider Haggard\"\n            };\n            Authors.Add(authorMiguelCervantes);\n            Authors.Add(authorCharlesDickens);\n            Authors.Add(authorJRRTolkien);\n            Authors.Add(authorAntoineSaintExupery);\n            Authors.Add(authorJKRowling);\n            Authors.Add(authorAgathaChristie);\n            Authors.Add(authorCaoXueqin);\n            Authors.Add(authorHRiderHaggard);\n\n            var bookDonQuixote = new Book\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Title = \"Don Quixote\",\n                Author = authorMiguelCervantes,\n                FirstPublished = 1605,\n                Language = Language.Spanish\n            };\n            var bookATaleOfTwoCities = new Book\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Title = \"A Tale Of Two Cities\",\n                Author = authorCharlesDickens,\n                FirstPublished = 1859,\n                Language = Language.English\n            };\n            var bookTheLordOfTheRings = new Book\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Title = \"The Lord of the Rings\",\n                Author = authorJRRTolkien,\n                FirstPublished = 1954,\n                Language = Language.English\n            };\n            var bookTheHobbit = new Book\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Title = \"The Hobbit\",\n                Author = authorJRRTolkien,\n                FirstPublished = 1937,\n                Language = Language.English\n            };\n            var bookLePetitPrince = new Book\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Title = \"Le Petit Prince\",\n                Author = authorAntoineSaintExupery,\n                FirstPublished = 1943,\n                Language = Language.French\n            };\n            var bookHarryPotterAndThePhilosopherStone = new Book\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Title = \"Harry Potter and the Philosopher's Stone\",\n                Author = authorJKRowling,\n                FirstPublished = 1997,\n                Language = Language.English\n            };\n            var bookAndThenThereWereNone = new Book\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Title = \"And Then There Were None\",\n                Author = authorAgathaChristie,\n                FirstPublished = 1939,\n                Language = Language.English\n            };\n            var bookDreamOfTheRedChamber = new Book\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Title = \"紅樓夢/红楼梦 (Dream of the Red Chamber)\",\n                Author = authorCaoXueqin,\n                FirstPublished = 1754,\n                Language = Language.Chinese\n            };\n            var bookSheAHistoryOfAdventure = new Book\n            {\n                Id = Guid.NewGuid().ToString(\"N\"),\n                Title = \"She: A History of Adventure\",\n                Author = authorHRiderHaggard,\n                FirstPublished = 1887,\n                Language = Language.English\n            };\n            Books.Add(bookDonQuixote);\n            Books.Add(bookATaleOfTwoCities);\n            Books.Add(bookTheLordOfTheRings);\n            Books.Add(bookTheHobbit);\n            Books.Add(bookLePetitPrince);\n            Books.Add(bookHarryPotterAndThePhilosopherStone);\n            Books.Add(bookAndThenThereWereNone);\n            Books.Add(bookDreamOfTheRedChamber);\n            Books.Add(bookSheAHistoryOfAdventure);\n        }\n\n        public static readonly List<Book> Books;\n        public static readonly List<Author> Authors;\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Global.asax",
    "content": "﻿<%@ Application Codebehind=\"Global.asax.cs\" Inherits=\"SwaggerWcf.Test.Service.Global\" Language=\"C#\" %>\n"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Global.asax.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.ServiceModel.Activation;\nusing System.Web;\nusing System.Web.Routing;\nusing SwaggerWcf.Models;\n\nnamespace SwaggerWcf.Test.Service\n{\n    public class Global : HttpApplication\n    {\n        protected void Application_Start(object sender, EventArgs e)\n        {\n            SwaggerWcfEndpoint.FilterVisibleTags = FilterVisibleTags;\n            SwaggerWcfEndpoint.FilterHiddenTags = FilterHiddenTags;\n            SwaggerWcfEndpoint.DisableSwaggerUI = false;\n\n            // route with a simple class\n            RouteTable.Routes.Add(new ServiceRoute(\"v1/rest\", new WebServiceHostFactory(), typeof(BookStore)));\n\n            // route with inherited methods on a base class\n            RouteTable.Routes.Add(new ServiceRoute(\"v1/authors\", new WebServiceHostFactory(), typeof(AuthorService)));\n            \n            RouteTable.Routes.Add(new ServiceRoute(\"api-docs\", new WebServiceHostFactory(), typeof(SwaggerWcfEndpoint)));\n        }\n\n        private static List<string> FilterVisibleTags(string path, List<string> visibleTags)\n        {\n            return visibleTags;\n        }\n\n        private static List<string> FilterHiddenTags(string path, List<string> hiddenTags)\n        {\n            return hiddenTags;\n        }\n\n        protected void Session_Start(object sender, EventArgs e)\n        {\n        }\n\n        protected void Application_BeginRequest(object sender, EventArgs e)\n        {\n        }\n\n        protected void Application_AuthenticateRequest(object sender, EventArgs e)\n        {\n        }\n\n        protected void Application_Error(object sender, EventArgs e)\n        {\n        }\n\n        protected void Session_End(object sender, EventArgs e)\n        {\n        }\n\n        protected void Application_End(object sender, EventArgs e)\n        {\n        }\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/IAuthorService.cs",
    "content": "﻿using SwaggerWcf.Test.Service.Data;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.ServiceModel;\nusing System.Web;\n\nnamespace SwaggerWcf.Test.Service\n{\n    [ServiceContract]\n    public interface IAuthorService : IBaseService, IBaseCRUDService<Author>\n    {\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/IBaseCRUDService.cs",
    "content": "﻿using SwaggerWcf.Attributes;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.ServiceModel;\nusing System.ServiceModel.Web;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace SwaggerWcf.Test.Service\n{\n    [ServiceContract]\n    public interface IBaseCRUDService<T>\n    {\n        [SwaggerWcfPath(\"Get Operation\")]\n        [OperationContract]\n        [WebInvoke(Method = \"GET\",\n            ResponseFormat = WebMessageFormat.Json,\n            BodyStyle = WebMessageBodyStyle.Bare,\n            UriTemplate = \"get/{id}\")]\n        T Get(string id);\n\n        [SwaggerWcfPath(\"Create Operation\")]\n        [OperationContract]\n        [WebInvoke(Method = \"PUT\",\n            ResponseFormat = WebMessageFormat.Json,\n            BodyStyle = WebMessageBodyStyle.Bare,\n            UriTemplate = \"\")]\n        T Create(T item);\n\n        [SwaggerWcfPath(\"Update Operation\")]\n        [OperationContract]\n        [WebInvoke(Method = \"POST\",\n            ResponseFormat = WebMessageFormat.Json,\n            BodyStyle = WebMessageBodyStyle.Bare,\n            UriTemplate = \"{id}\")]\n        T Update(string id, T item);\n\n        [SwaggerWcfPath(\"Delete Operation\")]\n        [OperationContract]\n        [WebInvoke(Method = \"DELETE\",\n            ResponseFormat = WebMessageFormat.Json,\n            BodyStyle = WebMessageBodyStyle.Bare,\n            UriTemplate = \"{id}\")]\n        T Delete(string id);\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/IBaseService.cs",
    "content": "﻿using SwaggerWcf.Attributes;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.ServiceModel;\nusing System.ServiceModel.Web;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace SwaggerWcf.Test.Service\n{\n    [ServiceContract]\n    public interface IBaseService\n    {\n        [SwaggerWcfPath(\"Test Service\")]\n        [OperationContract]\n        [WebInvoke(Method = \"GET\",\n            ResponseFormat = WebMessageFormat.Json,\n            BodyStyle = WebMessageBodyStyle.Bare,\n            UriTemplate = \"testService?input={input}\")]\n        string TestService(string input);\n\n        [SwaggerWcfPath(\"Test Service\")]\n        [OperationContract]\n        [WebInvoke(Method = \"POST\",\n            ResponseFormat = WebMessageFormat.Json,\n            BodyStyle = WebMessageBodyStyle.Bare,\n            UriTemplate = \"testServicePost?input={input}\")]\n        string TestServicePost(string input, string postObj);\n    }\n}\n"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/IStore.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.ServiceModel;\nusing System.ServiceModel.Web;\nusing SwaggerWcf.Attributes;\nusing SwaggerWcf.Test.Service.Data;\n\nnamespace SwaggerWcf.Test.Service\n{\n    [ServiceContract]\n    public interface IStore\n    {\n        #region /books\n        [SwaggerWcfPath(\"Create book\", \"Create a book on the store\")]\n        // default Method for WebInvoke is POST\n        [WebInvoke(UriTemplate = \"/books\", BodyStyle = WebMessageBodyStyle.Wrapped, //Method = \"POST\",\n            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]\n        [OperationContract]\n        Book CreateBook([SwaggerWcfParameter(Description = \"Book to be created, the id will be replaced\")] Book value);\n\n        [SwaggerWcfPath(\"Get books\", \"Retrieve all books from the store\")]\n        [WebGet(UriTemplate = \"/books?filter={filterText}\", BodyStyle = WebMessageBodyStyle.Bare)]\n        [OperationContract]\n        Book[] ReadBooks(string filterText = null);\n\n        [SwaggerWcfPath(\"Get book\", \"Retrieve a book from the store using its id\")]\n        [WebGet(UriTemplate = \"/books/{id}\", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json,\n            ResponseFormat = WebMessageFormat.Json)]\n        [OperationContract]\n        Book ReadBook(string id);\n\n        [SwaggerWcfPath(\"Update book\", \"Update a book on the store\")]\n        [WebInvoke(UriTemplate = \"/books/{id}\", BodyStyle = WebMessageBodyStyle.Bare, Method = \"PUT\",\n            RequestFormat = WebMessageFormat.Json)]\n        [OperationContract]\n        void UpdateBook(string id,\n            [SwaggerWcfParameter(\n                Description =\n                    \"Book to be updated, make sure the id in the book matches the id in the path parameter\")] Book value);\n\n        [SwaggerWcfPath(\"Delete book\", \"Delete a book on the store\")]\n        [WebInvoke(UriTemplate = \"/books/{id}\", BodyStyle = WebMessageBodyStyle.Bare, Method = \"DELETE\")]\n        [OperationContract]\n        void DeleteBook(string id);\n\n        [SwaggerWcfPath(\"Get book author\", \"Retrieve the author of a book using the book id\")]\n        [WebGet(UriTemplate = \"/books/{id}/author\", BodyStyle = WebMessageBodyStyle.Bare,\n            RequestFormat = WebMessageFormat.Json,\n            ResponseFormat = WebMessageFormat.Json)]\n        [OperationContract]\n        Author ReadBookAuthor(string id);\n\n        #endregion\n\n        #region /authors\n\n        [SwaggerWcfPath(\"Create author\", \"Create an author on the store\")]\n        [WebInvoke(UriTemplate = \"/authors\", BodyStyle = WebMessageBodyStyle.Bare, Method = \"POST\",\n            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)]\n        [OperationContract]\n        Author CreateAuthor(\n            [SwaggerWcfParameter(Description = \"Author to be created, the id will be replaced\")] Author value);\n\n        [SwaggerWcfPath(\"Get authors\", \"Retrieve all authors from the store\")]\n        [WebGet(UriTemplate = \"/authors\", BodyStyle = WebMessageBodyStyle.Bare)]\n        [OperationContract]\n        IList<Author> ReadAuthors();\n\n        [SwaggerWcfPath(\"Get author\", \"Retrieve an author from the store using its id\")]\n        [WebGet(UriTemplate = \"/authors/{id}\", BodyStyle = WebMessageBodyStyle.Bare,\n            RequestFormat = WebMessageFormat.Json,\n            ResponseFormat = WebMessageFormat.Xml)]\n        [OperationContract]\n        Author ReadAuthor(string id);\n\n        [SwaggerWcfPath(\"Update author\", \"Update an author on the store\")]\n        [WebInvoke(UriTemplate = \"/authors/{id}\", BodyStyle = WebMessageBodyStyle.Bare, Method = \"PUT\",\n            RequestFormat = WebMessageFormat.Json)]\n        [OperationContract]\n        void UpdateAuthor(string id,\n            [SwaggerWcfParameter(\n                Description =\n                    \"Author to be updated, make sure the id in the author matches the id in the path parameter\"\n            )] Author value);\n\n        [SwaggerWcfPath(\"Delete author\", \"Delete an author on the store\")]\n        [WebInvoke(UriTemplate = \"/authors/{id}\", BodyStyle = WebMessageBodyStyle.Bare, Method = \"DELETE\")]\n        [OperationContract]\n        void DeleteAuthor(string id);\n\n        [SwaggerWcfPath(\"Get author books\", \"Retrieve the author books using the author id\")]\n        [WebGet(UriTemplate = \"/authors/{id}/books\", BodyStyle = WebMessageBodyStyle.Bare,\n            RequestFormat = WebMessageFormat.Json,\n            ResponseFormat = WebMessageFormat.Xml)]\n        [OperationContract]\n        Book[] ReadAuthorBooks(string id);\n\n        #endregion\n\n        #region /languages\n\n        [SwaggerWcfPath(\"Create language\", \"Create an language on the store\")]\n        [WebInvoke(UriTemplate = \"/languages\", BodyStyle = WebMessageBodyStyle.Bare, Method = \"POST\",\n            RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Xml)]\n        [OperationContract]\n        Language CreateLanguage(\n            [SwaggerWcfParameter(Description = \"Language to be created, the id will be replaced\")] Language value);\n\n        [SwaggerWcfPath(\"Get languages\", \"Retrieve all languages from the store\")]\n        [WebGet(UriTemplate = \"/languages\", BodyStyle = WebMessageBodyStyle.Bare)]\n        [OperationContract]\n        Language[] ReadLanguages();\n\n        [SwaggerWcfPath(\"Get language\", \"Retrieve an language from the store using its id\")]\n        [WebGet(UriTemplate = \"/languages/{id}\", BodyStyle = WebMessageBodyStyle.Bare,\n            RequestFormat = WebMessageFormat.Json,\n            ResponseFormat = WebMessageFormat.Xml)]\n        [OperationContract]\n        Language ReadLanguage(string id);\n\n        [SwaggerWcfPath(\"Update language\", \"Update an language on the store\")]\n        [WebInvoke(UriTemplate = \"/languages/{id}\", BodyStyle = WebMessageBodyStyle.Bare, Method = \"PUT\",\n            RequestFormat = WebMessageFormat.Json)]\n        [OperationContract]\n        void UpdateLanguage(string id,\n            [SwaggerWcfParameter(\n                Description =\n                    \"Language to be updated, make sure the id in the language matches the id in the path parameter\"\n            )] Language value);\n\n        [SwaggerWcfPath(\"Delete language\", \"Delete an language on the store\")]\n        [WebInvoke(UriTemplate = \"/languages/{id}\", BodyStyle = WebMessageBodyStyle.Bare, Method = \"DELETE\")]\n        [OperationContract]\n        void DeleteLanguage(string id);\n\n        #endregion\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"SwaggerWcf.Test.Service\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"SwaggerWcf.Test.Service\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2015\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"fd02752a-614d-4faf-8994-519c754107b1\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Revision and Build Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Store.svc",
    "content": "﻿<%@ ServiceHost Language=\"C#\" Debug=\"true\" Service=\"SwaggerWcf.Test.Service.BookStore\" CodeBehind=\"Store.svc.cs\" %>"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Store.svc.cs",
    "content": "﻿using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Net;\nusing System.ServiceModel.Web;\nusing SwaggerWcf.Attributes;\nusing SwaggerWcf.Test.Service.Data;\n\nnamespace SwaggerWcf.Test.Service\n{\n    [SwaggerWcf(\"/v1/rest\")]\n    [SwaggerWcfTag(\"BookStore\")]\n    [SwaggerWcfServiceInfo(\n        title: \"SampleService\",\n        version: \"0.0.1\",\n        Description = \"Sample Service to test SwaggerWCF\",\n        TermsOfService = \"Terms of Service\"\n    )]\n    [SwaggerWcfContactInfo(\n        Name = \"Abel Silva\",\n        Url = \"http://github.com/abelsilva\",\n        Email = \"no@e.mail\"\n    )]\n    [SwaggerWcfLicenseInfo(\n        name: \"Apache License 2.0\",\n        Url = \"https://github.com/abelsilva/SwaggerWCF/blob/master/LICENSE\"\n    )]\n    public class BookStore : IStore\n    {\n        #region /books\n\n        [SwaggerWcfTag(\"Books\")]\n        [SwaggerWcfHeader(\"clientId\", false, \"Client ID\", \"000\")]\n        [SwaggerWcfResponse(HttpStatusCode.Created,\n                            \"Book created, value in the response body with id updated\",\n                            ExampleMimeType = \"application/json\",\n                            ExampleContent = \"{\\\"Author\\\": {\\\"Id\\\": \\\"1dacefd76d3f443d802d326dba990ab0\\\",\\\"Name\\\": \\\"Miguel de Cervantes\\\"},\\\"FirstPublished\\\": 1605,\\\"Id\\\": \\\"017b1d907db64a868cb5d2c4d47d6077\\\",\\\"Language\\\": 2,\\\"Title\\\":\\\"Don Quixote\\\"}\")]\n        [SwaggerWcfResponse(HttpStatusCode.BadRequest,\n                            \"Bad request\",\n                            true,\n                            ExampleMimeType = \"application/json\",\n                            ExampleContent = \"{\\\"error:\\\": \\\"error description\\\"}\")]\n        [SwaggerWcfResponse(HttpStatusCode.InternalServerError,\n                            \"Internal error (can be forced using ERROR_500 as book title)\",\n                            true,\n                            ExampleMimeType = \"application/json\",\n                            ExampleContent = \"{\\\"error:\\\": \\\"error description\\\"}\")]\n        public Book CreateBook(Book value)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return null;\n\n            if (value == null)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.BadRequest;\n                return null;\n            }\n\n            if (!string.IsNullOrWhiteSpace(value.Title) && value.Title == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n                return null;\n            }\n\n            value.Id = Guid.NewGuid().ToString(\"N\");\n            Store.Books.Add(value);\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.Created;\n\n            return value;\n        }\n\n        [SwaggerWcfTag(\"Books\")]\n        [SwaggerWcfResponse(HttpStatusCode.OK, \"Books found, values in the response body\")]\n        [SwaggerWcfResponse(HttpStatusCode.NotFound, \"Book not found\", true)]\n        [SwaggerWcfResponse(HttpStatusCode.InternalServerError,\n            \"Internal error (can be forced using ERROR_500 as book id)\", true)]\n        public Book ReadBook(string id)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return null;\n\n            Book book = Store.Books.FirstOrDefault(b => b.Id == id);\n            if (book != null)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.OK;\n                return book;\n            }\n\n            if (id == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n                return null;\n            }\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n            return null;\n        }\n\n        [SwaggerWcfTag(\"Books\")]\n        [SwaggerWcfResponse(HttpStatusCode.OK, \"Book found, value in the response body\")]\n        [SwaggerWcfResponse(HttpStatusCode.NoContent, \"No books\", true)]\n        public Book[] ReadBooks(string filterText = null)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return null;\n\n            if (Store.Books.Any())\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.OK;\n                return string.IsNullOrEmpty(filterText)\n                    ? Store.Books.ToArray()\n                    : Store.Books.Where(b => b.Author.Name.Contains(filterText) || b.Title.Contains(filterText)).ToArray();\n            }\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.NoContent;\n            return null;\n        }\n\n        [SwaggerWcfTag(\"Books\")]\n        [SwaggerWcfResponse(HttpStatusCode.NoContent, \"Book updated\")]\n        [SwaggerWcfResponse(HttpStatusCode.BadRequest, \"Bad request\")]\n        [SwaggerWcfResponse(HttpStatusCode.NotFound, \"Book not found\")]\n        [SwaggerWcfResponse(HttpStatusCode.InternalServerError,\n            \"Internal error (can be forced using ERROR_500 as book id)\")]\n        public void UpdateBook(string id, Book value)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return;\n\n            if (value == null || value.Id != id)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.BadRequest;\n                return;\n            }\n\n            Book book = Store.Books.FirstOrDefault(b => b.Id == id);\n            if (book != null)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NoContent;\n                Store.Books.Remove(book);\n                Store.Books.Add(value);\n            }\n            else if (id == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n            }\n            else\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n            }\n        }\n\n        [SwaggerWcfTag(\"Books\")]\n        [SwaggerWcfResponse(HttpStatusCode.NoContent, \"Book deleted\")]\n        [SwaggerWcfResponse(HttpStatusCode.NotFound, \"Book not found\")]\n        [SwaggerWcfResponse(HttpStatusCode.InternalServerError,\n            \"Internal error (can be forced using ERROR_500 as book id)\")]\n        public void DeleteBook(string id)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return;\n\n            Book book = Store.Books.FirstOrDefault(b => b.Id == id);\n            if (book != null)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NoContent;\n                Store.Books.Remove(book);\n            }\n            else if (id == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n            }\n            else\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n            }\n        }\n\n        [SwaggerWcfTag(\"LowPerformance\", true)]\n        [SwaggerWcfTag(\"Books\")]\n        [SwaggerWcfResponse(HttpStatusCode.OK, \"Book found, author value in the response body\")]\n        [SwaggerWcfResponse(HttpStatusCode.NoContent, \"Book found, author value in the response body\")]\n        [SwaggerWcfResponse(HttpStatusCode.NotFound, \"Book not found\", true)]\n        [SwaggerWcfResponse(HttpStatusCode.InternalServerError,\n            \"Internal error (can be forced using ERROR_500 as book id)\", true)]\n        public Author ReadBookAuthor(string id)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return null;\n\n            Book book = Store.Books.FirstOrDefault(b => b.Id == id);\n            if (book != null)\n            {\n                if (book.Author == null)\n                {\n                    woc.OutgoingResponse.StatusCode = HttpStatusCode.NoContent;\n                    return null;\n                }\n\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.OK;\n                return book.Author;\n            }\n\n            if (id == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n                return null;\n            }\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n            return null;\n        }\n\n        #endregion\n\n        #region /authors\n\n        [SwaggerWcfTag(\"Authors\")]\n        [SwaggerWcfResponse(201, \"Author created, value in the response body with id updated\")]\n        [SwaggerWcfResponse(400, \"Bad request\", true)]\n        [SwaggerWcfResponse(500, \"Internal error (can be forced using ERROR_500 as author name)\", true)]\n        public Author CreateAuthor(Author value)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return null;\n\n            if (value == null)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.BadRequest;\n                return null;\n            }\n\n            if (!string.IsNullOrWhiteSpace(value.Name) && value.Name == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n                return null;\n            }\n\n            value.Id = Guid.NewGuid().ToString(\"N\");\n            Store.Authors.Add(value);\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.Created;\n\n            return value;\n        }\n\n        [SwaggerWcfTag(\"Authors\")]\n        [SwaggerWcfResponse(200, \"Author found, value in the response body\")]\n        [SwaggerWcfResponse(404, \"Author not found\", true)]\n        [SwaggerWcfResponse(500, \"Internal error (can be forced using ERROR_500 as author id)\", true)]\n        public Author ReadAuthor(string id)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return null;\n\n            Author author = Store.Authors.FirstOrDefault(b => b.Id == id);\n            if (author != null)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.OK;\n                return author;\n            }\n\n            if (id == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n                return null;\n            }\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n            return null;\n        }\n\n        [SwaggerWcfTag(\"Authors\")]\n        [SwaggerWcfResponse(200, \"Authors found, values in the response body\")]\n        [SwaggerWcfResponse(204, \"No authors\", true)]\n        public IList<Author> ReadAuthors()\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return null;\n\n            if (Store.Authors.Any())\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.OK;\n                return Store.Authors;\n            }\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.NoContent;\n            return null;\n        }\n\n        [SwaggerWcfTag(\"Authors\")]\n        [SwaggerWcfResponse(204, \"Author updated\")]\n        [SwaggerWcfResponse(400, \"Bad request\")]\n        [SwaggerWcfResponse(404, \"Author not found\")]\n        [SwaggerWcfResponse(500, \"Internal error (can be forced using ERROR_500 as author id)\")]\n        public void UpdateAuthor(string id, Author value)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return;\n\n            if (value == null || value.Id != id)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.BadRequest;\n                return;\n            }\n\n            Author author = Store.Authors.FirstOrDefault(b => b.Id == id);\n            if (author != null)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NoContent;\n                Store.Authors.Remove(author);\n                Store.Authors.Add(value);\n            }\n            else if (id == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n            }\n            else\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n            }\n        }\n\n        [SwaggerWcfTag(\"Authors\")]\n        [SwaggerWcfResponse(204, \"Author deleted\")]\n        [SwaggerWcfResponse(404, \"Author not found\")]\n        [SwaggerWcfResponse(500, \"Internal error (can be forced using ERROR_500 as author id)\")]\n        public void DeleteAuthor(string id)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return;\n\n            Author author = Store.Authors.FirstOrDefault(b => b.Id == id);\n            if (author != null)\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NoContent;\n                Store.Authors.Remove(author);\n            }\n            else if (id == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n            }\n            else\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n            }\n        }\n\n        [SwaggerWcfTag(\"LowPerformance\", true)]\n        [SwaggerWcfTag(\"Authors\")]\n        [SwaggerWcfResponse(200, \"Book found, author value in the response body\")]\n        [SwaggerWcfResponse(204, \"Book found, author value in the response body\")]\n        [SwaggerWcfResponse(404, \"Book not found\", true)]\n        [SwaggerWcfResponse(500, \"Internal error (can be forced using ERROR_500 as book id)\", true)]\n        public Book[] ReadAuthorBooks(string id)\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return null;\n\n            Author author = Store.Authors.FirstOrDefault(b => b.Id == id);\n            if (author != null)\n            {\n                Book[] books = Store.Books.Where(b => b.Author.Id == id).ToArray();\n                if (!books.Any())\n                {\n                    woc.OutgoingResponse.StatusCode = HttpStatusCode.NoContent;\n                    return null;\n                }\n\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.OK;\n                return books;\n            }\n\n            if (id == \"ERROR_500\")\n            {\n                woc.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError;\n                return null;\n            }\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.NotFound;\n            return null;\n        }\n\n        #endregion\n\n        #region /languages\n\n        [SwaggerWcfHidden]\n        [SwaggerWcfTag(\"Languages\")]\n        [SwaggerWcfResponse(201, \"Language created, value in the response body with id updated\")]\n        [SwaggerWcfResponse(400, \"Bad request\", true)]\n        [SwaggerWcfResponse(500, \"Internal error (can be forced using ERROR_500 as language name)\", true)]\n        public Language CreateLanguage(Language value)\n        {\n            throw new NotImplementedException();\n        }\n\n        [SwaggerWcfHidden]\n        [SwaggerWcfTag(\"Languages\")]\n        [SwaggerWcfResponse(200, \"Language found, value in the response body\")]\n        [SwaggerWcfResponse(404, \"Language not found\", true)]\n        [SwaggerWcfResponse(500, \"Internal error (can be forced using ERROR_500 as language id)\", true)]\n        public Language ReadLanguage(string id)\n        {\n            throw new NotImplementedException();\n        }\n\n        [SwaggerWcfTag(\"Languages\")]\n        [SwaggerWcfResponse(200, \"Language found, value in the response body\")]\n        [SwaggerWcfResponse(204, \"No languages\", true)]\n        public Language[] ReadLanguages()\n        {\n            WebOperationContext woc = WebOperationContext.Current;\n\n            if (woc == null)\n                return null;\n\n            woc.OutgoingResponse.StatusCode = HttpStatusCode.OK;\n            return Enum.GetValues(typeof(Language)).Cast<Language>().ToArray();\n        }\n\n        [SwaggerWcfHidden]\n        [SwaggerWcfTag(\"Languages\")]\n        [SwaggerWcfResponse(204, \"Language updated\")]\n        [SwaggerWcfResponse(400, \"Bad request\")]\n        [SwaggerWcfResponse(404, \"Language not found\")]\n        [SwaggerWcfResponse(500, \"Internal error (can be forced using ERROR_500 as language id)\")]\n        public void UpdateLanguage(string id, Language value)\n        {\n            throw new NotImplementedException();\n        }\n\n        [SwaggerWcfHidden]\n        [SwaggerWcfTag(\"Languages\")]\n        [SwaggerWcfResponse(204, \"Language deleted\")]\n        [SwaggerWcfResponse(404, \"Language not found\")]\n        [SwaggerWcfResponse(500, \"Internal error (can be forced using ERROR_500 as language id)\")]\n        public void DeleteLanguage(string id)\n        {\n            throw new NotImplementedException();\n        }\n\n        #endregion\n    }\n}"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/SwaggerWcf.Test.Service.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <Import Project=\"$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props\" Condition=\"Exists('$(MSBuildExtensionsPath)\\$(MSBuildToolsVersion)\\Microsoft.Common.props')\" />\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>\n    </ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{FD02752A-614D-4FAF-8994-519C754107B1}</ProjectGuid>\n    <ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>SwaggerWcf.Test.Service</RootNamespace>\n    <AssemblyName>SwaggerWcf.Test.Service</AssemblyName>\n    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>\n    <WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>\n    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>\n    <UseIISExpress>true</UseIISExpress>\n    <IISExpressSSLPort />\n    <IISExpressAnonymousAuthentication />\n    <IISExpressWindowsAuthentication />\n    <IISExpressUseClassicPipelineMode />\n    <UseGlobalApplicationHostFile />\n    <TargetFrameworkProfile />\n    <Use64BitIISExpress />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"Microsoft.CSharp\" />\n    <Reference Include=\"System.Data.DataSetExtensions\" />\n    <Reference Include=\"System.ServiceModel.Activation\" />\n    <Reference Include=\"System.Web.DynamicData\" />\n    <Reference Include=\"System.Web.Entity\" />\n    <Reference Include=\"System.Web.ApplicationServices\" />\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Configuration\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.EnterpriseServices\" />\n    <Reference Include=\"System.Runtime.Serialization\" />\n    <Reference Include=\"System.ServiceModel\" />\n    <Reference Include=\"System.ServiceModel.Web\" />\n    <Reference Include=\"System.Web\" />\n    <Reference Include=\"System.Web.Extensions\" />\n    <Reference Include=\"System.Web.Services\" />\n    <Reference Include=\"System.Xml\" />\n    <Reference Include=\"System.Xml.Linq\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Content Include=\"Store.svc\" />\n    <Content Include=\"Global.asax\" />\n    <Content Include=\"Web.config\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"AuthorService.cs\" />\n    <Compile Include=\"BaseService.cs\" />\n    <Compile Include=\"Data\\Author.cs\" />\n    <Compile Include=\"Data\\Book.cs\" />\n    <Compile Include=\"Data\\Language.cs\" />\n    <Compile Include=\"Data\\Store.cs\" />\n    <Compile Include=\"IAuthorService.cs\" />\n    <Compile Include=\"IBaseCRUDService.cs\" />\n    <Compile Include=\"IBaseService.cs\" />\n    <Compile Include=\"Store.svc.cs\">\n      <DependentUpon>Store.svc</DependentUpon>\n    </Compile>\n    <Compile Include=\"Global.asax.cs\">\n      <DependentUpon>Global.asax</DependentUpon>\n    </Compile>\n    <Compile Include=\"IStore.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <None Include=\"Web.Debug.config\">\n      <DependentUpon>Web.config</DependentUpon>\n    </None>\n    <None Include=\"Web.Release.config\">\n      <DependentUpon>Web.config</DependentUpon>\n    </None>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\SwaggerWcf\\SwaggerWcf.csproj\">\n      <Project>{0ad6efbc-412f-4c0e-8e0a-0faf28151b55}</Project>\n      <Name>SwaggerWcf</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <PropertyGroup>\n    <VisualStudioVersion Condition=\"'$(VisualStudioVersion)' == ''\">10.0</VisualStudioVersion>\n    <VSToolsPath Condition=\"'$(VSToolsPath)' == ''\">$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v$(VisualStudioVersion)</VSToolsPath>\n  </PropertyGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <Import Project=\"$(VSToolsPath)\\WebApplications\\Microsoft.WebApplication.targets\" Condition=\"'$(VSToolsPath)' != ''\" />\n  <Import Project=\"$(MSBuildExtensionsPath32)\\Microsoft\\VisualStudio\\v10.0\\WebApplications\\Microsoft.WebApplication.targets\" Condition=\"false\" />\n  <ProjectExtensions>\n    <VisualStudio>\n      <FlavorProperties GUID=\"{349c5851-65df-11da-9384-00065b846f21}\">\n        <WebProjectProperties>\n          <UseIIS>True</UseIIS>\n          <AutoAssignPort>True</AutoAssignPort>\n          <DevelopmentServerPort>52331</DevelopmentServerPort>\n          <DevelopmentServerVPath>/</DevelopmentServerVPath>\n          <IISUrl>http://localhost:52331/</IISUrl>\n          <NTLMAuthentication>False</NTLMAuthentication>\n          <UseCustomServer>False</UseCustomServer>\n          <CustomServerUrl>\n          </CustomServerUrl>\n          <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>\n        </WebProjectProperties>\n      </FlavorProperties>\n    </VisualStudio>\n  </ProjectExtensions>\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/SwaggerWcf.Test.Service.csproj.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:String x:Key=\"/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue\">CSharp70</s:String></wpf:ResourceDictionary>"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Web.Debug.config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->\n\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <!--\n    In the example below, the \"SetAttributes\" transform will change the value of \n    \"connectionString\" to use \"ReleaseSQLServer\" only when the \"Match\" locator \n    finds an attribute \"name\" that has a value of \"MyDB\".\n    \n    <connectionStrings>\n      <add name=\"MyDB\" \n        connectionString=\"Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True\" \n        xdt:Transform=\"SetAttributes\" xdt:Locator=\"Match(name)\"/>\n    </connectionStrings>\n  -->\n  <system.web>\n    <!--\n      In the example below, the \"Replace\" transform will replace the entire \n      <customErrors> section of your web.config file.\n      Note that because there is only one customErrors section under the \n      <system.web> node, there is no need to use the \"xdt:Locator\" attribute.\n      \n      <customErrors defaultRedirect=\"GenericError.htm\"\n        mode=\"RemoteOnly\" xdt:Transform=\"Replace\">\n        <error statusCode=\"500\" redirect=\"InternalError.htm\"/>\n      </customErrors>\n    -->\n  </system.web>\n</configuration>"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Web.Release.config",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->\n\n<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">\n  <!--\n    In the example below, the \"SetAttributes\" transform will change the value of \n    \"connectionString\" to use \"ReleaseSQLServer\" only when the \"Match\" locator \n    finds an attribute \"name\" that has a value of \"MyDB\".\n    \n    <connectionStrings>\n      <add name=\"MyDB\" \n        connectionString=\"Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True\" \n        xdt:Transform=\"SetAttributes\" xdt:Locator=\"Match(name)\"/>\n    </connectionStrings>\n  -->\n  <system.web>\n    <compilation xdt:Transform=\"RemoveAttributes(debug)\" />\n    <!--\n      In the example below, the \"Replace\" transform will replace the entire \n      <customErrors> section of your web.config file.\n      Note that because there is only one customErrors section under the \n      <system.web> node, there is no need to use the \"xdt:Locator\" attribute.\n      \n      <customErrors defaultRedirect=\"GenericError.htm\"\n        mode=\"RemoteOnly\" xdt:Transform=\"Replace\">\n        <error statusCode=\"500\" redirect=\"InternalError.htm\"/>\n      </customErrors>\n    -->\n  </system.web>\n</configuration>"
  },
  {
    "path": "src/SwaggerWcf.Test.Service/Web.config",
    "content": "﻿<?xml version=\"1.0\"?>\n<configuration>\n  <!--\n  <configSections>\n    <section name=\"swaggerwcf\" type=\"SwaggerWcf.Configuration.SwaggerWcfSection, SwaggerWcf\"/>\n  </configSections>\n  <swaggerwcf>\n    <tags>\n      <tag name=\"LowPerformance\" visible=\"false\"/>\n    </tags>\n    <settings>\n      <setting name=\"Schemes\" value=\"https;http\"/>\n      <setting name=\"InfoDescription\" value=\"Sample Service to test SwaggerWCF\"/>\n      <setting name=\"InfoVersion\" value=\"0.0.1\"/>\n      <setting name=\"InfoTermsOfService\" value=\"Terms of Service\"/>\n      <setting name=\"InfoTitle\" value=\"SampleService\"/>\n      <setting name=\"InfoContactName\" value=\"Abel Silva\"/>\n      <setting name=\"InfoContactUrl\" value=\"http://github.com/abelsilva\"/>\n      <setting name=\"InfoContactEmail\" value=\"no@e.mail\"/>\n      <setting name=\"InfoLicenseUrl\" value=\"https://github.com/abelsilva/SwaggerWCF/blob/master/LICENSE\"/>\n      <setting name=\"InfoLicenseName\" value=\"Apache License\"/>\n    </settings>\n  </swaggerwcf>\n  -->\n  <appSettings>\n    <add key=\"aspnet:UseTaskFriendlySynchronizationContext\" value=\"true\"/>\n  </appSettings>\n  <!--\n    For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.\n\n    The following attributes can be set on the <httpRuntime> tag.\n      <system.Web>\n        <httpRuntime targetFramework=\"4.5\" />\n      </system.Web>\n  -->\n  <system.web>\n    <compilation debug=\"true\" targetFramework=\"4.5\"/>\n    <httpRuntime targetFramework=\"4.5\"/>\n  </system.web>\n  <system.serviceModel>\n    <behaviors>\n      <!-- ADDED automaticFormatSelectionEnabled -->\n      <endpointBehaviors>\n        <behavior>\n          <webHttp automaticFormatSelectionEnabled=\"true\"/>\n        </behavior>\n      </endpointBehaviors>\n      <serviceBehaviors>\n        <behavior>\n          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->\n          <serviceMetadata httpGetEnabled=\"true\" httpsGetEnabled=\"true\"/>\n          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->\n          <serviceDebug includeExceptionDetailInFaults=\"false\"/>\n        </behavior>\n      </serviceBehaviors>\n    </behaviors>\n    <protocolMapping>\n      <add binding=\"basicHttpsBinding\" scheme=\"https\"/>\n    </protocolMapping>\n    <serviceHostingEnvironment aspNetCompatibilityEnabled=\"true\" multipleSiteBindingsEnabled=\"true\"/>\n  </system.serviceModel>\n  <system.webServer>\n    <modules runAllManagedModulesForAllRequests=\"true\"/>\n    <!--\n        To browse web app root directory during debugging, set the value below to true.\n        Set to false before deployment to avoid disclosing web app folder information.\n      -->\n    <directoryBrowse enabled=\"true\"/>\n  </system.webServer>\n</configuration>\n"
  },
  {
    "path": "src/SwaggerWcf.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 14\nVisualStudioVersion = 14.0.24720.0\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SwaggerWcf\", \"SwaggerWcf\\SwaggerWcf.csproj\", \"{0AD6EFBC-412F-4C0E-8E0A-0FAF28151B55}\"\nEndProject\nProject(\"{2150E333-8FDC-42A3-9474-1A3956D46DE8}\") = \"Solution Items\", \"Solution Items\", \"{479EF2BE-93C9-4DE8-ACDD-538BB2203DB4}\"\n\tProjectSection(SolutionItems) = preProject\n\t\t..\\README.md = ..\\README.md\n\t\t..\\notes\\spec-2.0.md = ..\\notes\\spec-2.0.md\n\tEndProjectSection\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"SwaggerWcf.Test.Service\", \"SwaggerWcf.Test.Service\\SwaggerWcf.Test.Service.csproj\", \"{FD02752A-614D-4FAF-8994-519C754107B1}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{0AD6EFBC-412F-4C0E-8E0A-0FAF28151B55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0AD6EFBC-412F-4C0E-8E0A-0FAF28151B55}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0AD6EFBC-412F-4C0E-8E0A-0FAF28151B55}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0AD6EFBC-412F-4C0E-8E0A-0FAF28151B55}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{FD02752A-614D-4FAF-8994-519C754107B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{FD02752A-614D-4FAF-8994-519C754107B1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{FD02752A-614D-4FAF-8994-519C754107B1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{FD02752A-614D-4FAF-8994-519C754107B1}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "src/SwaggerWcf.sln.DotSettings",
    "content": "﻿<wpf:ResourceDictionary xml:space=\"preserve\" xmlns:x=\"http://schemas.microsoft.com/winfx/2006/xaml\" xmlns:s=\"clr-namespace:System;assembly=mscorlib\" xmlns:ss=\"urn:shemas-jetbrains-com:settings-storage-xaml\" xmlns:wpf=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\">\n\t<s:String x:Key=\"/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=UI/@EntryIndexedValue\">UI</s:String>\n\t<s:String x:Key=\"/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=WCF/@EntryIndexedValue\">WCF</s:String></wpf:ResourceDictionary>"
  },
  {
    "path": "src/packages/.gitignore",
    "content": "*\n!repositories.config\n!.gitignore"
  },
  {
    "path": "src/packages/repositories.config",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<repositories>\n  <repository path=\"..\\SwaggerWcf\\packages.config\" />\n</repositories>"
  }
]