#1809 Some small template changes.

This commit is contained in:
Kristof Vrolijkx 2016-04-19 11:56:29 +02:00
parent f4fc88c6be
commit c54bceffe3
9 changed files with 16 additions and 19 deletions

View File

@ -3,7 +3,7 @@
<parent>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-project</artifactId>
<version>2.1.6</version>
<version>2.1.7-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-project</artifactId>
<version>2.1.6</version>
<version>2.1.7-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>swagger-codegen-maven-plugin</artifactId>

View File

@ -3,7 +3,7 @@
<parent>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-project</artifactId>
<version>2.1.6</version>
<version>2.1.7-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -25,7 +25,7 @@ public class TypeScriptAngular2ClientCodegen extends AbstractTypeScriptClientCod
@Override
public String getName() {
return "TypeScript-Angular2";
return "typescript-angular2";
}
@Override

View File

@ -2,7 +2,6 @@ import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from 'angu
import {Injectable} from 'angular2/core';
import {Observable} from 'rxjs/Observable';
import * as model from "../model/model.d.ts"
import {AppSettings} from "../../AppSettings"
/* tslint:disable:no-unused-variable member-ordering */
@ -19,9 +18,9 @@ export class {{classname}} {
protected basePath = '{{basePath}}';
public defaultHeaders : Headers = new Headers();
constructor(protected http: Http, appSettigs: AppSettings) {
if (appSettigs && appSettigs.apiBaseUrl) {
this.basePath = appSettigs.apiBaseUrl;
constructor(protected http: Http, basePath: string) {
if (basePath) {
this.basePath = basePath;
}
}

View File

@ -1,11 +1,11 @@
{{#models}}
{{#model}}
export { {{{classname}}} } from './{{{ classname }}}';
export * from './{{{ classname }}}';
{{/model}}
{{/models}}
/*
{{#apiInfo}}
{{#apis}}
{{#operations}}
@ -13,5 +13,5 @@ export * from './{{classname}}';
{{/operations}}
{{/apis}}
{{/apiInfo}}
*/

View File

@ -17,21 +17,19 @@ export interface {{classname}} {{#parent}}extends model.{{{parent}}} {{/parent}}
*/
{{/description}}
{{name}}?: {{#isEnum}}{{classname}}.{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}};
{{name}}?: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{datatype}}}{{/isEnum}};
{{/vars}}
}
{{#hasEnums}}
export namespace {{classname}} {
{{#vars}}
{{#isEnum}}
export enum {{datatypeWithEnum}} { {{#allowableValues}}{{#values}}
{{.}} = <any> '{{.}}',{{/values}}{{/allowableValues}}
}
export enum {{datatypeWithEnum}} { {{#allowableValues}}{{#values}}
{{.}} = <any> '{{.}}',{{/values}}{{/allowableValues}}
}
{{/isEnum}}
{{/vars}}
}
{{/hasEnums}}
{{/model}}
{{/models}}

View File

@ -4,7 +4,7 @@
<parent>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-project</artifactId>
<version>2.1.6</version>
<version>2.1.7-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<artifactId>swagger-generator</artifactId>

View File

@ -10,7 +10,7 @@
<artifactId>swagger-codegen-project</artifactId>
<packaging>pom</packaging>
<name>swagger-codegen-project</name>
<version>2.1.6</version>
<version>2.1.7-SNAPSHOT</version>
<url>https://github.com/swagger-api/swagger-codegen</url>
<scm>
<connection>scm:git:git@github.com:swagger-api/swagger-codegen.git</connection>