Я использовал ваш код, только что преобразованный в kotlin (но он такой же), и он работал без проблем
inner class ProductCheckList (
var id: Int = 0,
var characteristics: String? = null,
var specification: String? = null,
var total_subpoints: String? = null,
var min: String? = null,
var max: String? = null,
var key1: String? = null,
var spec1: String? = null,
var value1: String? = null,
var min1: String? = null,
var max1: String? = null,
var key2: String? = null,
var spec2: String? = null,
var value2: String? = null,
var min2: String? = null,
var max2f: String? = null,
var spec3: String? = null,
var min3: String? = null,
var max3: String? = null,
var min4: String? = null,
var max2d: String? = null,
var key12: String? = null,
var spec12: String? = null,
var value12: String? = null,
var min12: String? = null,
var max12: String? = null,
var key2r: String? = null,
var spec2f: String? = null,
var value22: String? = null,
var min245: String? = null,
var max2455: String? = null,
var spec355: String? = null,
var min366: String? = null,
var max377: String? = null,
var min3d: String? = null,
var max3d: String? = null,
var min4d: String? = null,
var spec2fdd: String? = null,
var value22er: String? = null,
var min245ew: String? = null,
var max2455w: String? = null,
var spec355w: String? = null,
var min366f: String? = null,
var max377f: String? = null,
var min3df: String? = null,
var max3dg: String? = null,
var min4dg: String? = null
)
fun checkStackOverflow(){
val productCheckLists = ArrayList<ProductCheckList>()
productCheckLists.add(ProductCheckList(1,"pippo","pluto","minnie","topolino", "dog","pippo","pluto","minnie","topolino", "dog"
,"pippo","pluto","minnie","topolino", "dog","pippo","pluto","minnie","topolino","topolino", "dog","pippo","pluto","minnie","topolino",
"topolino", "dog","pippo","pluto","minnie","topolino","topolino", "dog","pippo","pluto","minnie","topolino","topolino", "dog",
"pippo","pluto","minnie","topolino","pluto","minnie","topolino"))
}
`
Что я заметил, так это то, что он размещает элементы в алфавитном порядке, так что, возможно, для этогоВы думаете, что это усечено.Например, элемент min4dg не последний, так что вы можете подумать, что он перехвачен
[{"characteristics":"pippo","id":1,"key1":"pippo","key12":"dog","key2":"pippo","key2r":"topolino","max":"dog","max1":"dog","max12":"topolino","max2455":"minnie","max2455w":"pippo","max2d":"topolino","max2f":"dog","max3":"minnie","max377":"dog","max377f":"topolino","max3d":"pluto","max3dg":"minnie","min":"topolino","min1":"topolino","min12":"minnie","min2":"topolino","min245":"pluto","min245ew":"dog","min3":"pluto","min366":"topolino","min366f":"minnie","min3d":"pippo","min3df":"pluto","min4":"topolino","min4d":"minnie","min4dg":"topolino","spec1":"pluto","spec12":"pippo","spec2":"pluto","spec2f":"dog","spec2fdd":"topolino","spec3":"pippo","spec355":"topolino","spec355w":"pluto","specification":"pluto","total_subpoints":"minnie","value1":"minnie","value12":"pluto","value2":"minnie","value22":"pippo","value22er":"topolino"}]
Другая возможность - использовать следующий код:
val gson = GsonBuilder().create()
val arrayValues= gson.toJsonTree(productCheckLists).asJsonArray