Skip to content

Commit

Permalink
Merge pull request #52 from NSwag/master
Browse files Browse the repository at this point in the history
Release v2.1
  • Loading branch information
RicoSuter committed Mar 25, 2016
2 parents b736696 + 0443cf5 commit 916868b
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 17 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.0.*")]
[assembly: AssemblyVersion("2.1.*")]
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.0.*")]
// [assembly: AssemblyVersion("2.1.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ internal override string RenderFile(string clientCode)
{
var template = LoadTemplate("File");
template.Add("toolchain", SwaggerService.ToolchainVersion);
template.Add("isAngular2", Settings.Template == TypeScriptTemplate.Angular2);
template.Add("clients", Settings.GenerateClientClasses ? clientCode : string.Empty);
template.Add("interfaces", Settings.GenerateDtoTypes ? _resolver.GenerateTypes() : string.Empty);
template.Add("hasModuleName", !string.IsNullOrEmpty(Settings.ModuleName));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import 'rxjs/Rx';
import {Observable} from 'rxjs/Observable';
import {Injectable, Inject} from 'angular2/core';
import {Http, Headers, Response} from 'angular2/http';

<if(hasOperations)>
<if(hasOperations)>
<if(generateClientInterfaces)>
export interface I<class> {
<operations:{operation |
Expand All @@ -22,9 +17,9 @@ export class <class> <if(generateClientInterfaces)>implements I<class> <endif>{
private http: Http = null;
baseUrl: string = undefined;

constructor(@Inject(Http) http: Http, baseUrl?: string) {
constructor(@Inject(Http) http: Http, @Optional() @Inject(API_BASE_URL) baseUrl?: string) {
this.http = http;
this.baseUrl = baseUrl !== undefined ? baseUrl : "<baseUrl>";
this.baseUrl = baseUrl ? baseUrl : "<baseUrl>";
}
<operations:{operation |

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
// Generated using the NSwag toolchain v<toolchain> (http://NSwag.org)
<if(isAngular2)>
import 'rxjs/Rx';
import {Observable} from 'rxjs/Observable';
import {Injectable, Inject} from 'angular2/core';
import {Http, Headers, Response} from 'angular2/http';

<endif>
// Generated using the NSwag toolchain v<toolchain> (http://NSwag.org)

<if(hasModuleName)>
module <moduleName> {
<endif>
<if(isAngular2)>
const API_BASE_URL = new OpaqueToken('API_BASE_URL');

<endif>
<clients>
<interfaces>
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.0.*")]
[assembly: AssemblyVersion("2.1.*")]
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.0.*")]
[assembly: AssemblyVersion("2.1.*")]
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.0.*")]
// [assembly: AssemblyVersion("2.1.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
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.0.*")]
// [assembly: AssemblyVersion("2.1.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
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.0.*")]
[assembly: AssemblyVersion("2.1.*")]
2 changes: 1 addition & 1 deletion src/NSwagStudio/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("NSwagStudio")]
[assembly: AssemblyCopyright("Copyright © Rico Suter, 2015")]
[assembly: AssemblyVersion("2.0.*")]
[assembly: AssemblyVersion("2.1.*")]

0 comments on commit 916868b

Please sign in to comment.