I need to extract data from MSACCES database in JSON object…
So I’m not quite sure about the right JSON string syntax.
Which one is correct:
{
"Continent": {
"Europe": {
"Countries":
{
"The Netherlands": {
"Cities": [
"Rotterdam",
"Hag",
"Amsterdam"
]
}
},
{
"Germany": {
"Cities": [
"Bon",
"Berlin"
]
}
}
}
}
}
or this one:
{
"Continent": {
"Europe": {
"Countries": [
{
"The Netherlands": {
"Cities": [
"Rotterdam",
"Hag",
"Amsterdam"
]
}
},
{
"Germany": {
"Cities": [
"Bon",
"Berlin"
]
}
}
]
}
}
}
I wonder between {"Countries":[{"The Net… or {"Countries":{"The Net..
2
Answers
Since you are having an array of
Country[]
, I would advice you to rename yourCountry
key byCountries
:IMHO, the best way is to keep relations
classes (translate to your language)