Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ export class {{classname}} {
// authentication ({{name}}) required
{{#isApiKey}}
{{#isKeyInHeader}}
if (this.configuration.apiKeys["{{keyParamName}}"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["{{keyParamName}}"]) {
{{#useHttpClient}}headers = {{/useHttpClient}}headers.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]);
}

{{/isKeyInHeader}}
{{#isKeyInQuery}}
if (this.configuration.apiKeys["{{keyParamName}}"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["{{keyParamName}}"]) {
{{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.12-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export class PetService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class StoreService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.12-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export class PetService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class StoreService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.12-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export class PetService implements PetServiceInterface {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class StoreService implements StoreServiceInterface {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.12-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export class PetService {
let headers = this.defaultHeaders;

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers = headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class StoreService {
let headers = this.defaultHeaders;

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers = headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.12-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export class PetService implements PetServiceInterface {
let headers = this.defaultHeaders;

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers = headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class StoreService implements StoreServiceInterface {
let headers = this.defaultHeaders;

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers = headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.12-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export class PetService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class StoreService {
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.12-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class PetService {
public addPet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public addPet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling addPet.');
}
Expand Down Expand Up @@ -125,10 +126,12 @@ export class PetService {
public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
}


let headers = this.defaultHeaders;
if (apiKey !== undefined && apiKey !== null) {
headers = headers.set('api_key', String(apiKey));
Expand Down Expand Up @@ -177,6 +180,7 @@ export class PetService {
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<Pet>>>;
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<Pet>>>;
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (status === null || status === undefined) {
throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
}
Expand Down Expand Up @@ -232,6 +236,7 @@ export class PetService {
public findPetsByTags(tags: Array<string>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<Pet>>>;
public findPetsByTags(tags: Array<string>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<Pet>>>;
public findPetsByTags(tags: Array<string>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (tags === null || tags === undefined) {
throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
}
Expand Down Expand Up @@ -287,14 +292,15 @@ export class PetService {
public getPetById(petId: number, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Pet>>;
public getPetById(petId: number, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Pet>>;
public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling getPetById.');
}

let headers = this.defaultHeaders;

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers = headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down Expand Up @@ -333,6 +339,7 @@ export class PetService {
public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling updatePet.');
}
Expand Down Expand Up @@ -391,10 +398,13 @@ export class PetService {
public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
}



let headers = this.defaultHeaders;

// authentication (petstore_auth) required
Expand Down Expand Up @@ -462,10 +472,13 @@ export class PetService {
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<ApiResponse>>;
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<ApiResponse>>;
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (petId === null || petId === undefined) {
throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
}



let headers = this.defaultHeaders;

// authentication (petstore_auth) required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class StoreService {
public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (orderId === null || orderId === undefined) {
throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
}
Expand Down Expand Up @@ -111,7 +112,7 @@ export class StoreService {
let headers = this.defaultHeaders;

// authentication (api_key) required
if (this.configuration.apiKeys["api_key"]) {
if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) {
headers = headers.set('api_key', this.configuration.apiKeys["api_key"]);
}

Expand Down Expand Up @@ -149,6 +150,7 @@ export class StoreService {
public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Order>>;
public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Order>>;
public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (orderId === null || orderId === undefined) {
throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
}
Expand Down Expand Up @@ -190,6 +192,7 @@ export class StoreService {
public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Order>>;
public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Order>>;
public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling placeOrder.');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export class UserService {
public createUser(body: User, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public createUser(body: User, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public createUser(body: User, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling createUser.');
}
Expand Down Expand Up @@ -113,6 +114,7 @@ export class UserService {
public createUsersWithArrayInput(body: Array<User>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public createUsersWithArrayInput(body: Array<User>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public createUsersWithArrayInput(body: Array<User>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
}
Expand Down Expand Up @@ -159,6 +161,7 @@ export class UserService {
public createUsersWithListInput(body: Array<User>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public createUsersWithListInput(body: Array<User>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public createUsersWithListInput(body: Array<User>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.');
}
Expand Down Expand Up @@ -205,6 +208,7 @@ export class UserService {
public deleteUser(username: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public deleteUser(username: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling deleteUser.');
}
Expand Down Expand Up @@ -246,6 +250,7 @@ export class UserService {
public getUserByName(username: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<User>>;
public getUserByName(username: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<User>>;
public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling getUserByName.');
}
Expand Down Expand Up @@ -288,9 +293,11 @@ export class UserService {
public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<string>>;
public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<string>>;
public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling loginUser.');
}

if (password === null || password === undefined) {
throw new Error('Required parameter password was null or undefined when calling loginUser.');
}
Expand Down Expand Up @@ -379,9 +386,11 @@ export class UserService {
public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {

if (username === null || username === undefined) {
throw new Error('Required parameter username was null or undefined when calling updateUser.');
}

if (body === null || body === undefined) {
throw new Error('Required parameter body was null or undefined when calling updateUser.');
}
Expand Down
24 changes: 24 additions & 0 deletions samples/client/petstore/typescript-angular-v5/npm/model/amount.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: [email protected]
*
* 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.
*/
import { Currency } from './currency';


/**
* some description
*/
export interface Amount {
/**
* some description
*/
value: number;
currency: Currency;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Swagger Petstore
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
*
* OpenAPI spec version: 1.0.0
* Contact: [email protected]
*
* 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.
*/


/**
* some description
*/
export type Currency = string;
Loading