Create a data type that defines an address.
Procedure
-
Click the + button in the left panel and
click Data type.
-
Enter Address in the
Name field and add a
description.
You can also add a section if needed. Since this example is
simple, sections are not needed, but they can useful to group resources and data
types in more complex APIs.
-
In the DATA TYPE
section, click Generate from JSON
example, paste the JSON sample below and click Generate.
{
"street": "3185 Gateway Avenue",
"street2": "",
"postCode": "93301",
"city": "Bakersfield",
"state": "CA"
}
The properties are automatically created. You can edit
them if needed.
-
Click Save.
Results
Your data type is created, it should look like this: