In this step, you will create the data model for our inventory items by inspecting the MySQL data source schema. LoopBack is a data model driven framework. The properties of the data model will become the JSON elements of the API request and response payloads.
Generate a Data Model
-
From the
inventory-items
data source configuration screen, click on theDiscover Models
button. -
The API Connect Toolkit will query the table structure of the MySQL data source and allow you to select the desired properties to build your data model from.
Click on the
Select Properties
button. -
Keep the defaults and click on the
Select
button. -
Click on the
Generate
button to create a data model using the selected MySQL table properties.
Continue
Proceed to Verify the Microservice API.