Skip to content

Commit 1045162

Browse files
committed
Merge pull request #55 from NSwag/master
Release v2.4
2 parents ef3358d + e2c22f4 commit 1045162

File tree

27 files changed

+752
-752
lines changed

27 files changed

+752
-752
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ CI: [![Build status](https://ci.appveyor.com/api/projects/status/sfoha01b3i841ik
66

77
NSwag is a Swagger 2.0 API toolchain for .NET, TypeScript and other platforms, written in C#. The [Swagger specification](http://swagger.io) uses JSON and JSON Schema to describe a RESTful web API. The project provides tools to automatically generate client code from these Swagger specifications and integrate this generation into existing processes.
88

9+
The NSwag project heavily uses [NJsonSchema for .NET](http://njsonschema.org) for JSON Schema handling and C#/TypeScript class/interface generation.
10+
911
**Ways to use the toolchain:**
1012

1113
- Simple to use Windows GUI, [NSwagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio)
@@ -43,8 +45,6 @@ NSwag is a Swagger 2.0 API toolchain for .NET, TypeScript and other platforms, w
4345
- [Download latest **NSwag command line tools** and NSwagStudio as ZIP archive](http://rsuter.com/Projects/NSwagStudio/archive.php)
4446
- [Download latest **Build Artifacts** from AppVeyor](https://ci.appveyor.com/project/rsuter/nswag/build/artifacts) (command line tools and NSwagStudio binaries)
4547

46-
This project uses [NJsonSchema for .NET](http://njsonschema.org) for JSON Schema, C# and TypeScript class/interface generation.
47-
4848
### Usage in C#
4949

5050
The following code shows how to read a Swagger specification and generate C# client classes to call the described web services:

src/NSwag.Annotations/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
[assembly: AssemblyCompany("Rico Suter")]
66
[assembly: AssemblyProduct("NSwag.Annotations")]
77
[assembly: AssemblyCopyright("Copyright © Rico Suter, 2015")]
8-
[assembly: AssemblyVersion("2.2.*")]
8+
[assembly: AssemblyVersion("2.4.*")]

src/NSwag.CodeGeneration.Tests/NSwag.CodeGeneration.Tests.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
4444
<Private>True</Private>
4545
</Reference>
46-
<Reference Include="NJsonSchema, Version=2.0.5928.2914, Culture=neutral, processorArchitecture=MSIL">
47-
<SpecificVersion>False</SpecificVersion>
48-
<HintPath>..\packages\NJsonSchema.2.0.5928.2914\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
46+
<Reference Include="NJsonSchema, Version=2.3.5940.24969, Culture=neutral, processorArchitecture=MSIL">
47+
<HintPath>..\packages\NJsonSchema.2.3.5940.24969\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
48+
<Private>True</Private>
4949
</Reference>
50-
<Reference Include="NJsonSchema.CodeGeneration, Version=2.0.5928.2915, Culture=neutral, processorArchitecture=MSIL">
51-
<SpecificVersion>False</SpecificVersion>
52-
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.0.5928.2915\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
50+
<Reference Include="NJsonSchema.CodeGeneration, Version=2.3.5940.24970, Culture=neutral, processorArchitecture=MSIL">
51+
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.3.5940.24970\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
52+
<Private>True</Private>
5353
</Reference>
5454
<Reference Include="System" />
5555
<Reference Include="System.ComponentModel.DataAnnotations" />

src/NSwag.CodeGeneration.Tests/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@
3131
//
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
34-
// [assembly: AssemblyVersion("2.2.*")]
34+
// [assembly: AssemblyVersion("2.4.*")]
3535
[assembly: AssemblyVersion("1.0.0.0")]
3636
[assembly: AssemblyFileVersion("1.0.0.0")]

src/NSwag.CodeGeneration.Tests/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
55
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
66
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
7-
<package id="NJsonSchema" version="2.0.5928.2914" targetFramework="net45" />
8-
<package id="NJsonSchema.CodeGeneration" version="2.0.5928.2915" targetFramework="net45" />
7+
<package id="NJsonSchema" version="2.3.5940.24969" targetFramework="net45" />
8+
<package id="NJsonSchema.CodeGeneration" version="2.3.5940.24970" targetFramework="net45" />
99
</packages>

src/NSwag.CodeGeneration/CodeGenerators/TypeScript/SwaggerToTypeScriptClientGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ internal override string RenderFile(string clientCode)
5959
{
6060
var template = LoadTemplate("File");
6161
template.Add("toolchain", SwaggerService.ToolchainVersion);
62-
template.Add("isAngular2", Settings.Template == TypeScriptTemplate.Angular2);
62+
template.Add("isAngular2", Settings.GenerateClientClasses && Settings.Template == TypeScriptTemplate.Angular2);
6363
template.Add("clients", Settings.GenerateClientClasses ? clientCode : string.Empty);
6464
template.Add("interfaces", Settings.GenerateDtoTypes ? _resolver.GenerateTypes() : string.Empty);
6565
template.Add("hasModuleName", !string.IsNullOrEmpty(Settings.ModuleName));

src/NSwag.CodeGeneration/NSwag.CodeGeneration.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
4242
<Private>True</Private>
4343
</Reference>
44-
<Reference Include="NJsonSchema, Version=2.0.5928.2914, Culture=neutral, processorArchitecture=MSIL">
45-
<SpecificVersion>False</SpecificVersion>
46-
<HintPath>..\packages\NJsonSchema.2.0.5928.2914\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
44+
<Reference Include="NJsonSchema, Version=2.3.5940.24969, Culture=neutral, processorArchitecture=MSIL">
45+
<HintPath>..\packages\NJsonSchema.2.3.5940.24969\lib\portable-net45+win+wpa81+wp80+MonoAndroid10+xamarinios10+MonoTouch10\NJsonSchema.dll</HintPath>
46+
<Private>True</Private>
4747
</Reference>
48-
<Reference Include="NJsonSchema.CodeGeneration, Version=2.0.5928.2915, Culture=neutral, processorArchitecture=MSIL">
49-
<SpecificVersion>False</SpecificVersion>
50-
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.0.5928.2915\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
48+
<Reference Include="NJsonSchema.CodeGeneration, Version=2.3.5940.24970, Culture=neutral, processorArchitecture=MSIL">
49+
<HintPath>..\packages\NJsonSchema.CodeGeneration.2.3.5940.24970\lib\net45\NJsonSchema.CodeGeneration.dll</HintPath>
50+
<Private>True</Private>
5151
</Reference>
5252
<Reference Include="System" />
5353
<Reference Include="System.Core" />

src/NSwag.CodeGeneration/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
[assembly: AssemblyCompany("Rico Suter")]
66
[assembly: AssemblyProduct("NSwag.CodeGeneration")]
77
[assembly: AssemblyCopyright("Copyright © Rico Suter, 2015")]
8-
[assembly: AssemblyVersion("2.2.*")]
8+
[assembly: AssemblyVersion("2.4.*")]

src/NSwag.CodeGeneration/SwaggerGenerators/WebApi/WebApiToSwaggerGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ private JsonSchema4 CreateAndAddSchema(SwaggerService service, Type type, IEnume
480480

481481
var schemaDefinitionAppender = new SwaggerServiceSchemaDefinitionAppender(service);
482482
var typeDescription = JsonObjectTypeDescription.FromType(type, parentAttributes, Settings.DefaultEnumHandling);
483-
if (typeDescription.Type.HasFlag(JsonObjectType.Object))
483+
if (typeDescription.Type.HasFlag(JsonObjectType.Object) && !typeDescription.IsDictionary)
484484
{
485485
if (type == typeof(object))
486486
{

src/NSwag.CodeGeneration/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<packages>
33
<package id="Antlr4.StringTemplate" version="4.0.6.9004" targetFramework="net45" />
44
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net45" />
5-
<package id="NJsonSchema" version="2.0.5928.2914" targetFramework="net45" />
6-
<package id="NJsonSchema.CodeGeneration" version="2.0.5928.2915" targetFramework="net45" />
5+
<package id="NJsonSchema" version="2.3.5940.24969" targetFramework="net45" />
6+
<package id="NJsonSchema.CodeGeneration" version="2.3.5940.24970" targetFramework="net45" />
77
</packages>

0 commit comments

Comments
 (0)