newbie with restkit problems here :(
this is my json response for trades that belong to an exchange and a currency:
{
"exchange": "symbol",
"currency": "USD",
"trades": [
{
"maxPrice": "684.00",
"minPrice": "683.10",
"price": "683.28",
"timestamp": "1390451006",
"volume": "1.0"
}
]
}
I have an array of trades that belong to an exchange defined in the root of this response, trades can be 1..n.
My exchange class has 2 attributes
{
"displayName": "name",
"symbol": "symbol"
}
My currency class has 2 attributes.
{
"symbol": "$",
"code": "USD"
}
A proper JSON response and a easyout would be
{
"trades": [
{
"maxPrice": "684.00",
"minPrice": "683.10",
"price": "683.28",
"timestamp": "1390451006",
"volume": "1.0",
"exchange": {
"displayName": "name",
"symbol": "symbol"
},
"currency": {
"symbol": "$",
"code": "USD"
}
}
]
}
since all these trade belong to a single exchange and a currency i specified them at the root of the JSON response, i'm lost as to how i can map these relationship in restkit.
My Entities
Exchange
-displayName
-symbol
-trades(Exchange -->>Trade | 1:n)
Currency
-code
-symbol
-trades(Currency -->> |1:n)
Trade
-maxPrice
-minPrice
-price
-tradeDate
-volume
-currency(Trade >-->Currency |n:1)
-exchange(Trade >-->Exchange |n:1)
Any pointers or ideas would be sincerely appreciated.
Thanks for your help.