1
votes

I am trying to create a loopback:relationship using API Connect? I'm trying to create a simple relationship for two models. Lets say the first model is Customer and the second model is Order. I want to create relationship where the Customer has many Orders. Lets say I create a Customer model with two fields name (string) and age (number) and I create an Order model with two fields description (string) and date (date). I then run

apic loopback:relation 

to create a Customer "hasMany" Orders. I specify the following:

Select the model to create the relationship from: Customer
Relation Type :has many 
Choose a model to create a relationship with: Order
Enter the property name for the relation: (orders) ERROR undefined

Seems to work fine using the old slc loopback but not in APIC. Is this a bug, or am I doing something wrong? Thanks!

1
I opened a support ticket and they have recreated the error. They are addressing this issue as a defect. - JT-user2216025
It is addressed by updating your apic implementation using npm - JT-user2216025

1 Answers

1
votes

This issue was identified as a bug and was fixed by the development team in July of 2016. If you are still having this issue, please update your APIConnect version to a newer version that includes that fix.

As @JT-user2216025 explains above, they were able to solve their issue by updating APIC with NPM.

For instructions on installation and updating the toolkit, please see the following documentation:

Installing the toolkit