Issue 4531 (#4539)

* ISSUE-4531
Arrays are now serialized according to the different collection formats. All api classes are also exported in a const array to make handling of large api libraries easier.

* Added petstore samples

* Fixed indentations and coding style
This commit is contained in:
Richard Naeve 2017-01-13 16:41:54 +01:00 committed by wing328
parent d40f7a41b6
commit 2e7e25801d
15 changed files with 194 additions and 328 deletions

View File

@ -8,7 +8,7 @@ import { Observable } from 'rxjs/Observab
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import * as models from '../model/models'; import * as models from '../model/models';
import { BASE_PATH } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration'; import { Configuration } from '../configuration';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -93,15 +93,36 @@ export class {{classname}} {
{{/required}} {{/required}}
{{/allParams}} {{/allParams}}
{{#queryParams}} {{#queryParams}}
{{#isListContainer}}
if ({{paramName}}) {
{{#isCollectionFormatMulti}}
{{paramName}}.forEach((element) => {
queryParameters.append('{{baseName}}', <any>element);
})
{{/isCollectionFormatMulti}}
{{^isCollectionFormatMulti}}
queryParameters.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']));
{{/isCollectionFormatMulti}}
}
{{/isListContainer}}
{{^isListContainer}}
if ({{paramName}} !== undefined) { if ({{paramName}} !== undefined) {
queryParameters.set('{{baseName}}', <any>{{paramName}}); queryParameters.set('{{baseName}}', <any>{{paramName}});
} }
{{/isListContainer}}
{{/queryParams}} {{/queryParams}}
{{#headerParams}} {{#headerParams}}
{{#isListContainer}}
if ({{paramName}}) {
headers.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']));
}
{{/isListContainer}}
{{^isListContainer}}
headers.set('{{baseName}}', String({{paramName}})); headers.set('{{baseName}}', String({{paramName}}));
{{/headerParams}} {{/isListContainer}}
{{/headerParams}}
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
{{#consumes}} {{#consumes}}
@ -120,51 +141,64 @@ export class {{classname}} {
// authentication ({{name}}) required // authentication ({{name}}) required
{{#isApiKey}} {{#isApiKey}}
{{#isKeyInHeader}} {{#isKeyInHeader}}
if (this.configuration.apiKey) if (this.configuration.apiKey) {
{
headers.set('{{keyParamName}}', this.configuration.apiKey); headers.set('{{keyParamName}}', this.configuration.apiKey);
} }
{{/isKeyInHeader}} {{/isKeyInHeader}}
{{#isKeyInQuery}} {{#isKeyInQuery}}
if (this.configuration.apiKey) if (this.configuration.apiKey) {
{
formParams.set('{{keyParamName}}', this.configuration.apiKey); formParams.set('{{keyParamName}}', this.configuration.apiKey);
} }
{{/isKeyInQuery}} {{/isKeyInQuery}}
{{/isApiKey}} {{/isApiKey}}
{{#isBasic}} {{#isBasic}}
// http basic authentication required // http basic authentication required
if (this.configuration.username || this.configuration.password) if (this.configuration.username || this.configuration.password) {
{
headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password)); headers.set('Authorization', 'Basic ' + btoa(this.configuration.username + ':' + this.configuration.password));
} }
{{/isBasic}} {{/isBasic}}
{{#isOAuth}} {{#isOAuth}}
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
{{/isOAuth}} {{/isOAuth}}
{{/authMethods}} {{/authMethods}}
{{#hasFormParams}} {{#hasFormParams}}
headers.set('Content-Type', 'application/x-www-form-urlencoded'); headers.set('Content-Type', 'application/x-www-form-urlencoded');
{{/hasFormParams}}
{{/hasFormParams}}
{{#bodyParam}} {{#bodyParam}}
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
{{/bodyParam}}
{{/bodyParam}}
{{#formParams}} {{#formParams}}
{{#isListContainer}}
if ({{paramName}}) {
{{#isCollectionFormatMulti}}
{{paramName}}.forEach((element) => {
formParams.append('{{baseName}}', <any>element);
})
{{/isCollectionFormatMulti}}
{{^isCollectionFormatMulti}}
formParams.set('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']));
{{/isCollectionFormatMulti}}
}
{{/isListContainer}}
{{^isListContainer}}
if ({{paramName}} !== undefined) { if ({{paramName}} !== undefined) {
formParams.set('{{baseName}}', <any>{{paramName}}); formParams.set('{{baseName}}', <any>{{paramName}});
} }
{{/formParams}} {{/isListContainer}}
{{/formParams}}
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: {{httpMethod}}, method: {{httpMethod}},
headers: headers, headers: headers,

View File

@ -2,6 +2,8 @@
{{#apis}} {{#apis}}
{{#operations}} {{#operations}}
export * from './{{ classname }}'; export * from './{{ classname }}';
import { {{ classname }} } from './{{ classname }}';
{{/operations}} {{/operations}}
{{/apis}} {{/apis}}
export const APIS = [ {{#apis}}{{#operations}}{{ classname }}, {{/operations}}{{/apis}}];
{{/apiInfo}} {{/apiInfo}}

View File

@ -1,3 +1,9 @@
import { OpaqueToken } from '@angular/core'; import { OpaqueToken } from '@angular/core';
export const BASE_PATH = new OpaqueToken('basePath'); export const BASE_PATH = new OpaqueToken('basePath');
export const COLLECTION_FORMATS = {
'csv': ',',
'tsv': ' ',
'ssv': ' ',
'pipes': '|'
}

View File

@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observab
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import * as models from '../model/models'; import * as models from '../model/models';
import { BASE_PATH } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration'; import { Configuration } from '../configuration';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -199,8 +199,6 @@ export class PetApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
'application/json', 'application/json',
@ -215,18 +213,15 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,
@ -257,7 +252,6 @@ export class PetApi {
if (petId === null || petId === undefined) { if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling deletePet.'); throw new Error('Required parameter petId was null or undefined when calling deletePet.');
} }
headers.set('api_key', String(apiKey)); headers.set('api_key', String(apiKey));
// to determine the Content-Type header // to determine the Content-Type header
@ -272,17 +266,13 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete, method: RequestMethod.Delete,
headers: headers, headers: headers,
@ -307,11 +297,12 @@ export class PetApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
if (status !== undefined) { if (status) {
queryParameters.set('status', <any>status); status.forEach((element) => {
queryParameters.append('status', <any>element);
})
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -324,17 +315,13 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -359,11 +346,12 @@ export class PetApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
if (tags !== undefined) { if (tags) {
queryParameters.set('tags', <any>tags); tags.forEach((element) => {
queryParameters.append('tags', <any>element);
})
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -376,17 +364,13 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -415,8 +399,6 @@ export class PetApi {
if (petId === null || petId === undefined) { if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling getPetById.'); throw new Error('Required parameter petId was null or undefined when calling getPetById.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -427,23 +409,19 @@ export class PetApi {
'application/xml' 'application/xml'
]; ];
// authentication (api_key) required
if (this.configuration.apiKey) {
headers.set('api_key', this.configuration.apiKey);
}
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
// authentication (api_key) required
if (this.configuration.apiKey)
{
headers.set('api_key', this.configuration.apiKey);
}
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
@ -469,8 +447,6 @@ export class PetApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
'application/json', 'application/json',
@ -485,18 +461,15 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Put, method: RequestMethod.Put,
headers: headers, headers: headers,
@ -530,8 +503,6 @@ export class PetApi {
if (petId === null || petId === undefined) { if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
'application/x-www-form-urlencoded' 'application/x-www-form-urlencoded'
@ -545,8 +516,7 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
@ -555,10 +525,10 @@ export class PetApi {
headers.set('Content-Type', 'application/x-www-form-urlencoded'); headers.set('Content-Type', 'application/x-www-form-urlencoded');
if (name !== undefined) { if (name !== undefined) {
formParams.set('name', <any>name); formParams.set('name', <any>name);
} }
if (status !== undefined) { if (status !== undefined) {
formParams.set('status', <any>status); formParams.set('status', <any>status);
} }
@ -596,8 +566,6 @@ export class PetApi {
if (petId === null || petId === undefined) { if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
'multipart/form-data' 'multipart/form-data'
@ -611,8 +579,7 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
@ -621,10 +588,10 @@ export class PetApi {
headers.set('Content-Type', 'application/x-www-form-urlencoded'); headers.set('Content-Type', 'application/x-www-form-urlencoded');
if (additionalMetadata !== undefined) { if (additionalMetadata !== undefined) {
formParams.set('additionalMetadata', <any>additionalMetadata); formParams.set('additionalMetadata', <any>additionalMetadata);
} }
if (file !== undefined) { if (file !== undefined) {
formParams.set('file', <any>file); formParams.set('file', <any>file);
} }

View File

@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observab
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import * as models from '../model/models'; import * as models from '../model/models';
import { BASE_PATH } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration'; import { Configuration } from '../configuration';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -133,8 +133,6 @@ export class StoreApi {
if (orderId === null || orderId === undefined) { if (orderId === null || orderId === undefined) {
throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -145,10 +143,6 @@ export class StoreApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete, method: RequestMethod.Delete,
headers: headers, headers: headers,
@ -172,8 +166,6 @@ export class StoreApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -185,14 +177,10 @@ export class StoreApi {
]; ];
// authentication (api_key) required // authentication (api_key) required
if (this.configuration.apiKey) if (this.configuration.apiKey) {
{
headers.set('api_key', this.configuration.apiKey); headers.set('api_key', this.configuration.apiKey);
} }
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -221,8 +209,6 @@ export class StoreApi {
if (orderId === null || orderId === undefined) { if (orderId === null || orderId === undefined) {
throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -233,10 +219,6 @@ export class StoreApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -261,8 +243,6 @@ export class StoreApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -273,11 +253,8 @@ export class StoreApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,

View File

@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observab
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import * as models from '../model/models'; import * as models from '../model/models';
import { BASE_PATH } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration'; import { Configuration } from '../configuration';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -195,8 +195,6 @@ export class UserApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -207,11 +205,8 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,
@ -237,8 +232,6 @@ export class UserApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -249,11 +242,8 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,
@ -279,8 +269,6 @@ export class UserApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -291,11 +279,8 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,
@ -325,8 +310,6 @@ export class UserApi {
if (username === null || username === undefined) { if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling deleteUser.'); throw new Error('Required parameter username was null or undefined when calling deleteUser.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -337,10 +320,6 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete, method: RequestMethod.Delete,
headers: headers, headers: headers,
@ -369,8 +348,6 @@ export class UserApi {
if (username === null || username === undefined) { if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling getUserByName.'); throw new Error('Required parameter username was null or undefined when calling getUserByName.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -381,10 +358,6 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -413,11 +386,11 @@ export class UserApi {
if (username !== undefined) { if (username !== undefined) {
queryParameters.set('username', <any>username); queryParameters.set('username', <any>username);
} }
if (password !== undefined) { if (password !== undefined) {
queryParameters.set('password', <any>password); queryParameters.set('password', <any>password);
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -428,10 +401,6 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -455,8 +424,6 @@ export class UserApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -467,10 +434,6 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -500,8 +463,6 @@ export class UserApi {
if (username === null || username === undefined) { if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling updateUser.'); throw new Error('Required parameter username was null or undefined when calling updateUser.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -512,11 +473,8 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Put, method: RequestMethod.Put,
headers: headers, headers: headers,

View File

@ -1,3 +1,7 @@
export * from './PetApi'; export * from './PetApi';
import { PetApi } from './PetApi';
export * from './StoreApi'; export * from './StoreApi';
import { StoreApi } from './StoreApi';
export * from './UserApi'; export * from './UserApi';
import { UserApi } from './UserApi';
export const APIS = [ PetApi, StoreApi, UserApi, ];

View File

@ -1,3 +1,9 @@
import { OpaqueToken } from '@angular/core'; import { OpaqueToken } from '@angular/core';
export const BASE_PATH = new OpaqueToken('basePath'); export const BASE_PATH = new OpaqueToken('basePath');
export const COLLECTION_FORMATS = {
'csv': ',',
'tsv': ' ',
'ssv': ' ',
'pipes': '|'
}

View File

@ -1,4 +1,4 @@
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201612150011 ## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201701111439
### Building ### Building
@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's.
_published:_ _published:_
``` ```
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201612150011 --save npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201701111439 --save
``` ```
_unPublished (not recommended):_ _unPublished (not recommended):_

View File

@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observab
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import * as models from '../model/models'; import * as models from '../model/models';
import { BASE_PATH } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration'; import { Configuration } from '../configuration';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -199,8 +199,6 @@ export class PetApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
'application/json', 'application/json',
@ -215,18 +213,15 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,
@ -257,7 +252,6 @@ export class PetApi {
if (petId === null || petId === undefined) { if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling deletePet.'); throw new Error('Required parameter petId was null or undefined when calling deletePet.');
} }
headers.set('api_key', String(apiKey)); headers.set('api_key', String(apiKey));
// to determine the Content-Type header // to determine the Content-Type header
@ -272,17 +266,13 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete, method: RequestMethod.Delete,
headers: headers, headers: headers,
@ -307,11 +297,12 @@ export class PetApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
if (status !== undefined) { if (status) {
queryParameters.set('status', <any>status); status.forEach((element) => {
queryParameters.append('status', <any>element);
})
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -324,17 +315,13 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -359,11 +346,12 @@ export class PetApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
if (tags !== undefined) { if (tags) {
queryParameters.set('tags', <any>tags); tags.forEach((element) => {
queryParameters.append('tags', <any>element);
})
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -376,17 +364,13 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -415,8 +399,6 @@ export class PetApi {
if (petId === null || petId === undefined) { if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling getPetById.'); throw new Error('Required parameter petId was null or undefined when calling getPetById.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -427,23 +409,19 @@ export class PetApi {
'application/xml' 'application/xml'
]; ];
// authentication (api_key) required
if (this.configuration.apiKey) {
headers.set('api_key', this.configuration.apiKey);
}
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
// authentication (api_key) required
if (this.configuration.apiKey)
{
headers.set('api_key', this.configuration.apiKey);
}
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
@ -469,8 +447,6 @@ export class PetApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
'application/json', 'application/json',
@ -485,18 +461,15 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
headers.set('Authorization', 'Bearer ' + accessToken); headers.set('Authorization', 'Bearer ' + accessToken);
} }
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Put, method: RequestMethod.Put,
headers: headers, headers: headers,
@ -530,8 +503,6 @@ export class PetApi {
if (petId === null || petId === undefined) { if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
'application/x-www-form-urlencoded' 'application/x-www-form-urlencoded'
@ -545,8 +516,7 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
@ -555,10 +525,10 @@ export class PetApi {
headers.set('Content-Type', 'application/x-www-form-urlencoded'); headers.set('Content-Type', 'application/x-www-form-urlencoded');
if (name !== undefined) { if (name !== undefined) {
formParams.set('name', <any>name); formParams.set('name', <any>name);
} }
if (status !== undefined) { if (status !== undefined) {
formParams.set('status', <any>status); formParams.set('status', <any>status);
} }
@ -596,8 +566,6 @@ export class PetApi {
if (petId === null || petId === undefined) { if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
'multipart/form-data' 'multipart/form-data'
@ -611,8 +579,7 @@ export class PetApi {
// authentication (petstore_auth) required // authentication (petstore_auth) required
// oauth required // oauth required
if (this.configuration.accessToken) if (this.configuration.accessToken) {
{
let accessToken = typeof this.configuration.accessToken === 'function' let accessToken = typeof this.configuration.accessToken === 'function'
? this.configuration.accessToken() ? this.configuration.accessToken()
: this.configuration.accessToken; : this.configuration.accessToken;
@ -621,10 +588,10 @@ export class PetApi {
headers.set('Content-Type', 'application/x-www-form-urlencoded'); headers.set('Content-Type', 'application/x-www-form-urlencoded');
if (additionalMetadata !== undefined) { if (additionalMetadata !== undefined) {
formParams.set('additionalMetadata', <any>additionalMetadata); formParams.set('additionalMetadata', <any>additionalMetadata);
} }
if (file !== undefined) { if (file !== undefined) {
formParams.set('file', <any>file); formParams.set('file', <any>file);
} }

View File

@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observab
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import * as models from '../model/models'; import * as models from '../model/models';
import { BASE_PATH } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration'; import { Configuration } from '../configuration';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -133,8 +133,6 @@ export class StoreApi {
if (orderId === null || orderId === undefined) { if (orderId === null || orderId === undefined) {
throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -145,10 +143,6 @@ export class StoreApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete, method: RequestMethod.Delete,
headers: headers, headers: headers,
@ -172,8 +166,6 @@ export class StoreApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -185,14 +177,10 @@ export class StoreApi {
]; ];
// authentication (api_key) required // authentication (api_key) required
if (this.configuration.apiKey) if (this.configuration.apiKey) {
{
headers.set('api_key', this.configuration.apiKey); headers.set('api_key', this.configuration.apiKey);
} }
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -221,8 +209,6 @@ export class StoreApi {
if (orderId === null || orderId === undefined) { if (orderId === null || orderId === undefined) {
throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -233,10 +219,6 @@ export class StoreApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -261,8 +243,6 @@ export class StoreApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -273,11 +253,8 @@ export class StoreApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,

View File

@ -19,7 +19,7 @@ import { Observable } from 'rxjs/Observab
import 'rxjs/add/operator/map'; import 'rxjs/add/operator/map';
import * as models from '../model/models'; import * as models from '../model/models';
import { BASE_PATH } from '../variables'; import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration'; import { Configuration } from '../configuration';
/* tslint:disable:no-unused-variable member-ordering */ /* tslint:disable:no-unused-variable member-ordering */
@ -195,8 +195,6 @@ export class UserApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -207,11 +205,8 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,
@ -237,8 +232,6 @@ export class UserApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -249,11 +242,8 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,
@ -279,8 +269,6 @@ export class UserApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -291,11 +279,8 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Post, method: RequestMethod.Post,
headers: headers, headers: headers,
@ -325,8 +310,6 @@ export class UserApi {
if (username === null || username === undefined) { if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling deleteUser.'); throw new Error('Required parameter username was null or undefined when calling deleteUser.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -337,10 +320,6 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Delete, method: RequestMethod.Delete,
headers: headers, headers: headers,
@ -369,8 +348,6 @@ export class UserApi {
if (username === null || username === undefined) { if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling getUserByName.'); throw new Error('Required parameter username was null or undefined when calling getUserByName.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -381,10 +358,6 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -413,11 +386,11 @@ export class UserApi {
if (username !== undefined) { if (username !== undefined) {
queryParameters.set('username', <any>username); queryParameters.set('username', <any>username);
} }
if (password !== undefined) { if (password !== undefined) {
queryParameters.set('password', <any>password); queryParameters.set('password', <any>password);
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -428,10 +401,6 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -455,8 +424,6 @@ export class UserApi {
let queryParameters = new URLSearchParams(); let queryParameters = new URLSearchParams();
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -467,10 +434,6 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Get, method: RequestMethod.Get,
headers: headers, headers: headers,
@ -500,8 +463,6 @@ export class UserApi {
if (username === null || username === undefined) { if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling updateUser.'); throw new Error('Required parameter username was null or undefined when calling updateUser.');
} }
// to determine the Content-Type header // to determine the Content-Type header
let consumes: string[] = [ let consumes: string[] = [
]; ];
@ -512,11 +473,8 @@ export class UserApi {
'application/xml' 'application/xml'
]; ];
headers.set('Content-Type', 'application/json'); headers.set('Content-Type', 'application/json');
let requestOptions: RequestOptionsArgs = new RequestOptions({ let requestOptions: RequestOptionsArgs = new RequestOptions({
method: RequestMethod.Put, method: RequestMethod.Put,
headers: headers, headers: headers,

View File

@ -1,3 +1,7 @@
export * from './PetApi'; export * from './PetApi';
import { PetApi } from './PetApi';
export * from './StoreApi'; export * from './StoreApi';
import { StoreApi } from './StoreApi';
export * from './UserApi'; export * from './UserApi';
import { UserApi } from './UserApi';
export const APIS = [ PetApi, StoreApi, UserApi, ];

View File

@ -1,6 +1,6 @@
{ {
"name": "@swagger/angular2-typescript-petstore", "name": "@swagger/angular2-typescript-petstore",
"version": "0.0.1-SNAPSHOT.201612150011", "version": "0.0.1-SNAPSHOT.201701111439",
"description": "swagger client for @swagger/angular2-typescript-petstore", "description": "swagger client for @swagger/angular2-typescript-petstore",
"author": "Swagger Codegen Contributors", "author": "Swagger Codegen Contributors",
"keywords": [ "keywords": [

View File

@ -1,3 +1,9 @@
import { OpaqueToken } from '@angular/core'; import { OpaqueToken } from '@angular/core';
export const BASE_PATH = new OpaqueToken('basePath'); export const BASE_PATH = new OpaqueToken('basePath');
export const COLLECTION_FORMATS = {
'csv': ',',
'tsv': ' ',
'ssv': ' ',
'pipes': '|'
}