Handle Rest Service with duplicate names

0
Hi, I'm pulling in a large Json package using the rest service module. The problem I'm having is where there are duplicate keys in the Json. For example: Company: { organization: [{ name: "Company 1" }] }, Parent: { organization: [{ name: "Company 2" }] }, Subsidiaries: { organization: [{ name: "Company 3" }] } At the moment I would create a single organizations entity and then have three associations coming from the Company, Parent and Subsidiaries entities. These associations would all need to be called organization but as associations can't be the same I've found that I can add underscores to the front. So the association names would be: organization, organization, _organization This works if there are two of the same name but not three. Any ideas how to handle this kind of problem? Thanks Trevor
asked
1 answers
1

Would making a general entity and three specializations work?

For example wrapper with the association organization and then three specialization entities called organization, parent, subsidaiaries. They will all share the same association and you can even share the same attributes if needed.

answered