quicktype-core 23.2.3 → 23.2.4
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.
|
@@ -333,5 +333,17 @@ class CSharpRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
333
333
|
}
|
|
334
334
|
this.emitDefaultFollowingComments();
|
|
335
335
|
}
|
|
336
|
+
emitDependencyUsings() {
|
|
337
|
+
let genericEmited = false;
|
|
338
|
+
let ensureGenericOnce = () => {
|
|
339
|
+
if (!genericEmited) {
|
|
340
|
+
this.emitUsing("System.Collections.Generic");
|
|
341
|
+
genericEmited = true;
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
this.typeGraph.allTypesUnordered().forEach(_ => {
|
|
345
|
+
(0, TypeUtils_1.matchCompoundType)(_, _arrayType => this._csOptions.useList ? ensureGenericOnce() : undefined, _classType => { }, _mapType => ensureGenericOnce(), _objectType => { }, _unionType => { });
|
|
346
|
+
});
|
|
347
|
+
}
|
|
336
348
|
}
|
|
337
349
|
exports.CSharpRenderer = CSharpRenderer;
|
|
@@ -67,9 +67,10 @@ class NewtonsoftCSharpRenderer extends CSharpRenderer_1.CSharpRenderer {
|
|
|
67
67
|
return [extensionsName];
|
|
68
68
|
}
|
|
69
69
|
emitUsings() {
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
if (!this._needAttributes && !this._needHelpers) {
|
|
71
|
+
this.emitDependencyUsings();
|
|
72
72
|
return;
|
|
73
|
+
}
|
|
73
74
|
super.emitUsings();
|
|
74
75
|
this.ensureBlankLine();
|
|
75
76
|
for (const ns of [
|
|
@@ -68,9 +68,10 @@ class SystemTextJsonCSharpRenderer extends CSharpRenderer_1.CSharpRenderer {
|
|
|
68
68
|
return [extensionsName];
|
|
69
69
|
}
|
|
70
70
|
emitUsings() {
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
if (!this._needAttributes && !this._needHelpers) {
|
|
72
|
+
this.emitDependencyUsings();
|
|
73
73
|
return;
|
|
74
|
+
}
|
|
74
75
|
super.emitUsings();
|
|
75
76
|
this.ensureBlankLine();
|
|
76
77
|
for (const ns of [
|