wrekenfile-converter 2.0.0 → 2.0.1
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.
|
@@ -46,15 +46,32 @@ function mapType(type, format) {
|
|
|
46
46
|
return 'TIMESTAMP';
|
|
47
47
|
if (format === 'binary')
|
|
48
48
|
return 'STRING'; // File uploads
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
if (typeof type === 'string') {
|
|
50
|
+
const t = type.toLowerCase();
|
|
51
|
+
if (t === 'string')
|
|
52
|
+
return 'STRING';
|
|
53
|
+
if (t === 'integer' || t === 'int')
|
|
54
|
+
return 'INT';
|
|
55
|
+
if (t === 'number')
|
|
56
|
+
return 'FLOAT';
|
|
57
|
+
if (t === 'boolean')
|
|
58
|
+
return 'BOOL';
|
|
59
|
+
return 'ANY';
|
|
60
|
+
}
|
|
61
|
+
// Handle array of types (OpenAPI allows type: ['string', 'null'])
|
|
62
|
+
if (Array.isArray(type) && type.length > 0 && typeof type[0] === 'string') {
|
|
63
|
+
const t = type[0].toLowerCase();
|
|
64
|
+
if (t === 'string')
|
|
65
|
+
return 'STRING';
|
|
66
|
+
if (t === 'integer' || t === 'int')
|
|
67
|
+
return 'INT';
|
|
68
|
+
if (t === 'number')
|
|
69
|
+
return 'FLOAT';
|
|
70
|
+
if (t === 'boolean')
|
|
71
|
+
return 'BOOL';
|
|
72
|
+
return 'ANY';
|
|
73
|
+
}
|
|
74
|
+
// Fallback for missing or unexpected type
|
|
58
75
|
return 'ANY';
|
|
59
76
|
}
|
|
60
77
|
function generateDesc(op, method, path) {
|
|
@@ -46,15 +46,32 @@ function mapType(type, format) {
|
|
|
46
46
|
return 'TIMESTAMP';
|
|
47
47
|
if (format === 'binary')
|
|
48
48
|
return 'STRING'; // File uploads
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
if (typeof type === 'string') {
|
|
50
|
+
const t = type.toLowerCase();
|
|
51
|
+
if (t === 'string')
|
|
52
|
+
return 'STRING';
|
|
53
|
+
if (t === 'integer' || t === 'int')
|
|
54
|
+
return 'INT';
|
|
55
|
+
if (t === 'number')
|
|
56
|
+
return 'FLOAT';
|
|
57
|
+
if (t === 'boolean')
|
|
58
|
+
return 'BOOL';
|
|
59
|
+
return 'ANY';
|
|
60
|
+
}
|
|
61
|
+
// Handle array of types (OpenAPI allows type: ['string', 'null'])
|
|
62
|
+
if (Array.isArray(type) && type.length > 0 && typeof type[0] === 'string') {
|
|
63
|
+
const t = type[0].toLowerCase();
|
|
64
|
+
if (t === 'string')
|
|
65
|
+
return 'STRING';
|
|
66
|
+
if (t === 'integer' || t === 'int')
|
|
67
|
+
return 'INT';
|
|
68
|
+
if (t === 'number')
|
|
69
|
+
return 'FLOAT';
|
|
70
|
+
if (t === 'boolean')
|
|
71
|
+
return 'BOOL';
|
|
72
|
+
return 'ANY';
|
|
73
|
+
}
|
|
74
|
+
// Fallback for missing or unexpected type
|
|
58
75
|
return 'ANY';
|
|
59
76
|
}
|
|
60
77
|
function generateDesc(op, method, path) {
|
package/package.json
CHANGED