openapi-ts-request 1.3.2 → 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.
package/dist/generator/util.js
CHANGED
|
@@ -27,8 +27,9 @@ const tslib_1 = require("tslib");
|
|
|
27
27
|
const lodash_1 = require("lodash");
|
|
28
28
|
const reserved_words_1 = tslib_1.__importDefault(require("reserved-words"));
|
|
29
29
|
const tiny_pinyin_1 = tslib_1.__importDefault(require("tiny-pinyin"));
|
|
30
|
+
const config_1 = require("../config");
|
|
30
31
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
31
|
-
const
|
|
32
|
+
const config_2 = require("./config");
|
|
32
33
|
function stripDot(str) {
|
|
33
34
|
return str.replace(/[-_ .](\w)/g, (_all, letter) => letter.toUpperCase());
|
|
34
35
|
}
|
|
@@ -105,13 +106,13 @@ function getDefaultType(schemaObject, namespace = '', schemas) {
|
|
|
105
106
|
if (type === 'null') {
|
|
106
107
|
return 'null';
|
|
107
108
|
}
|
|
108
|
-
if (
|
|
109
|
+
if (config_2.numberEnum.includes(schemaObject.format)) {
|
|
109
110
|
type = 'number';
|
|
110
111
|
}
|
|
111
112
|
if (schemaObject.enum) {
|
|
112
113
|
type = 'enum';
|
|
113
114
|
}
|
|
114
|
-
if (
|
|
115
|
+
if (config_2.numberEnum.includes(type)) {
|
|
115
116
|
return 'number';
|
|
116
117
|
}
|
|
117
118
|
if (dateEnum.includes(type)) {
|
|
@@ -314,8 +315,10 @@ function isNonArraySchemaObject(schema) {
|
|
|
314
315
|
(schema === null || schema === void 0 ? void 0 : schema.properties) !== undefined);
|
|
315
316
|
}
|
|
316
317
|
function isArraySchemaObject(schema) {
|
|
317
|
-
return (((schema === null || schema === void 0 ? void 0 : schema.type) ===
|
|
318
|
-
|
|
318
|
+
return (((schema === null || schema === void 0 ? void 0 : schema.type) === config_1.SchemaObjectType.array ||
|
|
319
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
320
|
+
// @ts-expect-error
|
|
321
|
+
(schema === null || schema === void 0 ? void 0 : schema.type) === config_1.SchemaObjectType.stringArray) &&
|
|
319
322
|
(schema === null || schema === void 0 ? void 0 : schema.items) !== undefined);
|
|
320
323
|
}
|
|
321
324
|
function isBinaryArraySchemaObject(schema) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openapi-ts-request",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Swagger2/OpenAPI3/Apifox to TypeScript/JavaScript, request client(support any client), request mock service, enum and enum translation, react-query/vue-query, type field label, JSON Schemas",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.0.0",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"lint-staged": "^15.3.0",
|
|
70
70
|
"openapi-types": "^12.1.3",
|
|
71
71
|
"ts-node": "^10.9.2",
|
|
72
|
-
"typescript": "5.8.
|
|
72
|
+
"typescript": "5.8.3"
|
|
73
73
|
},
|
|
74
74
|
"keywords": [
|
|
75
75
|
"openapi",
|