Skip to content

Commit e9d4886

Browse files
authored
replace tab with spaces, minor code format change (#8775)
1 parent 695efdb commit e9d4886

108 files changed

Lines changed: 4211 additions & 4414 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/openapi-generator/src/main/resources/typescript-angular/README.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export class AppModule {}
120120
import { DefaultApi } from '{{npmName}}';
121121

122122
export class AppComponent {
123-
constructor(private apiGateway: DefaultApi) { }
123+
constructor(private apiGateway: DefaultApi) { }
124124
}
125125
```
126126

modules/openapi-generator/src/main/resources/typescript-fetch/runtime.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export class BaseAPI {
5151
url += '?' + this.configuration.queryParamsStringify(context.query);
5252
}
5353
const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
54-
? context.body
55-
: JSON.stringify(context.body);
54+
? context.body
55+
: JSON.stringify(context.body);
5656

5757
const headers = Object.assign({}, this.configuration.headers, context.headers);
5858
const init = {

modules/openapi-generator/src/main/resources/typescript-nestjs/README.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## {{npmName}}@{{npmVersion}}
1+
modules/openapi-generator/src/main/resources/typescript-nestjs/README.mustache {{npmName}}@{{npmVersion}}
22

33
### Building
44

@@ -52,7 +52,7 @@ export class AppModule {}
5252
import { DefaultApi } from '{{npmName}}';
5353

5454
export class AppComponent {
55-
constructor(private apiGateway: DefaultApi) { }
55+
constructor(private apiGateway: DefaultApi) { }
5656
}
5757
```
5858

@@ -134,4 +134,4 @@ import { environment } from '../environments/environment';
134134
]
135135
})
136136
export class AppModule { }
137-
```
137+
```

modules/openapi-generator/src/main/resources/typescript-rxjs/servers.mustache

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,26 @@ export class ServerConfiguration<T extends { [key: string]: string }> {
1616
Object.assign(this.variableConfiguration, variableConfiguration);
1717
}
1818

19-
public getConfiguration(): T {
20-
return this.variableConfiguration
21-
}
19+
public getConfiguration(): T {
20+
return this.variableConfiguration
21+
}
2222

23-
public getDescription(): string {
24-
return this.description
25-
}
23+
public getDescription(): string {
24+
return this.description
25+
}
2626

27-
/**
28-
* Constructions the URL this server using the url with variables
29-
* replaced with their respective values
30-
*/
31-
public getUrl(): string {
32-
let replacedUrl = this.url;
33-
for (const key in this.variableConfiguration) {
34-
var re = new RegExp("{" + key + "}","g");
35-
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
36-
}
37-
return replacedUrl
38-
}
27+
/**
28+
* Constructions the URL this server using the url with variables
29+
* replaced with their respective values
30+
*/
31+
public getUrl(): string {
32+
let replacedUrl = this.url;
33+
for (const key in this.variableConfiguration) {
34+
var re = new RegExp("{" + key + "}","g");
35+
replacedUrl = replacedUrl.replace(re, this.variableConfiguration[key]);
36+
}
37+
return replacedUrl
38+
}
3939
}
4040

4141
{{#servers}}

modules/openapi-generator/src/main/resources/typescript/api/api.mustache

Lines changed: 41 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ import { {{classname}} } from '..{{filename}}{{extensionForDeno}}';
2626
@injectable()
2727
{{/useInversify}}
2828
export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
29-
30-
{{#operation}}
29+
30+
{{#operation}}
3131
/**
3232
{{#notes}}
3333
* {{&notes}}
@@ -40,44 +40,44 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
4040
{{/allParams}}
4141
*/
4242
public async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): Promise<RequestContext> {
43-
let config = options || this.configuration;
44-
{{#allParams}}
45-
46-
{{#required}}
43+
let config = options || this.configuration;
44+
{{#allParams}}
45+
46+
{{#required}}
4747
// verify required parameter '{{paramName}}' is not null or undefined
4848
if ({{paramName}} === null || {{paramName}} === undefined) {
4949
throw new RequiredError('Required parameter {{paramName}} was null or undefined when calling {{nickname}}.');
5050
}
5151

52-
{{/required}}
53-
{{/allParams}}
54-
55-
// Path Params
56-
const localVarPath = '{{{path}}}'{{#pathParams}}
52+
{{/required}}
53+
{{/allParams}}
54+
55+
// Path Params
56+
const localVarPath = '{{{path}}}'{{#pathParams}}
5757
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
5858

59-
// Make Request Context
60-
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.{{httpMethod}});
59+
// Make Request Context
60+
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.{{httpMethod}});
6161
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8")
6262

6363
// Query Params
64-
{{#queryParams}}
64+
{{#queryParams}}
6565
if ({{paramName}} !== undefined) {
66-
requestContext.setQueryParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
66+
requestContext.setQueryParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
6767
}
68-
{{/queryParams}}
69-
70-
// Header Params
71-
{{#headerParams}}
72-
requestContext.setHeaderParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
73-
{{/headerParams}}
74-
75-
// Form Params
76-
{{#hasFormParams}}
77-
let localVarFormParams = new FormData();
78-
{{/hasFormParams}}
79-
80-
{{#formParams}}
68+
{{/queryParams}}
69+
70+
// Header Params
71+
{{#headerParams}}
72+
requestContext.setHeaderParam("{{baseName}}", ObjectSerializer.serialize({{paramName}}, "{{{dataType}}}", "{{dataFormat}}"));
73+
{{/headerParams}}
74+
75+
// Form Params
76+
{{#hasFormParams}}
77+
let localVarFormParams = new FormData();
78+
{{/hasFormParams}}
79+
80+
{{#formParams}}
8181
{{#isArray}}
8282
if ({{paramName}}) {
8383
{{#isCollectionFormatMulti}}
@@ -86,14 +86,14 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
8686
})
8787
{{/isCollectionFormatMulti}}
8888
{{^isCollectionFormatMulti}}
89-
// TODO: replace .append with .set
90-
localVarFormParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]));
89+
// TODO: replace .append with .set
90+
localVarFormParams.append('{{baseName}}', {{paramName}}.join(COLLECTION_FORMATS["{{collectionFormat}}"]));
9191
{{/isCollectionFormatMulti}}
9292
}
9393
{{/isArray}}
9494
{{^isArray}}
9595
if ({{paramName}} !== undefined) {
96-
// TODO: replace .append with .set
96+
// TODO: replace .append with .set
9797
{{^isFile}}
9898
localVarFormParams.append('{{baseName}}', {{paramName}} as any);
9999
{{/isFile}}
@@ -109,13 +109,13 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
109109
{{/isFile}}
110110
}
111111
{{/isArray}}
112-
{{/formParams}}
113-
{{#hasFormParams}}
114-
requestContext.setBody(localVarFormParams);
115-
{{/hasFormParams}}
112+
{{/formParams}}
113+
{{#hasFormParams}}
114+
requestContext.setBody(localVarFormParams);
115+
{{/hasFormParams}}
116116

117-
// Body Params
118-
{{#bodyParam}}
117+
// Body Params
118+
{{#bodyParam}}
119119
const contentType = ObjectSerializer.getPreferredMediaType([{{#consumes}}
120120
"{{{mediaType}}}"{{^-last}},{{/-last}}
121121
{{/consumes}}]);
@@ -125,7 +125,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
125125
contentType
126126
);
127127
requestContext.setBody(serializedBody);
128-
{{/bodyParam}}
128+
{{/bodyParam}}
129129

130130
{{#hasAuthMethods}}
131131
let authMethod = null;
@@ -144,8 +144,6 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
144144
{{/operation}}
145145
}
146146
{{/operations}}
147-
148-
149147
{{#operations}}
150148

151149
{{#useInversify}}
@@ -213,9 +211,9 @@ export class {{classname}}ResponseProcessor {
213211
}
214212

215213
let body = response.body || "";
216-
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
214+
throw new ApiException<string>(response.httpStatusCode, "Unknown API Status Code!\nBody: \"" + body + "\"");
217215
}
218-
219-
{{/operation}}
216+
217+
{{/operation}}
220218
}
221219
{{/operations}}

modules/openapi-generator/src/main/resources/typescript/api/exception.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*/
1010
export class ApiException<T> extends Error {
11-
public constructor(public code: number, public body: T) {
11+
public constructor(public code: number, public body: T) {
1212
super("HTTP-Code: " + code + "\nMessage: " + JSON.stringify(body))
13-
}
14-
}
13+
}
14+
}

modules/openapi-generator/src/main/resources/typescript/api/middleware.mustache

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import { Observable, from } from {{#useRxJS}}'rxjs'{{/useRxJS}}{{^useRxJS}}'./rx
88
*
99
*/
1010
export interface Middleware {
11-
/**
12-
* Modifies the request before the request is sent.
13-
*
14-
* @param context RequestContext of a request which is about to be sent to the server
15-
* @returns an observable of the updated request context
16-
*
17-
*/
11+
/**
12+
* Modifies the request before the request is sent.
13+
*
14+
* @param context RequestContext of a request which is about to be sent to the server
15+
* @returns an observable of the updated request context
16+
*
17+
*/
1818
pre(context: RequestContext): Observable<RequestContext>;
1919
/**
2020
* Modifies the returned response before it is deserialized.
@@ -48,13 +48,13 @@ export class PromiseMiddlewareWrapper implements Middleware {
4848
*
4949
*/
5050
export interface PromiseMiddleware {
51-
/**
52-
* Modifies the request before the request is sent.
53-
*
54-
* @param context RequestContext of a request which is about to be sent to the server
55-
* @returns an observable of the updated request context
56-
*
57-
*/
51+
/**
52+
* Modifies the request before the request is sent.
53+
*
54+
* @param context RequestContext of a request which is about to be sent to the server
55+
* @returns an observable of the updated request context
56+
*
57+
*/
5858
pre(context: RequestContext): Promise<RequestContext>;
5959
/**
6060
* Modifies the returned response before it is deserialized.
@@ -63,4 +63,4 @@ export interface PromiseMiddleware {
6363
* @returns an observable of the modified response context
6464
*/
6565
post(context: ResponseContext): Promise<ResponseContext>;
66-
}
66+
}

0 commit comments

Comments
 (0)