@wx-sab/renkei 1.3.1 → 1.3.3

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.
@@ -101,6 +101,12 @@ const generate = (conf) => __awaiter(void 0, void 0, void 0, function* () {
101
101
  SKIP_ROUTE_MARKER: config_utils_1.SKIP_ROUTE_MARKER });
102
102
  },
103
103
  onParseSchema(originalSchema, parsedSchema) {
104
+ if (originalSchema.format === 'int64' ||
105
+ originalSchema.format === 'long') {
106
+ if (typeof parsedSchema.content === 'string') {
107
+ return Object.assign(Object.assign({}, parsedSchema), { content: parsedSchema.content.replace(/\bnumber\b/g, 'number | string') });
108
+ }
109
+ }
104
110
  if (parsedSchema.name === "any" &&
105
111
  typeof parsedSchema.content === "string" &&
106
112
  parsedSchema.$ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wx-sab/renkei",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "解析swagger转为ts代码,日本动漫《游戏王》中的‘Renkei’,意为连携或协作。",
5
5
  "main": "./lib/index.js",
6
6
  "bin": {
package/templates/api.ejs CHANGED
@@ -69,7 +69,7 @@ export class <%~ serviceName %> {
69
69
  * 开启Mock
70
70
  */
71
71
  static private isMock = false;
72
- static enableMock(enable?: boolean = true) {
72
+ static enableMock(enable: boolean = true) {
73
73
  <%~ serviceName %>.isMock = enable;
74
74
  }
75
75