beer-swagger 1.0.1 → 1.0.2
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/.idea/git_toolbox_prj.xml +15 -0
- package/generate-apis.js +15 -0
- package/package.json +1 -1
- package/beer-swagger-1.0.1.tgz +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="GitToolBoxProjectSettings">
|
|
4
|
+
<option name="commitMessageIssueKeyValidationOverride">
|
|
5
|
+
<BoolValueOverride>
|
|
6
|
+
<option name="enabled" value="true" />
|
|
7
|
+
</BoolValueOverride>
|
|
8
|
+
</option>
|
|
9
|
+
<option name="commitMessageValidationEnabledOverride">
|
|
10
|
+
<BoolValueOverride>
|
|
11
|
+
<option name="enabled" value="true" />
|
|
12
|
+
</BoolValueOverride>
|
|
13
|
+
</option>
|
|
14
|
+
</component>
|
|
15
|
+
</project>
|
package/generate-apis.js
CHANGED
|
@@ -197,6 +197,13 @@ function mapSchemaToType(schema, schemas, useTypes) {
|
|
|
197
197
|
}
|
|
198
198
|
return useTypes ? `Types.${refName}` : '{}';
|
|
199
199
|
}
|
|
200
|
+
if (!type && items) {
|
|
201
|
+
const itemType = mapSchemaToType(items, schemas, useTypes);
|
|
202
|
+
if (itemType === '{}' || itemType === '[]') {
|
|
203
|
+
return '[]';
|
|
204
|
+
}
|
|
205
|
+
return `${itemType}[]`;
|
|
206
|
+
}
|
|
200
207
|
if (type === 'string') {
|
|
201
208
|
return 'string';
|
|
202
209
|
}
|
|
@@ -235,11 +242,15 @@ function mapParamSchemaToType(schema, schemas, useTypes) {
|
|
|
235
242
|
type,
|
|
236
243
|
format
|
|
237
244
|
} = schema;
|
|
245
|
+
const { items } = schema;
|
|
238
246
|
if ($ref) {
|
|
239
247
|
const refName = normalizeDtoName($ref.split('/')
|
|
240
248
|
.pop());
|
|
241
249
|
return useTypes ? `Types.${refName}` : '{}';
|
|
242
250
|
}
|
|
251
|
+
if (!type && items) {
|
|
252
|
+
return '[]';
|
|
253
|
+
}
|
|
243
254
|
if (type === 'string') {
|
|
244
255
|
return 'string';
|
|
245
256
|
}
|
|
@@ -725,6 +736,10 @@ function mapSchemaToTsType(schema, schemas) {
|
|
|
725
736
|
}
|
|
726
737
|
return normalizeDtoName(refName);
|
|
727
738
|
}
|
|
739
|
+
if (!type && items) {
|
|
740
|
+
const itemType = mapSchemaToTsType(items, schemas);
|
|
741
|
+
return `${itemType}[]`;
|
|
742
|
+
}
|
|
728
743
|
if (schemaEnum && schemaEnum.length) {
|
|
729
744
|
return schemaEnum.map((v) => (typeof v === 'string' ? `'${v}'` : String(v)))
|
|
730
745
|
.join(' | ');
|
package/package.json
CHANGED
package/beer-swagger-1.0.1.tgz
DELETED
|
Binary file
|