@devlearning/swagger-generator 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.constants.js +1 -1
- package/dist/generator.js +1 -3
- package/package.json +1 -1
- package/src/api.constants.ts +1 -1
- package/src/generator.ts +1 -3
package/dist/api.constants.js
CHANGED
|
@@ -11,6 +11,6 @@ export abstract class ApiAutogeneratedService {
|
|
|
11
11
|
|
|
12
12
|
protected abstract _handleRequest<T>(request: T): T;
|
|
13
13
|
protected abstract _handleResponse<T>(response: T): T;
|
|
14
|
-
protected abstract _handleError(error: any, obs: any):
|
|
14
|
+
protected abstract _handleError(error: any, obs: any): Observable<never>;
|
|
15
15
|
`;
|
|
16
16
|
export const API_POST = `}`;
|
package/dist/generator.js
CHANGED
|
@@ -35,9 +35,7 @@ export class Generator {
|
|
|
35
35
|
${prepareRequestString}return this._http.${method}<${returnTypeString}>(\`\${this._baseUrl}${apiName.replace('{version}', '1')}${queryParameters}\`${haveRequest ? ', request' : ''}, httpOptions)
|
|
36
36
|
.pipe(
|
|
37
37
|
map(x => this._handleResponse(x)),
|
|
38
|
-
|
|
39
|
-
return this._handleError(err, <Observable<any>>obs);
|
|
40
|
-
})
|
|
38
|
+
catchError((err, obs) => this._handleError(err, <Observable<any>>obs))
|
|
41
39
|
);
|
|
42
40
|
}
|
|
43
41
|
`;
|
package/package.json
CHANGED
package/src/api.constants.ts
CHANGED
|
@@ -12,7 +12,7 @@ export abstract class ApiAutogeneratedService {
|
|
|
12
12
|
|
|
13
13
|
protected abstract _handleRequest<T>(request: T): T;
|
|
14
14
|
protected abstract _handleResponse<T>(response: T): T;
|
|
15
|
-
protected abstract _handleError(error: any, obs: any):
|
|
15
|
+
protected abstract _handleError(error: any, obs: any): Observable<never>;
|
|
16
16
|
`;
|
|
17
17
|
|
|
18
18
|
export const API_POST =
|
package/src/generator.ts
CHANGED
|
@@ -47,9 +47,7 @@ export class Generator {
|
|
|
47
47
|
${prepareRequestString}return this._http.${method}<${returnTypeString}>(\`\${this._baseUrl}${apiName.replace('{version}', '1')}${queryParameters}\`${haveRequest ? ', request' : ''}, httpOptions)
|
|
48
48
|
.pipe(
|
|
49
49
|
map(x => this._handleResponse(x)),
|
|
50
|
-
|
|
51
|
-
return this._handleError(err, <Observable<any>>obs);
|
|
52
|
-
})
|
|
50
|
+
catchError((err, obs) => this._handleError(err, <Observable<any>>obs))
|
|
53
51
|
);
|
|
54
52
|
}
|
|
55
53
|
`;
|