quicktype-core 7.0.22 → 7.0.23

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.
@@ -49,11 +49,6 @@ function isValueType(t) {
49
49
  const kind = t.kind;
50
50
  return primitiveValueTypeKinds.indexOf(kind) >= 0 || kind === "class" || kind === "enum";
51
51
  }
52
- function singleDescriptionComment(description) {
53
- if (description === undefined)
54
- return "";
55
- return "// " + description.join("; ");
56
- }
57
52
  function canOmitEmpty(cp) {
58
53
  if (!cp.isOptional)
59
54
  return false;
@@ -189,10 +184,12 @@ class GoRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
189
184
  this.emitPackageDefinitons(false);
190
185
  let columns = [];
191
186
  this.forEachClassProperty(c, "none", (name, jsonName, p) => {
187
+ const description = this.descriptionForClassProperty(c, jsonName);
188
+ const docStrings = description !== undefined && description.length > 0 ? description.map(d => "// " + d) : [];
192
189
  const goType = this.propertyGoType(p);
193
- const comment = singleDescriptionComment(this.descriptionForClassProperty(c, jsonName));
194
190
  const omitEmpty = canOmitEmpty(p) ? ",omitempty" : [];
195
- columns.push([[name, " "], [goType, " "], ['`json:"', Strings_1.stringEscape(jsonName), omitEmpty, '"`'], comment]);
191
+ docStrings.forEach(doc => columns.push([doc]));
192
+ columns.push([[name, " "], [goType, " "], ['`json:"', Strings_1.stringEscape(jsonName), omitEmpty, '"`']]);
196
193
  });
197
194
  this.emitDescription(this.descriptionForType(c));
198
195
  this.emitStruct(className, columns);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quicktype-core",
3
- "version": "7.0.22",
3
+ "version": "7.0.23",
4
4
  "description": "The quicktype engine as a library",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -45,6 +45,6 @@
45
45
  "fs": false
46
46
  },
47
47
  "config": {
48
- "commit": "e6d9552bcb36d29258d8750515d2a0af310aefcd"
48
+ "commit": "740de7cea038033d9d2b00188c685ca3d4802773"
49
49
  }
50
50
  }