Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 2504

Nested fields in the REST

$
0
0

Hello, Everyone!   I'am trying to make a android application, witch get a data from REST service.

I have an answer from the server like this "branch_list" :

"branch_list" : {
		"count" : 7,
		"total" : "7",
		"list" : [{
				"keys" : ["code"],
				"fields" : {
					"code" : {
						"name" : "code",
						"type" : "int",
						"value" : 1
					},
					"reg_name" : {
						"name" : "reg_name",
						"type" : "string",
						"value" : "ляляля"
					},
					"reg_det_name" : {
						"name" : "reg_det_name",
						"type" : "string",
						"value" : "ляляляляляля"
					},
					"kladr_code" : {
						"name" : "kladr_code",
						"type" : "string",
						"value" : "7700000000000"
					},
					"reg_code" : {
						"name" : "reg_code",
						"type" : "string",
						"value" : "1"
					}
				}
			}, {
				"keys" : ["code"],
				"fields" : {
					"code" : {
						"name" : "code",
						"type" : "int",
						"value" : 12
					},
					"reg_name" : {
						"name" : "reg_name",
						"type" : "string",
						"value" : "ляляля"
					},
					"reg_det_name" : {
						"name" : "reg_det_name",
						"type" : "string",
						"value" : "три рубля"
					},
					"kladr_code" : {
						"name" : "kladr_code",
						"type" : "string",
						"value" : "7700000000000"
					},
					"reg_code" : {
						"name" : "reg_code",
						"type" : "string",
						"value" : "1"
					}
				}
			},

 

, this is not a usual JSON array.

Here my data is a nested elements.

With plain JSON array it is easy to get data through RestresponseAdapter to the clientdataset.

Can I get my data with help of a right configuration of ResponseAdapter's FieldDefs structure with nested elements?

Can you give me an example how to use a nested elements of the FieldDefs collection and what field type must have a parent fields to get a success result?

 

Thank you very much!


Viewing all articles
Browse latest Browse all 2504

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>