Define REST API
After defining the REST API Endpoint Group worksheet, we use the same example Create Customer to define the REST API. Each AlchemyJ workbook can only support one ##RestApi worksheet.
- Go to ##RestApi, key in the values as shown below for the Basic Settings. These settings define the name for API and package. In this sample, the generated jar file would be called CustomerService.jar.
Property | Value |
---|---|
API name | CustomerService |
Package name | alchemydemo.customer |
Version | 1.0.0 |
- Next, we will need to define the worksheet name of Endpoint Groups included in this API which is the one we have set up earlier.
Endpoint group Definition Sheets |
---|
=ajAddress(##RestEndpointGroup!AlchemyJ_Name_ConfType,,2) |
- Default values have been set to Runtime Configuration and Build-and-Run Web Server Configuration sections. You can modify the value if needed.
Now, all formulas and settings have been defined. We will preview the API in AlchemyJ Studio. Go to the AlchemyJ ribbon, click Preview Function Point and select Create Customer to test the function point in AlchemyJ Studio.