Skip to content

Commit

Permalink
Merge pull request #67 from NSwag/master
Browse files Browse the repository at this point in the history
Release v2.9
  • Loading branch information
RicoSuter committed Apr 22, 2016
2 parents c7a5385 + 9af97ee commit ea2abf7
Show file tree
Hide file tree
Showing 31 changed files with 788 additions and 740 deletions.
2 changes: 1 addition & 1 deletion src/NSwag.Annotations/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
[assembly: AssemblyCompany("Rico Suter")]
[assembly: AssemblyProduct("NSwag.Annotations")]
[assembly: AssemblyCopyright("Copyright © Rico Suter, 2015")]
[assembly: AssemblyVersion("2.8.*")]
[assembly: AssemblyVersion("2.9.*")]
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NJsonSchema, Version=2.7.5954.13235, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.7.5954.13235\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Reference Include="NJsonSchema, Version=2.9.5956.34078, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.9.5956.34078\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NJsonSchema.CodeGeneration, Version=2.7.5954.13236, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.7.5954.13236\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
<Reference Include="NJsonSchema.CodeGeneration, Version=2.9.5956.34079, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.9.5956.34079\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.CodeGeneration.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("2.8.*")]
// [assembly: AssemblyVersion("2.9.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
4 changes: 2 additions & 2 deletions src/NSwag.CodeGeneration.Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="NJsonSchema" version="2.7.5954.13235" targetFramework="net45" />
<package id="NJsonSchema.CodeGeneration" version="2.7.5954.13236" targetFramework="net45" />
<package id="NJsonSchema" version="2.9.5956.34078" targetFramework="net45" />
<package id="NJsonSchema.CodeGeneration" version="2.9.5956.34079" targetFramework="net45" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public SwaggerToTypeScriptClientGenerator(SwaggerService service, SwaggerToTypeS
foreach (var definition in _service.Definitions)
definition.Value.TypeName = definition.Key;

_resolver = new TypeScriptTypeResolver(_service.Definitions.Select(p => p.Value).ToArray());
_resolver = new TypeScriptTypeResolver(_service.Definitions.Select(p => p.Value).ToArray(), Settings.TypeScriptGeneratorSettings);
}

/// <summary>Gets or sets the generator settings.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// <author>Rico Suter, [email protected]</author>
//-----------------------------------------------------------------------

using NJsonSchema.CodeGeneration.TypeScript;

namespace NSwag.CodeGeneration.CodeGenerators.TypeScript
{
/// <summary>Settings for the <see cref="SwaggerToTypeScriptClientGenerator"/>.</summary>
Expand All @@ -18,8 +20,12 @@ public SwaggerToTypeScriptClientGeneratorSettings()
ClassName = "{controller}Client";
Template = TypeScriptTemplate.JQueryCallbacks;
PromiseType = PromiseType.Promise;
TypeScriptGeneratorSettings = new TypeScriptGeneratorSettings();
}

/// <summary>Gets or sets the TypeScript generator settings.</summary>
public TypeScriptGeneratorSettings TypeScriptGeneratorSettings { get; set; }

/// <summary>Gets or sets the class name of the service client.</summary>
public string ClassName { get; set; }

Expand Down
8 changes: 4 additions & 4 deletions src/NSwag.CodeGeneration/NSwag.CodeGeneration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NJsonSchema, Version=2.7.5954.13235, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.7.5954.13235\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Reference Include="NJsonSchema, Version=2.9.5956.34078, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.9.5956.34078\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NJsonSchema.CodeGeneration, Version=2.7.5954.13236, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.7.5954.13236\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
<Reference Include="NJsonSchema.CodeGeneration, Version=2.9.5956.34079, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.9.5956.34079\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.CodeGeneration/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
[assembly: AssemblyCompany("Rico Suter")]
[assembly: AssemblyProduct("NSwag.CodeGeneration")]
[assembly: AssemblyCopyright("Copyright © Rico Suter, 2015")]
[assembly: AssemblyVersion("2.8.*")]
[assembly: AssemblyVersion("2.9.*")]
4 changes: 2 additions & 2 deletions src/NSwag.CodeGeneration/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<packages>
<package id="Antlr4.StringTemplate" version="4.0.6.9004" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="NJsonSchema" version="2.7.5954.13235" targetFramework="net45" />
<package id="NJsonSchema.CodeGeneration" version="2.7.5954.13236" targetFramework="net45" />
<package id="NJsonSchema" version="2.9.5956.34078" targetFramework="net45" />
<package id="NJsonSchema.CodeGeneration" version="2.9.5956.34079" targetFramework="net45" />
</packages>
4 changes: 2 additions & 2 deletions src/NSwag.Core/NSwag.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NJsonSchema, Version=2.7.5954.13235, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.7.5954.13235\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Reference Include="NJsonSchema, Version=2.9.5956.34078, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.9.5956.34078\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Core/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
[assembly: AssemblyCompany("Rico Suter")]
[assembly: AssemblyProduct("NSwag")]
[assembly: AssemblyCopyright("Copyright © Rico Suter, 2015")]
[assembly: AssemblyVersion("2.8.*")]
[assembly: AssemblyVersion("2.9.*")]
2 changes: 1 addition & 1 deletion src/NSwag.Core/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="NJsonSchema" version="2.7.5954.13235" targetFramework="portable45-net45+win8+wp8+wpa81" />
<package id="NJsonSchema" version="2.9.5956.34078" targetFramework="portable45-net45+win8+wp8+wpa81" />
</packages>
2 changes: 1 addition & 1 deletion src/NSwag.Demo.Client/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("2.8.*")]
// [assembly: AssemblyVersion("2.9.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
1 change: 1 addition & 0 deletions src/NSwag.Demo.Web/Models/Car.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class Car
{
public string Name { get; set; }

[ReadOnly(true)]
public Person Driver { get; set; }

[JsonConverter(typeof(StringEnumConverter))]
Expand Down
4 changes: 2 additions & 2 deletions src/NSwag.Demo.Web/NSwag.Demo.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NJsonSchema, Version=2.7.5954.13235, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.7.5954.13235\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Reference Include="NJsonSchema, Version=2.9.5956.34078, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.9.5956.34078\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http" />
Expand Down
3 changes: 2 additions & 1 deletion src/NSwag.Demo.Web/Swagger.nswag
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
"ModuleName": "",
"Template": 0,
"PromiseType": 0,
"GenerateClientClasses": true,
"GenerateClientClasses": false,
"GenerateClientInterfaces": true,
"GenerateDtoTypes": true,
"OperationGenerationMode": 0,
"GenerateReadOnlyKeywords": false,
"Input": null,
"OutputFilePath": null
},
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Demo.Web/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NJsonSchema" publicKeyToken="c2f9c3bdfae56102" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.7.5954.13235" newVersion="2.7.5954.13235" />
<bindingRedirect oldVersion="0.0.0.0-2.8.5956.13680" newVersion="2.8.5956.13680" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Demo.Web/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="NJsonSchema" version="2.7.5954.13235" targetFramework="net45" />
<package id="NJsonSchema" version="2.9.5956.34078" targetFramework="net45" />
</packages>
4 changes: 2 additions & 2 deletions src/NSwag.Tests/NSwag.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NJsonSchema, Version=2.7.5954.13235, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.7.5954.13235\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Reference Include="NJsonSchema, Version=2.9.5956.34078, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.9.5956.34078\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("2.8.*")]
// [assembly: AssemblyVersion("2.9.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
2 changes: 1 addition & 1 deletion src/NSwag.Tests/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NJsonSchema" publicKeyToken="c2f9c3bdfae56102" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.7.5954.13235" newVersion="2.7.5954.13235" />
<bindingRedirect oldVersion="0.0.0.0-2.8.5956.13680" newVersion="2.8.5956.13680" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag.Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net452" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net452" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net452" />
<package id="NJsonSchema" version="2.7.5954.13235" targetFramework="net452" />
<package id="NJsonSchema" version="2.9.5956.34078" targetFramework="net452" />
</packages>
8 changes: 8 additions & 0 deletions src/NSwag/Commands/SwaggerToTypeScriptCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ public OperationGenerationMode OperationGenerationMode
set { Settings.OperationGenerationMode = value; }
}

[Description("Specifies whether to generate readonly keywords (only available in TS 2.0+, default: true).")]
[Argument(Name = "GenerateReadOnlyKeywords", DefaultValue = true)]
public bool GenerateReadOnlyKeywords
{
get { return Settings.TypeScriptGeneratorSettings.GenerateReadOnlyKeywords; }
set { Settings.TypeScriptGeneratorSettings.GenerateReadOnlyKeywords = value; }
}

public override async Task RunAsync(CommandLineProcessor processor, IConsoleHost host)
{
var output = await RunAsync();
Expand Down
8 changes: 4 additions & 4 deletions src/NSwag/NSwag.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NJsonSchema, Version=2.7.5954.13235, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.7.5954.13235\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Reference Include="NJsonSchema, Version=2.9.5956.34078, Culture=neutral, PublicKeyToken=c2f9c3bdfae56102, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.2.9.5956.34078\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NJsonSchema.CodeGeneration, Version=2.7.5954.13236, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.7.5954.13236\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
<Reference Include="NJsonSchema.CodeGeneration, Version=2.9.5956.34079, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.9.5956.34079\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
Expand Down
2 changes: 1 addition & 1 deletion src/NSwag/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
[assembly: AssemblyCompany("Rico Suter")]
[assembly: AssemblyProduct("NSwag.Console")]
[assembly: AssemblyCopyright("Copyright © Rico Suter, 2015")]
[assembly: AssemblyVersion("2.8.*")]
[assembly: AssemblyVersion("2.9.*")]
4 changes: 2 additions & 2 deletions src/NSwag/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<package id="Antlr4.StringTemplate" version="4.0.6.9004" targetFramework="net452" />
<package id="NConsole" version="1.2.5854.14777" targetFramework="net45" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
<package id="NJsonSchema" version="2.7.5954.13235" targetFramework="net46" />
<package id="NJsonSchema.CodeGeneration" version="2.7.5954.13236" targetFramework="net46" />
<package id="NJsonSchema" version="2.9.5956.34078" targetFramework="net46" />
<package id="NJsonSchema.CodeGeneration" version="2.9.5956.34079" targetFramework="net46" />
</packages>
Loading

0 comments on commit ea2abf7

Please sign in to comment.