Skip to content

Commit 856e111

Browse files
committed
Removed functions.
1 parent bc01faa commit 856e111

File tree

3 files changed

+16
-106
lines changed

3 files changed

+16
-106
lines changed

src/templates/core/ApiQuery.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ export type ApiQuery<T, R> = {
88
readonly query?: { [key: string]: string }
99
readonly path?: { [key: string]: string }
1010
params?: R;
11+
readonly bodyJsonModel?: string;
1112
};

src/templates/exportService.hbs

Lines changed: 4 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -94,108 +94,11 @@ export class {{{name}}}{{{@root.postfix}}} {
9494
{{#each parametersPath}}
9595
'{{{prop}}}': '{{{name}}}',
9696
{{/each}}
97-
}
97+
},
98+
{{/if}}
99+
{{#if parametersBody}}
100+
bodyJsonModel: '${{>type parametersBody}}',
98101
{{/if}}
99-
}
100-
101-
/**
102-
{{#if deprecated}}
103-
* @deprecated
104-
{{/if}}
105-
{{#if summary}}
106-
* {{{escapeComment summary}}}
107-
{{/if}}
108-
{{#if description}}
109-
* {{{escapeComment description}}}
110-
{{/if}}
111-
{{#unless @root.useOptions}}
112-
{{#if parameters}}
113-
{{#each parameters}}
114-
* @param {{{name}}} {{#if description}}{{{escapeComment description}}}{{/if}}
115-
{{/each}}
116-
{{/if}}
117-
{{/unless}}
118-
{{#each results}}
119-
* @returns {{{type}}} {{#if description}}{{{escapeComment description}}}{{/if}}
120-
{{/each}}
121-
* @throws ApiError
122-
*/
123-
{{#if @root.exportClient}}
124-
{{#equals @root.httpClient 'angular'}}
125-
public {{{name}}}({{>parameters}}): Observable<{{>result}}> {
126-
return this.httpRequest.request({
127-
{{else}}
128-
public {{{name}}}({{>parameters}}): CancelablePromise<{{>result}}> {
129-
return this.httpRequest.request({
130-
{{/equals}}
131-
{{else}}
132-
{{#equals @root.httpClient 'angular'}}
133-
public {{{name}}}({{>parameters}}): Observable<{{>result}}> {
134-
return __request(OpenAPI, this.http, {
135-
{{else}}
136-
public static {{{name}}}({{>parameters}}): CancelablePromise<{{>result}}> {
137-
return __request(OpenAPI, {
138-
{{/equals}}
139-
{{/if}}
140-
method: '{{{method}}}',
141-
url: '{{{path}}}',
142-
{{#if parametersPath}}
143-
path: {
144-
{{#each parametersPath}}
145-
'{{{prop}}}': {{{name}}},
146-
{{/each}}
147-
},
148-
{{/if}}
149-
{{#if parametersCookie}}
150-
cookies: {
151-
{{#each parametersCookie}}
152-
'{{{prop}}}': {{{name}}},
153-
{{/each}}
154-
},
155-
{{/if}}
156-
{{#if parametersHeader}}
157-
headers: {
158-
{{#each parametersHeader}}
159-
'{{{prop}}}': {{{name}}},
160-
{{/each}}
161-
},
162-
{{/if}}
163-
{{#if parametersQuery}}
164-
query: {
165-
{{#each parametersQuery}}
166-
'{{{prop}}}': {{{name}}},
167-
{{/each}}
168-
},
169-
{{/if}}
170-
{{#if parametersForm}}
171-
formData: {
172-
{{#each parametersForm}}
173-
'{{{prop}}}': {{{name}}},
174-
{{/each}}
175-
},
176-
{{/if}}
177-
{{#if parametersBody}}
178-
{{#equals parametersBody.in 'formData'}}
179-
formData: {{{parametersBody.name}}},
180-
{{/equals}}
181-
{{#equals parametersBody.in 'body'}}
182-
body: {{{parametersBody.name}}},
183-
{{/equals}}
184-
{{#if parametersBody.mediaType}}
185-
mediaType: '{{{parametersBody.mediaType}}}',
186-
{{/if}}
187-
{{/if}}
188-
{{#if responseHeader}}
189-
responseHeader: '{{{responseHeader}}}',
190-
{{/if}}
191-
{{#if errors}}
192-
errors: {
193-
{{#each errors}}
194-
{{{code}}}: `{{{escapeDescription description}}}`,
195-
{{/each}}
196-
},
197-
{{/if}}
198-
});
199102
}
200103

201104
{{/each}}

src/utils/writeClientServices.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@ export const writeClientServices = async (
3333
clientName?: string
3434
): Promise<void> => {
3535
for (const service of services) {
36-
/*
37-
service.operations.map(o => {
38-
console.log(o)
39-
})
40-
*/
36+
if (service.name === 'Meta') {
37+
console.log(service)
38+
/*
39+
service.operations.map(o => {
40+
console.log(o.name)
41+
console.log(o.parametersBody)
42+
})
43+
*/
44+
}
45+
46+
4147
const file = resolve(outputPath, `${service.name}${postfix}.ts`);
4248
const templateResult = templates.exports.service({
4349
...service,

0 commit comments

Comments
 (0)