Skip to content

Commit 43139dd

Browse files
committed
Migrated to T4
1 parent ea18090 commit 43139dd

File tree

86 files changed

+11417
-2189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+11417
-2189
lines changed

LICENSE.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
# Microsoft Public License (Ms-PL)
2-
3-
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
4-
5-
1\. Definitions
6-
7-
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
8-
9-
A "contribution" is the original software, or any additions or changes to the software.
10-
11-
A "contributor" is any person that distributes its contribution under this license.
12-
13-
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
14-
15-
2\. Grant of Rights
16-
17-
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
18-
19-
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
20-
21-
3\. Conditions and Limitations
22-
23-
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
24-
25-
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
26-
27-
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
28-
29-
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
30-
31-
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
32-
1+
# Microsoft Public License (Ms-PL)
2+
3+
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
4+
5+
1\. Definitions
6+
7+
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
8+
9+
A "contribution" is the original software, or any additions or changes to the software.
10+
11+
A "contributor" is any person that distributes its contribution under this license.
12+
13+
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
14+
15+
2\. Grant of Rights
16+
17+
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
18+
19+
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
20+
21+
3\. Conditions and Limitations
22+
23+
(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
24+
25+
(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
26+
27+
(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
28+
29+
(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
30+
31+
(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
32+

assets/NSwagIcon.metrop

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<IconProject Version="2.0" Name="NSwagIcon">
3-
<Icon Name="NSwagIcon" HasCharacterMap="false" GroupName="Science and Technology" IsDirty="true" ExportCommand="MetroGraphicsPackage.IconCommand" Data="M44.6230001449585,0L49.6660003662109,0 49.6660003662109,7.8328161239624 64,7.8328161239624 64,17.9335794448853 50.2140102386475,17.9335794448853 50.2140102386475,24.8710021972656 49.6660003662109,24.8710021972656 49.6660003662109,25.1484107971191 64,25.1484107971191 64,35.2481746673584 49.6660003662109,35.2481746673584 49.6660003662109,43.0819911956787 44.6230001449585,43.0819911956787C34.4850001335144,43.0819911956787,25.9850001335144,36.0381565093994,23.706000328064,26.6033773422241L16.2250003814697,26.6033773422241 10.4699993133545,26.6033773422241 0,26.6033773422241 0,21.5364961624146 0,16.4906139373779 16.2250003814697,16.4906139373779 23.706000328064,16.4906139373779C25.9850001335144,7.0438346862793,34.4850001335144,0,44.6230001449585,0z">
4-
<Settings MainWidth="256" MainHeight="256" FlipX="1" FlipY="1" CustomSize="256" IconShape="Square" BackgroundBrush="#FF2D680E" ContentWidth="160" ContentHeight="160" Angle="0" IsRect="false" SizeIndex="6" CustomWidth="256" CustomHeight="256" IsLinked="false" Padding="48" MaximumPadding="79" SldierValueChanged="MetroGraphicsPackage.IconCommand" IconBrush="#FFFFFFFF" FontFamily="Webdings" Character="&gt;" FlipCommand="MetroGraphicsPackage.IconCommand" IsBackgroundVisible="true" />
5-
</Icon>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<IconProject Version="2.0" Name="NSwagIcon">
3+
<Icon Name="NSwagIcon" HasCharacterMap="false" GroupName="Science and Technology" IsDirty="true" ExportCommand="MetroGraphicsPackage.IconCommand" Data="M44.6230001449585,0L49.6660003662109,0 49.6660003662109,7.8328161239624 64,7.8328161239624 64,17.9335794448853 50.2140102386475,17.9335794448853 50.2140102386475,24.8710021972656 49.6660003662109,24.8710021972656 49.6660003662109,25.1484107971191 64,25.1484107971191 64,35.2481746673584 49.6660003662109,35.2481746673584 49.6660003662109,43.0819911956787 44.6230001449585,43.0819911956787C34.4850001335144,43.0819911956787,25.9850001335144,36.0381565093994,23.706000328064,26.6033773422241L16.2250003814697,26.6033773422241 10.4699993133545,26.6033773422241 0,26.6033773422241 0,21.5364961624146 0,16.4906139373779 16.2250003814697,16.4906139373779 23.706000328064,16.4906139373779C25.9850001335144,7.0438346862793,34.4850001335144,0,44.6230001449585,0z">
4+
<Settings MainWidth="256" MainHeight="256" FlipX="1" FlipY="1" CustomSize="256" IconShape="Square" BackgroundBrush="#FF2D680E" ContentWidth="160" ContentHeight="160" Angle="0" IsRect="false" SizeIndex="6" CustomWidth="256" CustomHeight="256" IsLinked="false" Padding="48" MaximumPadding="79" SldierValueChanged="MetroGraphicsPackage.IconCommand" IconBrush="#FFFFFFFF" FontFamily="Webdings" Character="&gt;" FlipCommand="MetroGraphicsPackage.IconCommand" IsBackgroundVisible="true" />
5+
</Icon>
66
</IconProject>
Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
//-----------------------------------------------------------------------
2-
// <copyright file="ResponseTypeAttribute.cs" company="NSwag">
3-
// Copyright (c) Rico Suter. All rights reserved.
4-
// </copyright>
5-
// <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license>
6-
// <author>Rico Suter, [email protected]</author>
7-
//-----------------------------------------------------------------------
8-
9-
using System;
10-
11-
namespace NSwag.Annotations
12-
{
13-
/// <summary>Specifies the result type of a web service method to correctly generate a Swagger definition.</summary>
14-
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
15-
public class ResponseTypeAttribute : Attribute
16-
{
17-
/// <summary>Initializes a new instance of the <see cref="ResponseTypeAttribute"/> class.</summary>
18-
/// <param name="responseType">The JSON result type of the MVC or Web API action method.</param>
19-
public ResponseTypeAttribute(Type responseType)
20-
{
21-
HttpStatusCode = "200";
22-
ResponseType = responseType;
23-
}
24-
25-
/// <summary>Initializes a new instance of the <see cref="ResponseTypeAttribute"/> class.</summary>
26-
/// <param name="httpStatusCode">The HTTP status code for which the result type applies.</param>
27-
/// <param name="responseType">The JSON result type of the MVC or Web API action method.</param>
28-
public ResponseTypeAttribute(string httpStatusCode, Type responseType)
29-
{
30-
HttpStatusCode = httpStatusCode;
31-
ResponseType = responseType;
32-
}
33-
34-
/// <summary>Gets or sets the HTTP status code for which the result type applies.</summary>
35-
public string HttpStatusCode { get; set; }
36-
37-
/// <summary>Gets or sets the JSON result type of the MVC or Web API action method.</summary>
38-
public Type ResponseType { get; set; }
39-
}
40-
}
1+
//-----------------------------------------------------------------------
2+
// <copyright file="ResponseTypeAttribute.cs" company="NSwag">
3+
// Copyright (c) Rico Suter. All rights reserved.
4+
// </copyright>
5+
// <license>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</license>
6+
// <author>Rico Suter, [email protected]</author>
7+
//-----------------------------------------------------------------------
8+
9+
using System;
10+
11+
namespace NSwag.Annotations
12+
{
13+
/// <summary>Specifies the result type of a web service method to correctly generate a Swagger definition.</summary>
14+
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
15+
public class ResponseTypeAttribute : Attribute
16+
{
17+
/// <summary>Initializes a new instance of the <see cref="ResponseTypeAttribute"/> class.</summary>
18+
/// <param name="responseType">The JSON result type of the MVC or Web API action method.</param>
19+
public ResponseTypeAttribute(Type responseType)
20+
{
21+
HttpStatusCode = "200";
22+
ResponseType = responseType;
23+
}
24+
25+
/// <summary>Initializes a new instance of the <see cref="ResponseTypeAttribute"/> class.</summary>
26+
/// <param name="httpStatusCode">The HTTP status code for which the result type applies.</param>
27+
/// <param name="responseType">The JSON result type of the MVC or Web API action method.</param>
28+
public ResponseTypeAttribute(string httpStatusCode, Type responseType)
29+
{
30+
HttpStatusCode = httpStatusCode;
31+
ResponseType = responseType;
32+
}
33+
34+
/// <summary>Gets or sets the HTTP status code for which the result type applies.</summary>
35+
public string HttpStatusCode { get; set; }
36+
37+
/// <summary>Gets or sets the JSON result type of the MVC or Web API action method.</summary>
38+
public Type ResponseType { get; set; }
39+
}
40+
}

src/NSwag.CodeGeneration/Infrastructure/AppDomainIsolation.cs renamed to src/NSwag.AssemblyLoader/Infrastructure/AppDomainIsolation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
using System;
1010

11-
namespace NSwag.CodeGeneration.Infrastructure
11+
namespace NSwag.AssemblyLoader.Infrastructure
1212
{
1313
internal sealed class AppDomainIsolation<T> : IDisposable where T : MarshalByRefObject
1414
{

src/NSwag.CodeGeneration/Infrastructure/AssemblyConfigurationFileTransformer.cs renamed to src/NSwag.AssemblyLoader/Infrastructure/AssemblyConfigurationFileTransformer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using System.Text;
1313
using System.Text.RegularExpressions;
1414

15-
namespace NSwag.CodeGeneration.Infrastructure
15+
namespace NSwag.AssemblyLoader.Infrastructure
1616
{
1717
internal class AssemblyConfigurationFileTransformer : IDisposable
1818
{
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{46634C60-BA7D-43E6-9049-6AD461488C39}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>NSwag.AssemblyLoader</RootNamespace>
11+
<AssemblyName>NSwag.AssemblyLoader</AssemblyName>
12+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
13+
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>false</Optimize>
20+
<OutputPath>bin\Debug\</OutputPath>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<ErrorReport>prompt</ErrorReport>
23+
<WarningLevel>4</WarningLevel>
24+
</PropertyGroup>
25+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
26+
<DebugType>pdbonly</DebugType>
27+
<Optimize>true</Optimize>
28+
<OutputPath>bin\Release\</OutputPath>
29+
<DefineConstants>TRACE</DefineConstants>
30+
<ErrorReport>prompt</ErrorReport>
31+
<WarningLevel>4</WarningLevel>
32+
</PropertyGroup>
33+
<ItemGroup>
34+
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
35+
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
36+
<Private>True</Private>
37+
</Reference>
38+
<Reference Include="System" />
39+
<Reference Include="System.Core" />
40+
<Reference Include="System.Xml.Linq" />
41+
<Reference Include="System.Data.DataSetExtensions" />
42+
<Reference Include="Microsoft.CSharp" />
43+
<Reference Include="System.Data" />
44+
<Reference Include="System.Net.Http" />
45+
<Reference Include="System.Xml" />
46+
</ItemGroup>
47+
<ItemGroup>
48+
<Compile Include="Infrastructure\AppDomainIsolation.cs" />
49+
<Compile Include="Infrastructure\AssemblyConfigurationFileTransformer.cs" />
50+
<Compile Include="Properties\AssemblyInfo.cs" />
51+
<Compile Include="SwaggerGenerators\AssemblyLoader.cs" />
52+
<Compile Include="SwaggerGenerators\AssemblyTypeToSwaggerGenerator.cs" />
53+
<Compile Include="SwaggerGenerators\AssemblyTypeToSwaggerGeneratorSettings.cs" />
54+
<Compile Include="SwaggerGenerators\WebApi\WebApiAssemblyToSwaggerGenerator.cs" />
55+
<Compile Include="SwaggerGenerators\WebApi\WebApiAssemblyToSwaggerGeneratorSettings.cs" />
56+
</ItemGroup>
57+
<ItemGroup>
58+
<ProjectReference Include="..\..\..\NJsonSchema\src\NJsonSchema\NJsonSchema.csproj">
59+
<Project>{7B7A2E32-E808-4A19-98B1-37E766580F8C}</Project>
60+
<Name>NJsonSchema</Name>
61+
</ProjectReference>
62+
<ProjectReference Include="..\NSwag.CodeGeneration\NSwag.CodeGeneration.csproj">
63+
<Project>{75B3F91D-687E-4FB3-AD45-CCFA3C406DB4}</Project>
64+
<Name>NSwag.CodeGeneration</Name>
65+
</ProjectReference>
66+
<ProjectReference Include="..\NSwag.Core\NSwag.Core.csproj">
67+
<Project>{2E6174AA-FC75-4821-9E86-51B30568BEC0}</Project>
68+
<Name>NSwag.Core</Name>
69+
</ProjectReference>
70+
</ItemGroup>
71+
<ItemGroup>
72+
<None Include="NSwag.AssemblyLoader.nuspec" />
73+
<None Include="packages.config" />
74+
</ItemGroup>
75+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
76+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
77+
Other similar extension points exist, see Microsoft.Common.targets.
78+
<Target Name="BeforeBuild">
79+
</Target>
80+
<Target Name="AfterBuild">
81+
</Target>
82+
-->
83+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<package>
3+
<metadata>
4+
<id>$id$</id>
5+
<version>$version$</version>
6+
<authors>$author$</authors>
7+
<description>$description$</description>
8+
<tags>Swagger Documentation WebApi AspNet TypeScript CodeGen</tags>
9+
<projectUrl>https://github.com/NSwag/NSwag</projectUrl>
10+
<licenseUrl>https://github.com/NSwag/NSwag/blob/master/LICENSE.md</licenseUrl>
11+
<iconUrl>https://raw.githubusercontent.com/NSwag/NSwag/master/assets/NuGetIcon.png</iconUrl>
12+
</metadata>
13+
<files>
14+
<file src="bin\Release\NSwag.AssemblyLoader.dll" target="lib\net45" />
15+
<file src="bin\Release\NSwag.AssemblyLoader.pdb" target="lib\net45" />
16+
<file src="bin\Release\NSwag.AssemblyLoader.xml" target="lib\net45" />
17+
</files>
18+
</package>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using System.Reflection;
2+
3+
[assembly: AssemblyTitle("NSwag.AssemblyLoader")]
4+
[assembly: AssemblyDescription("")]
5+
[assembly: AssemblyCompany("Rico Suter")]
6+
[assembly: AssemblyProduct("NSwag.AssemblyLoader")]
7+
[assembly: AssemblyCopyright("Copyright © Rico Suter, 2015")]
8+
[assembly: AssemblyVersion("2.18.*")]

src/NSwag.CodeGeneration/SwaggerGenerators/AssemblyLoader.cs renamed to src/NSwag.AssemblyLoader/SwaggerGenerators/AssemblyLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
using System.Linq;
1313
using System.Reflection;
1414

15-
namespace NSwag.CodeGeneration.SwaggerGenerators
15+
namespace NSwag.AssemblyLoader.SwaggerGenerators
1616
{
1717
internal class AssemblyLoader : MarshalByRefObject
1818
{

src/NSwag.CodeGeneration/SwaggerGenerators/AssemblyTypeToSwaggerGenerator.cs renamed to src/NSwag.AssemblyLoader/SwaggerGenerators/AssemblyTypeToSwaggerGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
using Newtonsoft.Json;
1414
using NJsonSchema;
1515
using NJsonSchema.Generation;
16-
using NSwag.CodeGeneration.Infrastructure;
16+
using NSwag.AssemblyLoader.Infrastructure;
1717

18-
namespace NSwag.CodeGeneration.SwaggerGenerators
18+
namespace NSwag.AssemblyLoader.SwaggerGenerators
1919
{
2020
/// <summary>Generates a <see cref="SwaggerService"/> from a Web API controller or type which is located in a .NET assembly.</summary>
2121
public class AssemblyTypeToSwaggerGenerator

0 commit comments

Comments
 (0)