quicktype-core 23.0.82 → 23.0.84
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/dist/language/Crystal.js +0 -24
- package/dist/language/Golang.js +1 -3
- package/package.json +1 -1
package/dist/language/Crystal.js
CHANGED
|
@@ -300,30 +300,6 @@ class CrystalRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
300
300
|
this.emitCommentLines(this.leadingComments);
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
|
-
this.emitMultiline(`# Example code that deserializes and serializes the model:
|
|
304
|
-
#
|
|
305
|
-
# require "json"
|
|
306
|
-
#
|
|
307
|
-
# class Location
|
|
308
|
-
# include JSON::Serializable
|
|
309
|
-
#
|
|
310
|
-
# @[JSON::Field(key: "lat")]
|
|
311
|
-
# property latitude : Float64
|
|
312
|
-
#
|
|
313
|
-
# @[JSON::Field(key: "lng")]
|
|
314
|
-
# property longitude : Float64
|
|
315
|
-
# end
|
|
316
|
-
#
|
|
317
|
-
# class House
|
|
318
|
-
# include JSON::Serializable
|
|
319
|
-
# property address : String
|
|
320
|
-
# property location : Location?
|
|
321
|
-
# end
|
|
322
|
-
#
|
|
323
|
-
# house = House.from_json(%({"address": "Crystal Road 1234", "location": {"lat": 12.3, "lng": 34.5}}))
|
|
324
|
-
# house.address # => "Crystal Road 1234"
|
|
325
|
-
# house.location # => #<Location:0x10cd93d80 @latitude=12.3, @longitude=34.5>
|
|
326
|
-
`);
|
|
327
303
|
}
|
|
328
304
|
emitSourceStructure() {
|
|
329
305
|
this.emitLeadingComments();
|
package/dist/language/Golang.js
CHANGED
|
@@ -61,8 +61,6 @@ function isValueType(t) {
|
|
|
61
61
|
function canOmitEmpty(cp) {
|
|
62
62
|
if (!cp.isOptional)
|
|
63
63
|
return false;
|
|
64
|
-
if (exports.goOptions.omitEmpty)
|
|
65
|
-
return true;
|
|
66
64
|
const t = cp.type;
|
|
67
65
|
return ["union", "null", "any"].indexOf(t.kind) < 0;
|
|
68
66
|
}
|
|
@@ -197,7 +195,7 @@ class GoRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
|
|
|
197
195
|
const description = this.descriptionForClassProperty(c, jsonName);
|
|
198
196
|
const docStrings = description !== undefined && description.length > 0 ? description.map(d => "// " + d) : [];
|
|
199
197
|
const goType = this.propertyGoType(p);
|
|
200
|
-
const omitEmpty = canOmitEmpty(p) ? ",omitempty" : [];
|
|
198
|
+
const omitEmpty = canOmitEmpty(p) || this._options.omitEmpty ? ",omitempty" : [];
|
|
201
199
|
docStrings.forEach(doc => columns.push([doc]));
|
|
202
200
|
const tags = this._options.fieldTags
|
|
203
201
|
.split(",")
|