![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
1. Create a RESTful web services in the REST Dispatch and Reply activity. See Creating a RESTful Web Service for details about how to create a RESTful web service.
2. Click the REST Dispatch and Reply activity in the process.
3. Figure 11 Export Swagger Dialog
4. Select an exporting format from the Export As list.See Export Swagger Button for details about the exporting format.
5. In the REST API Host field, enter the REST API host where Swagger can send HTTP request to. For example, http://localhost:8089.
6. If you select the ZIP format, Enter the Swagger server port in the Swagger Server Port field. The default value is 9999.Note: You can also update the server port by updating the winstone.properties file which is located in the api-docs directory after you export the Swagger file.
7. In the Export Dir field, specify a directory where the file is exported to.
8. Name the exported file in the ZIP/WAR Name field.
9.
10. If you want to export the names of corresponding global variables, select the Keep Global Variables check box.
11. If you enable the OAuth function, specify where the access token is located in an HTTP request in the Access Token Position list.
12. If you want to customize the Swagger web page, select the Show Advanced check box and configure the corresponding fields. See Export Swagger Button for details.
13. Click OK to save the configuration.
2. Run the startup file on the command line to start the Swagger server.Figure 12 Swagger Web UI
• Show/Hide: Click to show or hide the APIs on the page.
• List Operations: Click to list all the operations of APIs.
• Expand Operations: Click to expand all the operations of APIs.
2. Figure 13 Expanding the API
3. Figure 14 Entering the ParametersFigure 15 shows the results and whether the API is useful.Figure 15 Checking the Results
You might fail to call the REST APIs in Swagger due to the cross-origin restrictions. See Support for Cross-Origin Requests for details about the rules to conduct a cross-origin request.
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |