@devlearning/swagger-generator 0.0.32 → 0.0.33

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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ Add task on package.json
2
+
3
+ "swgen": "swgen http://localhost:5208/swagger/v1/swagger.json src/app/core/autogenerated"
4
+
5
+ specify url of your swagger.json and path destination of generated files (in this example you must create path core/autogenerated)
package/dist/generator.js CHANGED
@@ -19,9 +19,6 @@ export class Generator {
19
19
  const method = Object.getOwnPropertyNames(swaggerMethod)[0];
20
20
  const swaggerMethodInfo = swaggerMethod[method];
21
21
  console.debug(`\tAPI - ${apiName} - ${method}`);
22
- if (apiName == '/api/v{version}/TransportOrder/ListByServiceRequest') {
23
- console.debug('');
24
- }
25
22
  let parametersString = this.retrieveParameters(swaggerMethodInfo, apiName);
26
23
  let queryParametersDeclaration = this.retrieveQueryParametersDeclaration(swaggerMethodInfo);
27
24
  let queryParameters = this.retrieveQueryParameters(swaggerMethodInfo);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devlearning/swagger-generator",
3
- "version": "0.0.32",
3
+ "version": "0.0.33",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -14,9 +14,12 @@
14
14
  "keywords": [],
15
15
  "author": "",
16
16
  "license": "ISC",
17
+ "dependencies": {
18
+ "node-fetch": "^3.3.2"
19
+ },
20
+ "node-fetch": "^3.3.2",
17
21
  "devDependencies": {
18
22
  "@types/node": "^18.15.0",
19
- "node-fetch": "^3.3.2",
20
23
  "ts-node": "^10.9.1",
21
24
  "tsconfig-paths": "^4.2.0",
22
25
  "typescript": "^5.1.6"
package/src/generator.ts CHANGED
@@ -30,10 +30,6 @@ export class Generator {
30
30
  const swaggerMethodInfo = swaggerMethod[method];
31
31
  console.debug(`\tAPI - ${apiName} - ${method}`);
32
32
 
33
- if (apiName == '/api/v{version}/TransportOrder/ListByServiceRequest') {
34
- console.debug('');
35
- }
36
-
37
33
  let parametersString = this.retrieveParameters(swaggerMethodInfo, apiName);
38
34
  let queryParametersDeclaration = this.retrieveQueryParametersDeclaration(swaggerMethodInfo);
39
35
  let queryParameters = this.retrieveQueryParameters(swaggerMethodInfo);
@@ -85,6 +81,7 @@ ${API_POST}`,
85
81
  if(apiName == "/api/v{version}/TicketFile/Create"){
86
82
  debugger
87
83
  }
84
+
88
85
  let parametersRefType = swaggerMethodInfo.parameters.filter(x => x.in == 'query' && x.schema?.$ref != null).map(x => x.schema.$ref.replace('#/components/schemas/', ''))
89
86
  usedTypes = usedTypes.concat(parametersRefType);
90
87