forked from loafle/openapi-generator-original
Update TS Angular v4, v4.3 with Petstore OAS2 (#241)
* update ts angular 4 from codegen2x * update ts angular v4 with petstore oas2 * restore ts agnular 4.3 from codegen2x * update ts angular 4.3 with petstore oas2
This commit is contained in:
parent
5ef5e540fd
commit
6f4af337d9
@ -1 +1 @@
|
||||
2.4.0-SNAPSHOT
|
||||
3.0.0-SNAPSHOT
|
@ -2,7 +2,7 @@
|
||||
|
||||
### Building
|
||||
|
||||
To build an compile the typescript sources to javascript use:
|
||||
To install the required dependencies and to build the typescript sources run:
|
||||
```
|
||||
npm install
|
||||
npm run build
|
||||
@ -10,11 +10,11 @@ npm run build
|
||||
|
||||
### publishing
|
||||
|
||||
First build the package than run ```npm publish```
|
||||
First build the package than run ```npm publish dist``` (don't forget to specify the `dist` folder!)
|
||||
|
||||
### consuming
|
||||
|
||||
navigate to the folder of your consuming project and run one of next commando's.
|
||||
Navigate to the folder of your consuming project and run one of next commands.
|
||||
|
||||
_published:_
|
||||
|
||||
@ -22,24 +22,31 @@ _published:_
|
||||
npm install @swagger/angular2-typescript-petstore@0.0.1 --save
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
_without publishing (not recommended):_
|
||||
|
||||
```
|
||||
npm install PATH_TO_GENERATED_PACKAGE --save
|
||||
npm install PATH_TO_GENERATED_PACKAGE/dist --save
|
||||
```
|
||||
|
||||
_using `npm link`:_
|
||||
|
||||
In PATH_TO_GENERATED_PACKAGE:
|
||||
In PATH_TO_GENERATED_PACKAGE/dist:
|
||||
```
|
||||
npm link
|
||||
```
|
||||
|
||||
In your project:
|
||||
```
|
||||
npm link @swagger/angular2-typescript-petstore@0.0.1
|
||||
npm link @swagger/angular2-typescript-petstore
|
||||
```
|
||||
|
||||
__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
|
||||
Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.
|
||||
Published packages are not effected by this issue.
|
||||
|
||||
|
||||
#### General usage
|
||||
|
||||
In your Angular project:
|
||||
|
||||
|
||||
|
@ -60,16 +60,16 @@ export class PetService {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public addPet(body: Pet, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
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.');
|
||||
public addPet(pet: Pet, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public addPet(pet: Pet, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public addPet(pet: Pet, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public addPet(pet: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new Error('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
@ -84,8 +84,6 @@ export class PetService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -103,7 +101,7 @@ export class PetService {
|
||||
}
|
||||
|
||||
return this.httpClient.post<any>(`${this.basePath}/pet`,
|
||||
body,
|
||||
pet,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
@ -144,8 +142,6 @@ export class PetService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -325,16 +321,16 @@ export class PetService {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public updatePet(body: Pet, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
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.');
|
||||
public updatePet(pet: Pet, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public updatePet(pet: Pet, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public updatePet(pet: Pet, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public updatePet(pet: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new Error('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
@ -349,8 +345,6 @@ export class PetService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -368,7 +362,7 @@ export class PetService {
|
||||
}
|
||||
|
||||
return this.httpClient.put<any>(`${this.basePath}/pet`,
|
||||
body,
|
||||
pet,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
@ -407,8 +401,6 @@ export class PetService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
|
@ -75,8 +75,6 @@ export class StoreService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -182,16 +180,16 @@ export class StoreService {
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param order order placed for purchasing the pet
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public placeOrder(body: Order, observe?: 'body', reportProgress?: boolean): Observable<Order>;
|
||||
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.');
|
||||
public placeOrder(order: Order, observe?: 'body', reportProgress?: boolean): Observable<Order>;
|
||||
public placeOrder(order: Order, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Order>>;
|
||||
public placeOrder(order: Order, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Order>>;
|
||||
public placeOrder(order: Order, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
|
||||
if (order === null || order === undefined) {
|
||||
throw new Error('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
@ -215,7 +213,7 @@ export class StoreService {
|
||||
}
|
||||
|
||||
return this.httpClient.post<Order>(`${this.basePath}/store/order`,
|
||||
body,
|
||||
order,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
|
@ -59,24 +59,22 @@ export class UserService {
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param body Created user object
|
||||
* @param user Created user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public createUser(body: User, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
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.');
|
||||
public createUser(user: User, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public createUser(user: User, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public createUser(user: User, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public createUser(user: User, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -92,7 +90,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
return this.httpClient.post<any>(`${this.basePath}/user`,
|
||||
body,
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
@ -105,24 +103,22 @@ export class UserService {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public createUsersWithArrayInput(body: Array<User>, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
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.');
|
||||
public createUsersWithArrayInput(user: Array<User>, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public createUsersWithArrayInput(user: Array<User>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public createUsersWithArrayInput(user: Array<User>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public createUsersWithArrayInput(user: Array<User>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -138,7 +134,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
return this.httpClient.post<any>(`${this.basePath}/user/createWithArray`,
|
||||
body,
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
@ -151,24 +147,22 @@ export class UserService {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public createUsersWithListInput(body: Array<User>, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
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.');
|
||||
public createUsersWithListInput(user: Array<User>, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public createUsersWithListInput(user: Array<User>, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public createUsersWithListInput(user: Array<User>, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public createUsersWithListInput(user: Array<User>, observe: any = 'body', reportProgress: boolean = false ): Observable<any> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -184,7 +178,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
return this.httpClient.post<any>(`${this.basePath}/user/createWithList`,
|
||||
body,
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
@ -213,8 +207,6 @@ export class UserService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -296,10 +288,10 @@ export class UserService {
|
||||
}
|
||||
|
||||
let queryParameters = new HttpParams({encoder: new CustomHttpUrlEncodingCodec()});
|
||||
if (username !== undefined) {
|
||||
if (username !== undefined && username !== null) {
|
||||
queryParameters = queryParameters.set('username', <any>username);
|
||||
}
|
||||
if (password !== undefined) {
|
||||
if (password !== undefined && password !== null) {
|
||||
queryParameters = queryParameters.set('password', <any>password);
|
||||
}
|
||||
|
||||
@ -345,8 +337,6 @@ export class UserService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -371,27 +361,25 @@ export class UserService {
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param user Updated user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public updateUser(username: string, body: User, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
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> {
|
||||
public updateUser(username: string, user: User, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public updateUser(username: string, user: User, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public updateUser(username: string, user: User, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public updateUser(username: string, user: 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.');
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -407,7 +395,7 @@ export class UserService {
|
||||
}
|
||||
|
||||
return this.httpClient.put<any>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
||||
body,
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
|
@ -28,8 +28,8 @@ export class Configuration {
|
||||
* Select the correct content-type to use for a request.
|
||||
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
||||
* If no content type is found return the first found type if the contentTypes is not empty
|
||||
* @param {string[]} contentTypes - the array of content types that are available for selection
|
||||
* @returns {string} the selected content-type or <code>undefined</code> if no selection could be made.
|
||||
* @param contentTypes - the array of content types that are available for selection
|
||||
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
||||
*/
|
||||
public selectHeaderContentType (contentTypes: string[]): string | undefined {
|
||||
if (contentTypes.length == 0) {
|
||||
@ -47,8 +47,8 @@ export class Configuration {
|
||||
* Select the correct accept content-type to use for a request.
|
||||
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
|
||||
* If no content type is found return the first found type if the contentTypes is not empty
|
||||
* @param {string[]} accepts - the array of content types that are available for selection.
|
||||
* @returns {string} the selected content-type or <code>undefined</code> if no selection could be made.
|
||||
* @param accepts - the array of content types that are available for selection.
|
||||
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
||||
*/
|
||||
public selectHeaderAccept(accepts: string[]): string | undefined {
|
||||
if (accepts.length == 0) {
|
||||
@ -69,8 +69,8 @@ export class Configuration {
|
||||
* application/json; charset=UTF8
|
||||
* APPLICATION/JSON
|
||||
* application/vnd.company+json
|
||||
* @param {string} mime - MIME (Multipurpose Internet Mail Extensions)
|
||||
* @return {boolean} True if the given MIME is JSON, false otherwise.
|
||||
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
||||
* @return True if the given MIME is JSON, false otherwise.
|
||||
*/
|
||||
public isJsonMime(mime: string): boolean {
|
||||
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
||||
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
|
||||
"lib": {
|
||||
"entryFile": "index.ts"
|
||||
}
|
||||
}
|
@ -7,11 +7,8 @@
|
||||
"swagger-client"
|
||||
],
|
||||
"license": "Unlicense",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc --outDir dist/",
|
||||
"postinstall": "npm run build"
|
||||
"build": "ng-packagr -p ng-package.json"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": "^4.3.0",
|
||||
@ -24,11 +21,13 @@
|
||||
"zone.js": "^0.7.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/compiler-cli": "^4.3.0",
|
||||
"@angular/core": "^4.3.0",
|
||||
"@angular/http": "^4.3.0",
|
||||
"@angular/common": "^4.3.0",
|
||||
"@angular/compiler": "^4.3.0",
|
||||
"@angular/platform-browser": "^4.3.0",
|
||||
"ng-packagr": "^1.6.0",
|
||||
"reflect-metadata": "^0.1.3",
|
||||
"rxjs": "^5.4.0",
|
||||
"zone.js": "^0.7.6",
|
||||
|
@ -1 +1 @@
|
||||
2.4.0-SNAPSHOT
|
||||
3.0.0-SNAPSHOT
|
@ -2,7 +2,7 @@
|
||||
|
||||
### Building
|
||||
|
||||
To build an compile the typescript sources to javascript use:
|
||||
To install the required dependencies and to build the typescript sources run:
|
||||
```
|
||||
npm install
|
||||
npm run build
|
||||
@ -10,11 +10,11 @@ npm run build
|
||||
|
||||
### publishing
|
||||
|
||||
First build the package than run ```npm publish```
|
||||
First build the package than run ```npm publish dist``` (don't forget to specify the `dist` folder!)
|
||||
|
||||
### consuming
|
||||
|
||||
navigate to the folder of your consuming project and run one of next commando's.
|
||||
Navigate to the folder of your consuming project and run one of next commands.
|
||||
|
||||
_published:_
|
||||
|
||||
@ -22,24 +22,31 @@ _published:_
|
||||
npm install @swagger/angular2-typescript-petstore@0.0.1 --save
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
_without publishing (not recommended):_
|
||||
|
||||
```
|
||||
npm install PATH_TO_GENERATED_PACKAGE --save
|
||||
npm install PATH_TO_GENERATED_PACKAGE/dist --save
|
||||
```
|
||||
|
||||
_using `npm link`:_
|
||||
|
||||
In PATH_TO_GENERATED_PACKAGE:
|
||||
In PATH_TO_GENERATED_PACKAGE/dist:
|
||||
```
|
||||
npm link
|
||||
```
|
||||
|
||||
In your project:
|
||||
```
|
||||
npm link @swagger/angular2-typescript-petstore@0.0.1
|
||||
npm link @swagger/angular2-typescript-petstore
|
||||
```
|
||||
|
||||
__Note for Windows users:__ The Angular CLI has troubles to use linked npm packages.
|
||||
Please refer to this issue https://github.com/angular/angular-cli/issues/8284 for a solution / workaround.
|
||||
Published packages are not effected by this issue.
|
||||
|
||||
|
||||
#### General usage
|
||||
|
||||
In your Angular project:
|
||||
|
||||
|
||||
|
@ -61,10 +61,10 @@ export class PetService {
|
||||
/**
|
||||
*
|
||||
* @summary Add a new pet to the store
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.addPetWithHttpInfo(body, extraHttpRequestParams)
|
||||
public addPet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.addPetWithHttpInfo(pet, extraHttpRequestParams)
|
||||
.map((response: Response) => {
|
||||
if (response.status === 204) {
|
||||
return undefined;
|
||||
@ -142,10 +142,10 @@ export class PetService {
|
||||
/**
|
||||
*
|
||||
* @summary Update an existing pet
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.updatePetWithHttpInfo(body, extraHttpRequestParams)
|
||||
public updatePet(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.updatePetWithHttpInfo(pet, extraHttpRequestParams)
|
||||
.map((response: Response) => {
|
||||
if (response.status === 204) {
|
||||
return undefined;
|
||||
@ -195,12 +195,12 @@ export class PetService {
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
|
||||
*/
|
||||
public addPetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling addPet.');
|
||||
public addPetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new Error('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
@ -215,8 +215,6 @@ export class PetService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -236,7 +234,7 @@ export class PetService {
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
@ -274,8 +272,6 @@ export class PetService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -455,12 +451,12 @@ export class PetService {
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
|
||||
*/
|
||||
public updatePetWithHttpInfo(body: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling updatePet.');
|
||||
public updatePetWithHttpInfo(pet: Pet, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new Error('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
@ -475,8 +471,6 @@ export class PetService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -496,7 +490,7 @@ export class PetService {
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Put,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
body: pet == null ? '' : JSON.stringify(pet), // https://github.com/angular/angular/issues/10612
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
@ -532,8 +526,6 @@ export class PetService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
|
@ -107,10 +107,10 @@ export class StoreService {
|
||||
/**
|
||||
*
|
||||
* @summary Place an order for a pet
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param order order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable<Order> {
|
||||
return this.placeOrderWithHttpInfo(body, extraHttpRequestParams)
|
||||
public placeOrder(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable<Order> {
|
||||
return this.placeOrderWithHttpInfo(order, extraHttpRequestParams)
|
||||
.map((response: Response) => {
|
||||
if (response.status === 204) {
|
||||
return undefined;
|
||||
@ -136,8 +136,6 @@ export class StoreService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -244,12 +242,12 @@ export class StoreService {
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
* @param order order placed for purchasing the pet
|
||||
|
||||
*/
|
||||
public placeOrderWithHttpInfo(body: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling placeOrder.');
|
||||
public placeOrderWithHttpInfo(order: Order, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (order === null || order === undefined) {
|
||||
throw new Error('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
@ -275,7 +273,7 @@ export class StoreService {
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
body: order == null ? '' : JSON.stringify(order), // https://github.com/angular/angular/issues/10612
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
|
@ -60,10 +60,10 @@ export class UserService {
|
||||
/**
|
||||
* This can only be done by the logged in user.
|
||||
* @summary Create user
|
||||
* @param body Created user object
|
||||
* @param user Created user object
|
||||
*/
|
||||
public createUser(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.createUserWithHttpInfo(body, extraHttpRequestParams)
|
||||
public createUser(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.createUserWithHttpInfo(user, extraHttpRequestParams)
|
||||
.map((response: Response) => {
|
||||
if (response.status === 204) {
|
||||
return undefined;
|
||||
@ -76,10 +76,10 @@ export class UserService {
|
||||
/**
|
||||
*
|
||||
* @summary Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithArrayInput(body: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.createUsersWithArrayInputWithHttpInfo(body, extraHttpRequestParams)
|
||||
public createUsersWithArrayInput(user: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.createUsersWithArrayInputWithHttpInfo(user, extraHttpRequestParams)
|
||||
.map((response: Response) => {
|
||||
if (response.status === 204) {
|
||||
return undefined;
|
||||
@ -92,10 +92,10 @@ export class UserService {
|
||||
/**
|
||||
*
|
||||
* @summary Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
*/
|
||||
public createUsersWithListInput(body: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.createUsersWithListInputWithHttpInfo(body, extraHttpRequestParams)
|
||||
public createUsersWithListInput(user: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.createUsersWithListInputWithHttpInfo(user, extraHttpRequestParams)
|
||||
.map((response: Response) => {
|
||||
if (response.status === 204) {
|
||||
return undefined;
|
||||
@ -173,10 +173,10 @@ export class UserService {
|
||||
* This can only be done by the logged in user.
|
||||
* @summary Updated user
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param user Updated user object
|
||||
*/
|
||||
public updateUser(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.updateUserWithHttpInfo(username, body, extraHttpRequestParams)
|
||||
public updateUser(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<{}> {
|
||||
return this.updateUserWithHttpInfo(username, user, extraHttpRequestParams)
|
||||
.map((response: Response) => {
|
||||
if (response.status === 204) {
|
||||
return undefined;
|
||||
@ -190,20 +190,18 @@ export class UserService {
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param body Created user object
|
||||
* @param user Created user object
|
||||
|
||||
*/
|
||||
public createUserWithHttpInfo(body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling createUser.');
|
||||
public createUserWithHttpInfo(user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -221,7 +219,7 @@ export class UserService {
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
@ -235,20 +233,18 @@ export class UserService {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
|
||||
*/
|
||||
public createUsersWithArrayInputWithHttpInfo(body: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.');
|
||||
public createUsersWithArrayInputWithHttpInfo(user: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -266,7 +262,7 @@ export class UserService {
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
@ -280,20 +276,18 @@ export class UserService {
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param body List of user object
|
||||
* @param user List of user object
|
||||
|
||||
*/
|
||||
public createUsersWithListInputWithHttpInfo(body: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (body === null || body === undefined) {
|
||||
throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.');
|
||||
public createUsersWithListInputWithHttpInfo(user: Array<User>, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -311,7 +305,7 @@ export class UserService {
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Post,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
@ -337,8 +331,6 @@ export class UserService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -418,10 +410,10 @@ export class UserService {
|
||||
}
|
||||
|
||||
let queryParameters = new URLSearchParams('', new CustomQueryEncoderHelper());
|
||||
if (username !== undefined) {
|
||||
if (username !== undefined && username !== null) {
|
||||
queryParameters.set('username', <any>username);
|
||||
}
|
||||
if (password !== undefined) {
|
||||
if (password !== undefined && password !== null) {
|
||||
queryParameters.set('password', <any>password);
|
||||
}
|
||||
|
||||
@ -466,8 +458,6 @@ export class UserService {
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -495,23 +485,21 @@ export class UserService {
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
* @param user Updated user object
|
||||
|
||||
*/
|
||||
public updateUserWithHttpInfo(username: string, body: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
public updateUserWithHttpInfo(username: string, user: User, extraHttpRequestParams?: RequestOptionsArgs): Observable<Response> {
|
||||
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.');
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845
|
||||
|
||||
// to determine the Accept header
|
||||
let httpHeaderAccepts: string[] = [
|
||||
'application/xml',
|
||||
'application/json'
|
||||
];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected != undefined) {
|
||||
@ -529,7 +517,7 @@ export class UserService {
|
||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||
method: RequestMethod.Put,
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
body: user == null ? '' : JSON.stringify(user), // https://github.com/angular/angular/issues/10612
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
|
@ -28,8 +28,8 @@ export class Configuration {
|
||||
* Select the correct content-type to use for a request.
|
||||
* Uses {@link Configuration#isJsonMime} to determine the correct content-type.
|
||||
* If no content type is found return the first found type if the contentTypes is not empty
|
||||
* @param {string[]} contentTypes - the array of content types that are available for selection
|
||||
* @returns {string} the selected content-type or <code>undefined</code> if no selection could be made.
|
||||
* @param contentTypes - the array of content types that are available for selection
|
||||
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
||||
*/
|
||||
public selectHeaderContentType (contentTypes: string[]): string | undefined {
|
||||
if (contentTypes.length == 0) {
|
||||
@ -47,8 +47,8 @@ export class Configuration {
|
||||
* Select the correct accept content-type to use for a request.
|
||||
* Uses {@link Configuration#isJsonMime} to determine the correct accept content-type.
|
||||
* If no content type is found return the first found type if the contentTypes is not empty
|
||||
* @param {string[]} accepts - the array of content types that are available for selection.
|
||||
* @returns {string} the selected content-type or <code>undefined</code> if no selection could be made.
|
||||
* @param accepts - the array of content types that are available for selection.
|
||||
* @returns the selected content-type or <code>undefined</code> if no selection could be made.
|
||||
*/
|
||||
public selectHeaderAccept(accepts: string[]): string | undefined {
|
||||
if (accepts.length == 0) {
|
||||
@ -69,8 +69,8 @@ export class Configuration {
|
||||
* application/json; charset=UTF8
|
||||
* APPLICATION/JSON
|
||||
* application/vnd.company+json
|
||||
* @param {string} mime - MIME (Multipurpose Internet Mail Extensions)
|
||||
* @return {boolean} True if the given MIME is JSON, false otherwise.
|
||||
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
||||
* @return True if the given MIME is JSON, false otherwise.
|
||||
*/
|
||||
public isJsonMime(mime: string): boolean {
|
||||
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
||||
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
|
||||
"lib": {
|
||||
"entryFile": "index.ts"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -7,11 +7,8 @@
|
||||
"swagger-client"
|
||||
],
|
||||
"license": "Unlicense",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc --outDir dist/",
|
||||
"postinstall": "npm run build"
|
||||
"build": "ng-packagr -p ng-package.json"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/core": "^4.0.0",
|
||||
@ -24,11 +21,13 @@
|
||||
"zone.js": "^0.7.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular/compiler-cli": "^4.0.0",
|
||||
"@angular/core": "^4.0.0",
|
||||
"@angular/http": "^4.0.0",
|
||||
"@angular/common": "^4.0.0",
|
||||
"@angular/compiler": "^4.0.0",
|
||||
"@angular/platform-browser": "^4.0.0",
|
||||
"ng-packagr": "^1.6.0",
|
||||
"reflect-metadata": "^0.1.3",
|
||||
"rxjs": "^5.4.0",
|
||||
"zone.js": "^0.7.6",
|
||||
|
Loading…
x
Reference in New Issue
Block a user