Generated-output differences

quicktype output changed between the PR base and tested PR merge revisions.
← Back to the pull request
2test cases
2files differ
1modified
1new
0deleted
19changed lines
+18 −1insertions / deletions
Base c1cfe3d45dc2ff61e565b856c030c254ac5cb245 · PR merge 1d744931ed6ab2249c1347afde8ac4ecf244bf41 · Head 74453144cb015a2cf611b5a079a0a2f48ea1970a · raw patch
Test case

test/inputs/json/priority/issue2680-scalar-array.json

1 generated file · +1 −1
Mkotlindefault / TopLevel.kt+1 −1
@@ -12,6 +12,6 @@ class TopLevel(elements: Collection<Long>) : ArrayList<Long>(elements) {
1212 public fun toJson() = klaxon.toJsonString(this)
1313
1414 companion object {
15- public fun fromJson(json: String) = TopLevel(klaxon.parseArray<Long>(json)!!)
15+ public fun fromJson(json: String) = TopLevel(klaxon.parseArray<Any>(json)!!.map { when (it) { is Int -> it.toLong(); is Long -> it; else -> throw IllegalArgumentException() } })
1616 }
1717 }
Test case

test/inputs/schema/issue2680-top-level-array.schema

1 generated file · +17 −0
Aschema-kotlindefault / TopLevel.kt+17 −0
@@ -0,0 +1,17 @@
1+// To parse the JSON, install Klaxon and do:
2+//
3+// val topLevel = TopLevel.fromJson(jsonString)
4+
5+package quicktype
6+
7+import com.beust.klaxon.*
8+
9+private val klaxon = Klaxon()
10+
11+class TopLevel(elements: Collection<Long>) : ArrayList<Long>(elements) {
12+ public fun toJson() = klaxon.toJsonString(this)
13+
14+ companion object {
15+ public fun fromJson(json: String) = TopLevel(klaxon.parseArray<Any>(json)!!.map { when (it) { is Int -> it.toLong(); is Long -> it; else -> throw IllegalArgumentException() } })
16+ }
17+}
No generated files match these filters.