を使用してPOJO(モデル)クラスを生成することができませんので、私はPOJO(モデル)クラスを作成するためのGson形式のプラグインを使用するが、私はこのためGsonのそれを作成することはできませんよフォーマット例外エラー -私は改修に2.1.0ライブラリを使用してJSONをパースしたいGson形式
com.intellij.util.IncorrectOperationException: Incorrect field '/**
* 0 : {"lat":"23.0124","long":"72.5228","question":"caluculate 1+2","hint":"1,2,3","questionAudioUrl":"http://audio/1480919241.mp3"}
* type : type1
*/
@com.google.gson.annotations.SerializedName("0")private 0Bean value0 ; '
そして、私のJSONは、私はここでは、このサイトhttp://jsonformatter.org/
を使用して検証していますも有効ですが、私のJSON
{
"response": {
"result": true,
"errorCode": 0,
"errorDescription": "Success",
"tourData": {
"TourID": "5",
"sTourName": "titanium city center ahmedabad",
"sShortDescription": "ffjk fdjf fdjf fd f jkdf fjdf fdf f fhfjd fj jfjfjdhfhfhfdf f fjhf",
"sLongDescription": "dsd dsd ds dsd dsd d sdsd ds dsd sds dd",
"sCity": "ahmedabad",
"sLatitude": "23.0124",
"sLongitude": "72.5228",
"sGoalLat": "-2.09",
"sGoalLong": "12.5228",
"sVersion": "1",
"dDate": "2016-11-29 00:41:32",
"status": "APPROVED",
"iTourImagesID": "18",
"iTourID": "5",
"iImageData": "http://myurl/images/tour-images/1480405309background_menu.jpeg",
"bIsDefault": "1",
"dDateTime": "2016-11-29 13:11:49"
},
"tourCountData": {
"total_image": "4",
"total_coin": "12",
"total_diamond": "1",
"total_clues": "3",
"total_checkpoint": "1"
},
"TourAllImageData": [
{
"iImageData": "http:///images/tour-images/1480405309background_menu.jpeg",
"bIsDefault": "1"
},
{
"iImageData": "http://images/tour-images/[email protected]",
"bIsDefault": "1"
},
{
"iImageData": "http:///images/tour-images/[email protected]",
"bIsDefault": "1"
},
{
"iImageData": "http://images/tour-images/[email protected]~ipad.jpeg",
"bIsDefault": "1"
}
],
"img_result": true,
"TourAllUserData": [],
"u_result": false,
"TourcoinsData": [
{
"sLatitude": "19.422655",
"sLongitude": "-99.161297",
"iTourPlaceID": "10"
},
{
"sLatitude": "23.0135",
"sLongitude": "72.5228",
"iTourPlaceID": "12"
},
{
"sLatitude": "23.0150",
"sLongitude": "72.5296",
"iTourPlaceID": "13"
},
{
"sLatitude": "23.0150",
"sLongitude": "72.5245",
"iTourPlaceID": "14"
},
{
"sLatitude": "23.0160",
"sLongitude": "72.5310",
"iTourPlaceID": "15"
},
{
"sLatitude": "23.0115",
"sLongitude": "72.5228",
"iTourPlaceID": "16"
},
{
"sLatitude": "23.0135",
"sLongitude": "72.5296",
"iTourPlaceID": "17"
},
{
"sLatitude": "23.0115",
"sLongitude": "72.5200",
"iTourPlaceID": "18"
},
{
"sLatitude": "23.0135",
"sLongitude": "72.5270",
"iTourPlaceID": "19"
},
{
"sLatitude": "23.0135",
"sLongitude": "72.5260",
"iTourPlaceID": "20"
},
{
"sLatitude": "23.0160",
"sLongitude": "72.5296",
"iTourPlaceID": "21"
},
{
"sLatitude": "23.0170",
"sLongitude": "72.5310",
"iTourPlaceID": "22"
}
],
"co_result": true,
"TourDiamondData": [
{
"sLatitude": "23.011487",
"sLongitude": "72.525011",
"iTourPlaceID": "24",
"sPlaceImage": "http:/images/places/1481007650-place.png",
"sPlaceDescription": "dd d dh hffh idufhfhf hf hfhd fhf hdfhufh ffdufh fhdfu dfhd fhd fhdfhdufduf hfhdfhd fhdfhdf dfhdufd ffdufh fhdufd ffhduf ufufh"
}
],
"di_result": true,
"TourCheckpointData": [
{
"sLatitude": "23.0225",
"sLongitude": "72.5714",
"iTourPlaceID": "23"
}
],
"chk_result": true,
"TourClueData": [
{
"sClues": "clue1"
},
{
"sClues": "clue2"
},
{
"sClues": "clue3"
}
],
"clu_result": true,
"TourChallenge1Data": {
"0": {
"lat": "23.0124",
"long": "72.5228",
"question": "caluculate 1+2",
"hint": "1,2,3",
"questionAudioUrl": "http://audio/1480919241.mp3"
},
"type": "type1"
},
"TourChallenge2Data": {
"0": {
"lat": "23.0143",
"long": "72.5296",
"question": "type2",
"hint": "1,,,2",
"timer": "01:01:00",
"questionAudioUrl": "http://audio/1480919413.mp3"
},
"type": "Type2"
},
"TourChallenge3Data": {
"0": {
"lat": "23.011641",
"long": "72.523917",
"puzzleImageUrl": "http:/images/puzzles/1480919458-puzzle.png",
"puzzleDescription": "set image",
"puzzleAudioUrl": "http:/audio/1480919458.mp3"
},
"type": "Type3"
},
"TourChallenge4Data": {
"0": {
"lat": "23.0124",
"long": "72.5210",
"keyLat": "23.0135",
"keyLong": "72.5228"
},
"type": "Type4"
}
}
}
0123です
私はhttp://www.jsonschema2pojo.org/はモデルクラスを生成することがある知っているが、それはそれは非常に多くのクラスを管理するのは難しいので、クラスをネストされていない別のクラスを作成します。
QUE 1: jsonを使用してモデルクラスを生成するにはどうすればよいですか?
QUE 2:は私がRequestBody
を試みたが、動作しない私は改造2.1.0を使用して文字列の応答を得ることができる方法はあります。
そのための任意のより良い解決策はあります?
あなたは、その発電機から返されるオブジェクトは、私は –