How to use Swagger Editor
Swagger Editor is the tool which is used to create the API specifications. The API specification defines how the API works. Frends supports Swagger 2.0 and OpenAPI 3.0 formats in the Swagger editor. However it is highly recommended to use the OpenAPI 3.0 format because it's more versatile than the older Swagger 2.0.
β
To begin the API creation we first need to navigate to the API View in Frends. Make sure that your Frends user has the sufficient access rights by checking that you can see the API View tab in the Frends Control Panel.
The API View lists all the ready made API specifications. Let's begin the creation by pressing the Create new button. This will open up the Swagger Editor with a Sample API already made for you as a template.
On the left side of the View you can see the Swagger Editor. The template specification defaults to openapi 3.0.1 format. Like was said in the previous module, Frends supports both OpenAPI 3.0 and Swagger 2.0 but it's recommended to use the newer OpenAPI 3.0 format. The actual specification is written in YAML language. To learn more about the YAML you can check this tutorial. You can also convert the specification into JSON by clicking the Convert to JSON button if that is more preferable for you. If you have already made the specification using some other tool, you can copy paste the YAML or JSON specification directly into the Swagger Editor.
On the right side you can see the API definitions which are collected from the Swagger Editor. The definitions will update automatically when changes are made to the Swagger Editor. All endpoints (paths) defined in the editor will be created and you can examine it by clicking on the endpoint. Here you can see required parameters and possible responses which are defined in the specification. You can also test your APIs using the API definitions after you have saved the first version of the API Specification.
While you make modifications to the API specifications the Swagger Editor will highlight and notify you of any errors in the specification. For example in the image below a colon is missing after the schema line.
To finish your specification click on the Save changes button on the bottom of the page.
This will bring you back to the API View and you can see your newly created API Specification in the list.
After the specification is complete you need to implement the actual features for the API. This is done by creating Linked Processes which handle the actual functionalities of the API. You can create a Linked Process by clicking the Create new Process under the endpoint. You will learn more about these Linked Processes in the course L3C5 Implementing endpoints.
The next article is Introduction to Implementing endpoints.