How I GET the data from JSON structure?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
cishpix
Posts: 183
Joined: Fri Nov 06, 2015 5:07 am
Location: Indonesia

How I GET the data from JSON structure?

Post by cishpix »

Hi all,
I want GET data from other application by API (see the below for the JSON structure)
JSON-structure.png
JSON-structure.png (22.39 KiB) Viewed 1877 times
I have 4 BO and every BO have an attribute that I set peer relation with other BO.
Currently, I already can get the data for item_details BO but I'm stuck when want catch the data for category_detail BO. If I check the table of category BO in my database, the count of records already same with count of records in item_details BO.
So, my question is how can I get the data for category_detail?

FYI, I have try set the peer relation that support multiple but still no luck
Regards,

Suwandy
-----------------
Kisaran - Indonesia
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: How I GET the data from JSON structure?

Post by aware_support »

You should have:
1) CategoryDetail BO with attributes:
a) id
b) name
c) type
2) Category BO with attributes:
a) data (of type CategoryDetail single)
3) ItemDetails BO with attributes:
a) id
b) name
c) description
d) category (of type Category single)
4) Response BO with attributes:
a) data of type ItemDetails multiple
Aware IM Support Team
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: How I GET the data from JSON structure?

Post by Jaymer »

Interesting how Vlad's brain processes this in reverse order of how I would imagine it.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
cishpix
Posts: 183
Joined: Fri Nov 06, 2015 5:07 am
Location: Indonesia

Re: How I GET the data from JSON structure?

Post by cishpix »

aware_support wrote: Fri Jul 23, 2021 12:50 am You should have:
1) CategoryDetail BO with attributes:
a) id
b) name
c) type
2) Category BO with attributes:
a) data (of type CategoryDetail single)
3) ItemDetails BO with attributes:
a) id
b) name
c) description
d) category (of type Category single)
4) Response BO with attributes:
a) data of type ItemDetails multiple
Thank you Support, I was already designed like your comment but no luck so that's why I open this thread with my design as attachment.
After I worst a day, I found the answer now. Maybe every API can different, so I solve it with merge all attributes from category_detail BO into category BO
Regards,

Suwandy
-----------------
Kisaran - Indonesia
Post Reply