mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-06-29 12:10:54 +00:00
[TypeScript][Angular2] better code indentation, update Petstore sample (#4990)
* fix query parameter indentation, update ts angular2 sample * update ts angular2 sample
This commit is contained in:
parent
cffaaa027a
commit
bfb4390a1c
@ -93,17 +93,17 @@ export class {{classname}} {
|
||||
{{/isListContainer}}
|
||||
{{^isListContainer}}
|
||||
if ({{paramName}} !== undefined) {
|
||||
{{#isDateTime}}
|
||||
queryParameters.set('{{baseName}}', <any>{{paramName}}.toISOString());
|
||||
{{/isDateTime}}
|
||||
{{^isDateTime}}
|
||||
{{#isDate}}
|
||||
queryParameters.set('{{baseName}}', <any>{{paramName}}.toISOString());
|
||||
{{/isDate}}
|
||||
{{^isDate}}
|
||||
queryParameters.set('{{baseName}}', <any>{{paramName}});
|
||||
{{/isDate}}
|
||||
{{/isDateTime}}
|
||||
{{#isDateTime}}
|
||||
queryParameters.set('{{baseName}}', <any>{{paramName}}.toISOString());
|
||||
{{/isDateTime}}
|
||||
{{^isDateTime}}
|
||||
{{#isDate}}
|
||||
queryParameters.set('{{baseName}}', <any>{{paramName}}.toISOString());
|
||||
{{/isDate}}
|
||||
{{^isDate}}
|
||||
queryParameters.set('{{baseName}}', <any>{{paramName}});
|
||||
{{/isDate}}
|
||||
{{/isDateTime}}
|
||||
}
|
||||
{{/isListContainer}}
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
wwwroot/*.js
|
||||
node_modules
|
||||
typings
|
||||
dist
|
||||
|
@ -8,18 +8,6 @@
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
@ -31,7 +19,7 @@ import { Observable } from 'rxjs/Observab
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import * as models from '../model/models';
|
||||
import { BASE_PATH } from '../variables';
|
||||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
||||
import { Configuration } from '../configuration';
|
||||
|
||||
/* tslint:disable:no-unused-variable member-ordering */
|
||||
@ -196,8 +184,6 @@ export class PetApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
'application/json',
|
||||
@ -209,26 +195,30 @@ export class PetApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
// oauth required
|
||||
if (this.configuration.accessToken)
|
||||
{
|
||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||
if (this.configuration.accessToken) {
|
||||
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
|
||||
headers.set('Content-Type', 'application/json');
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -248,7 +238,7 @@ export class PetApi {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
|
||||
}
|
||||
|
||||
headers.set('api_key', String(apiKey));
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
@ -259,24 +249,27 @@ export class PetApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
// oauth required
|
||||
if (this.configuration.accessToken)
|
||||
{
|
||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||
if (this.configuration.accessToken) {
|
||||
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Delete,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -290,11 +283,12 @@ export class PetApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
if (status !== undefined) {
|
||||
queryParameters.set('status', <any>status);
|
||||
if (status) {
|
||||
status.forEach((element) => {
|
||||
queryParameters.append('status', <any>element);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -304,24 +298,27 @@ export class PetApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
// oauth required
|
||||
if (this.configuration.accessToken)
|
||||
{
|
||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||
if (this.configuration.accessToken) {
|
||||
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -335,11 +332,12 @@ export class PetApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
if (tags !== undefined) {
|
||||
queryParameters.set('tags', <any>tags);
|
||||
if (tags) {
|
||||
tags.forEach((element) => {
|
||||
queryParameters.append('tags', <any>element);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -349,24 +347,27 @@ export class PetApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
// oauth required
|
||||
if (this.configuration.accessToken)
|
||||
{
|
||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||
if (this.configuration.accessToken) {
|
||||
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -385,8 +386,6 @@ export class PetApi {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling getPetById.');
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -396,29 +395,32 @@ export class PetApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
// oauth required
|
||||
if (this.configuration.accessToken)
|
||||
{
|
||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||
if (this.configuration.accessToken) {
|
||||
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKey)
|
||||
{
|
||||
if (this.configuration.apiKey) {
|
||||
headers.set('api_key', this.configuration.apiKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -432,8 +434,6 @@ export class PetApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
'application/json',
|
||||
@ -445,26 +445,30 @@ export class PetApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
// oauth required
|
||||
if (this.configuration.accessToken)
|
||||
{
|
||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||
if (this.configuration.accessToken) {
|
||||
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
|
||||
headers.set('Content-Type', 'application/json');
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Put,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -487,8 +491,6 @@ export class PetApi {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
'application/x-www-form-urlencoded'
|
||||
@ -499,32 +501,38 @@ export class PetApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
// oauth required
|
||||
if (this.configuration.accessToken)
|
||||
{
|
||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||
if (this.configuration.accessToken) {
|
||||
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
|
||||
headers.set('Content-Type', 'application/x-www-form-urlencoded');
|
||||
|
||||
|
||||
if (name !== undefined) {
|
||||
formParams.set('name', <any>name);
|
||||
formParams.set('name', <any>name);
|
||||
}
|
||||
|
||||
if (status !== undefined) {
|
||||
formParams.set('status', <any>status);
|
||||
formParams.set('status', <any>status);
|
||||
}
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: formParams.toString(),
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -547,8 +555,6 @@ export class PetApi {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
'multipart/form-data'
|
||||
@ -559,32 +565,38 @@ export class PetApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
// oauth required
|
||||
if (this.configuration.accessToken)
|
||||
{
|
||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||
if (this.configuration.accessToken) {
|
||||
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
|
||||
headers.set('Content-Type', 'application/x-www-form-urlencoded');
|
||||
|
||||
|
||||
if (additionalMetadata !== undefined) {
|
||||
formParams.set('additionalMetadata', <any>additionalMetadata);
|
||||
formParams.set('additionalMetadata', <any>additionalMetadata);
|
||||
}
|
||||
|
||||
if (file !== undefined) {
|
||||
formParams.set('file', <any>file);
|
||||
formParams.set('file', <any>file);
|
||||
}
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: formParams.toString(),
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
|
@ -8,18 +8,6 @@
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
@ -31,7 +19,7 @@ import { Observable } from 'rxjs/Observab
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import * as models from '../model/models';
|
||||
import { BASE_PATH } from '../variables';
|
||||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
||||
import { Configuration } from '../configuration';
|
||||
|
||||
/* tslint:disable:no-unused-variable member-ordering */
|
||||
@ -131,8 +119,6 @@ export class StoreApi {
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -142,18 +128,18 @@ export class StoreApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Delete,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -166,8 +152,6 @@ export class StoreApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -177,23 +161,23 @@ export class StoreApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
// authentication (api_key) required
|
||||
if (this.configuration.apiKey)
|
||||
{
|
||||
if (this.configuration.apiKey) {
|
||||
headers.set('api_key', this.configuration.apiKey);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -212,8 +196,6 @@ export class StoreApi {
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -223,18 +205,18 @@ export class StoreApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -248,8 +230,6 @@ export class StoreApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -259,20 +239,21 @@ export class StoreApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
headers.set('Content-Type', 'application/json');
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
|
@ -8,18 +8,6 @@
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Inject, Injectable, Optional } from '@angular/core';
|
||||
@ -31,7 +19,7 @@ import { Observable } from 'rxjs/Observab
|
||||
import 'rxjs/add/operator/map';
|
||||
|
||||
import * as models from '../model/models';
|
||||
import { BASE_PATH } from '../variables';
|
||||
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
|
||||
import { Configuration } from '../configuration';
|
||||
|
||||
/* tslint:disable:no-unused-variable member-ordering */
|
||||
@ -192,8 +180,6 @@ export class UserApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -203,20 +189,21 @@ export class UserApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
headers.set('Content-Type', 'application/json');
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -230,8 +217,6 @@ export class UserApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -241,20 +226,21 @@ export class UserApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
headers.set('Content-Type', 'application/json');
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -268,8 +254,6 @@ export class UserApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -279,20 +263,21 @@ export class UserApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
headers.set('Content-Type', 'application/json');
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -311,8 +296,6 @@ export class UserApi {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling deleteUser.');
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -322,18 +305,18 @@ export class UserApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Delete,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -352,8 +335,6 @@ export class UserApi {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling getUserByName.');
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -363,18 +344,18 @@ export class UserApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -390,12 +371,12 @@ export class UserApi {
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
if (username !== undefined) {
|
||||
queryParameters.set('username', <any>username);
|
||||
}
|
||||
if (password !== undefined) {
|
||||
queryParameters.set('password', <any>password);
|
||||
queryParameters.set('username', <any>username);
|
||||
}
|
||||
|
||||
if (password !== undefined) {
|
||||
queryParameters.set('password', <any>password);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
@ -406,18 +387,18 @@ export class UserApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -430,8 +411,6 @@ export class UserApi {
|
||||
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -441,18 +420,18 @@ export class UserApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
@ -472,8 +451,6 @@ export class UserApi {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
// to determine the Content-Type header
|
||||
let consumes: string[] = [
|
||||
];
|
||||
@ -483,20 +460,21 @@ export class UserApi {
|
||||
'application/json',
|
||||
'application/xml'
|
||||
];
|
||||
|
||||
|
||||
|
||||
headers.set('Content-Type', 'application/json');
|
||||
|
||||
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Put,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
responseType: ResponseContentType.Json
|
||||
search: queryParameters
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
}
|
||||
|
||||
return this.http.request(path, requestOptions);
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
export * from './PetApi';
|
||||
import { PetApi } from './PetApi';
|
||||
export * from './StoreApi';
|
||||
import { StoreApi } from './StoreApi';
|
||||
export * from './UserApi';
|
||||
import { UserApi } from './UserApi';
|
||||
export const APIS = [ PetApi, StoreApi, UserApi, ];
|
||||
|
@ -2,5 +2,5 @@ export class Configuration {
|
||||
apiKey: string;
|
||||
username: string;
|
||||
password: string;
|
||||
accessToken: string;
|
||||
accessToken: string | (() => string);
|
||||
}
|
@ -8,18 +8,6 @@
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as models from './models';
|
||||
|
@ -8,18 +8,6 @@
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as models from './models';
|
||||
|
@ -8,18 +8,6 @@
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as models from './models';
|
||||
|
@ -8,18 +8,6 @@
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as models from './models';
|
||||
|
@ -8,18 +8,6 @@
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import * as models from './models';
|
||||
|
@ -1,3 +1,9 @@
|
||||
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': '|'
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
wwwroot/*.js
|
||||
node_modules
|
||||
typings
|
||||
dist
|
||||
|
@ -1,4 +1,4 @@
|
||||
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702090204
|
||||
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201703092202
|
||||
|
||||
### Building
|
||||
|
||||
@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's.
|
||||
_published:_
|
||||
|
||||
```
|
||||
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201702090204 --save
|
||||
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201703092202 --save
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
|
@ -371,19 +371,11 @@ export class UserApi {
|
||||
let queryParameters = new URLSearchParams();
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
if (username !== undefined) {
|
||||
if(username instanceof Date) {
|
||||
queryParameters.set('username', <any>username.d.toISOString());
|
||||
} else {
|
||||
queryParameters.set('username', <any>username);
|
||||
}
|
||||
queryParameters.set('username', <any>username);
|
||||
}
|
||||
|
||||
if (password !== undefined) {
|
||||
if(password instanceof Date) {
|
||||
queryParameters.set('password', <any>password.d.toISOString());
|
||||
} else {
|
||||
queryParameters.set('password', <any>password);
|
||||
}
|
||||
queryParameters.set('password', <any>password);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@swagger/angular2-typescript-petstore",
|
||||
"version": "0.0.1-SNAPSHOT.201702090204",
|
||||
"version": "0.0.1-SNAPSHOT.201703092202",
|
||||
"description": "swagger client for @swagger/angular2-typescript-petstore",
|
||||
"author": "Swagger Codegen Contributors",
|
||||
"keywords": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user