@devlearning/swagger-generator 1.1.7 → 1.1.9

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.
@@ -24,6 +24,9 @@ export class ApiAngularWriter {
24
24
  let haveRequest = api.haveRequest;
25
25
  let method = api.method.toLowerCase();
26
26
  let httpOptions = api.isMultiPart ? 'httpOptionsMultipart' : 'httpOptions';
27
+ if (apiNameNormalized.includes('TicketFile')) {
28
+ debugger;
29
+ }
27
30
  let apiString = `
28
31
  public ${apiNameNormalized}(${parametersString}): Observable<${returnTypeString}> {
29
32
  ${queryParametersPreparation}${requestPreparation}return this._http.${method}<${returnTypeString}>(\`\${this._baseUrl}${api.url}${queryParameters}\`${haveRequest ? ', wrappedRequest' : ''}, ${httpOptions})
@@ -107,8 +110,14 @@ export class ApiAngularWriter {
107
110
  if (!api.haveRequest) {
108
111
  return '';
109
112
  }
110
- return `let wrappedRequest = this._handleRequest(request);
113
+ if (api.isMultiPart) {
114
+ return `let wrappedRequest = this._handleMultipart(request);
111
115
  `;
116
+ }
117
+ else {
118
+ return `let wrappedRequest = this._handleRequest(request);
119
+ `;
120
+ }
112
121
  }
113
122
  _writeFile(apis) {
114
123
  fs.writeFileSync(this._outputDirectory + "/api.autogenerated.ts", `${API_PRE}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@devlearning/swagger-generator",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Swagger generator apis and models for Angular and NextJS",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
- "debug-angular": "npx tsx src/index.ts --url http://localhost:5208/swagger/v1/swagger.json --output autogeneration/output --target angular --dateTimeLibrary moment",
9
- "debug-nextjs": "npx tsx src/index.ts --url http://localhost:7550/swagger/ApiGateway/swagger.json --output autogeneration/output --target next --dateTimeLibrary date-fns",
8
+ "debug-angular": "npx tsx src/index.ts --url http://localhost:5208/swagger/v1/swagger.json --output autogen --target angular --dateTimeLibrary moment",
9
+ "debug-nextjs": "npx tsx src/index.ts --url http://localhost:7550/swagger/ApiGateway/swagger.json --output autogen --target next --dateTimeLibrary date-fns",
10
10
  "debug-flutter": "npx tsx src/index.ts --url http://localhost:7550/swagger/ApiGateway/swagger.json --output autogen --target flutter --package coqudo_app",
11
11
  "copy-templates": "copyfiles -u 3 \"src/generators-writers/dart/templates/**/*\" dist/generators-writers/dart",
12
12
  "deploy": "npx tsc && npm publish"
@@ -36,6 +36,10 @@ export class ApiAngularWriter {
36
36
  let method = api.method.toLowerCase();
37
37
  let httpOptions = api.isMultiPart ? 'httpOptionsMultipart' : 'httpOptions';
38
38
 
39
+ if (apiNameNormalized.includes('TicketFile')) {
40
+ debugger
41
+ }
42
+
39
43
  let apiString = `
40
44
  public ${apiNameNormalized}(${parametersString}): Observable<${returnTypeString}> {
41
45
  ${queryParametersPreparation}${requestPreparation}return this._http.${method}<${returnTypeString}>(\`\${this._baseUrl}${api.url}${queryParameters}\`${haveRequest ? ', wrappedRequest' : ''}, ${httpOptions})
@@ -135,8 +139,13 @@ export class ApiAngularWriter {
135
139
  return '';
136
140
  }
137
141
 
138
- return `let wrappedRequest = this._handleRequest(request);
142
+ if (api.isMultiPart) {
143
+ return `let wrappedRequest = this._handleMultipart(request);
139
144
  `;
145
+ } else {
146
+ return `let wrappedRequest = this._handleRequest(request);
147
+ `;
148
+ }
140
149
  }
141
150
 
142
151
  private _writeFile(apis: string) {