@tsofist/schema-forge 4.2.2 → 4.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-schema.d.ts","sourceRoot":"","sources":["../../src/schema-generator/generate-schema.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAMvC,OAAO,EAIH,eAAe,EAqBlB,MAAM,0BAA0B,CAAC;AAgBlC,OAAO,EAAwB,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAOlF;;GAEG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,CAoGhG;
|
|
1
|
+
{"version":3,"file":"generate-schema.d.ts","sourceRoot":"","sources":["../../src/schema-generator/generate-schema.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC;AAMvC,OAAO,EAIH,eAAe,EAqBlB,MAAM,0BAA0B,CAAC;AAgBlC,OAAO,EAAwB,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAOlF;;GAEG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,CAoGhG;AAgLD,UAAU,eAAgB,SAAQ,kBAAkB;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,2BAA2B,EAAE,eAAe,CAAC;CAChD"}
|
|
@@ -235,15 +235,28 @@ class SchemaGeneratorEx extends ts_json_schema_generator_1.SchemaGenerator {
|
|
|
235
235
|
tslib_1.__classPrivateFieldSet(this, _SchemaGeneratorEx_multipleDefinitionsErrorSuppression, value, "f");
|
|
236
236
|
}
|
|
237
237
|
appendRootChildDefinitions(rootType, childDefinitions) {
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
if (tslib_1.__classPrivateFieldGet(this, _SchemaGeneratorEx_multipleDefinitionsErrorSuppression, "f")) {
|
|
239
|
+
const seen = new Set();
|
|
240
|
+
const children = this.typeFormatter
|
|
241
|
+
.getChildren(rootType)
|
|
242
|
+
.filter((child) => child instanceof ts_json_schema_generator_1.DefinitionType)
|
|
243
|
+
.filter((child) => {
|
|
244
|
+
if (!seen.has(child.getId())) {
|
|
245
|
+
seen.add(child.getId());
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
return false;
|
|
249
|
+
});
|
|
250
|
+
children.reduce((definitions, child) => {
|
|
251
|
+
const name = child.getName();
|
|
252
|
+
if (!(name in definitions)) {
|
|
253
|
+
definitions[name] = this.typeFormatter.getDefinition(child.getType());
|
|
254
|
+
}
|
|
255
|
+
return definitions;
|
|
256
|
+
}, childDefinitions);
|
|
240
257
|
}
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
if (tslib_1.__classPrivateFieldGet(this, _SchemaGeneratorEx_multipleDefinitionsErrorSuppression, "f"))
|
|
244
|
-
return;
|
|
245
|
-
}
|
|
246
|
-
throw e;
|
|
258
|
+
else {
|
|
259
|
+
super.appendRootChildDefinitions(rootType, childDefinitions);
|
|
247
260
|
}
|
|
248
261
|
}
|
|
249
262
|
}
|