remove not needed peer dependencies and add any type too additional properties if also other properties defined.

This commit is contained in:
Kristof Vrolijkx 2016-05-16 17:51:00 +02:00
parent aa8b253e38
commit 68d47be9fd
4 changed files with 18 additions and 11 deletions

View File

@ -9,7 +9,7 @@ import * as models from './models';
*/ */
{{/description}} {{/description}}
export interface {{classname}} {{#parent}}extends models.{{{parent}}} {{/parent}}{ export interface {{classname}} {{#parent}}extends models.{{{parent}}} {{/parent}}{
{{#additionalPropertiesType}}[key: string]: {{{additionalPropertiesType}}}{{/additionalPropertiesType}} {{#additionalPropertiesType}}[key: string]: {{{additionalPropertiesType}}}{{#hasVars}} | any{{/hasVars}};{{/additionalPropertiesType}}
{{#vars}} {{#vars}}
{{#description}} {{#description}}

View File

@ -1,7 +1,8 @@
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from 'angular2/http'; import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
import {Injectable} from 'angular2/core'; import {Injectable, Optional} from '@angular/core';
import {Observable} from 'rxjs/Observable'; import {Observable} from 'rxjs/Observable';
import * as models from '../model/models'; import * as models from '../model/models';
import 'rxjs/Rx';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -12,7 +13,7 @@ export class UserApi {
protected basePath = 'http://additional-properties.swagger.io/v2'; protected basePath = 'http://additional-properties.swagger.io/v2';
public defaultHeaders : Headers = new Headers(); public defaultHeaders : Headers = new Headers();
constructor(protected http: Http, basePath: string) { constructor(protected http: Http, @Optional() basePath: string) {
if (basePath) { if (basePath) {
this.basePath = basePath; this.basePath = basePath;
} }

View File

@ -2,7 +2,7 @@
import * as models from './models'; import * as models from './models';
export interface User { export interface User {
[key: string]: string [key: string]: string | any;
id?: number; id?: number;

View File

@ -16,15 +16,21 @@
"build": "typings install && tsc" "build": "typings install && tsc"
}, },
"peerDependencies": { "peerDependencies": {
"angular2": "^2.0.0-beta.15", "@angular/core": "^2.0.0-rc.1",
"rxjs": "^5.0.0-beta.2" "@angular/http": "^2.0.0-rc.1"
}, },
"devDependencies": { "devDependencies": {
"@angular/common": "^2.0.0-rc.1",
"@angular/compiler": "^2.0.0-rc.1",
"@angular/core": "^2.0.0-rc.1",
"@angular/http": "^2.0.0-rc.1",
"@angular/platform-browser": "^2.0.0-rc.1",
"@angular/platform-browser-dynamic": "^2.0.0-rc.1",
"core-js": "^2.3.0",
"rxjs": "^5.0.0-beta.6",
"zone.js": "^0.6.12",
"typescript": "^1.8.10", "typescript": "^1.8.10",
"typings": "^0.8.1", "typings": "^0.8.1",
"angular2": "^2.0.0-beta.15",
"es6-shim": "^0.35.0", "es6-shim": "^0.35.0",
"es7-reflect-metadata": "^1.6.0", "es7-reflect-metadata": "^1.6.0"
"rxjs": "5.0.0-beta.2",
"zone.js": "^0.6.10"
}} }}