Refreshing a REST API Descriptor
If the Swagger document used to create a REST API descriptor changes, you may want to refresh the REST API descriptor to reflect the recent changes or to refresh the REST API descriptor using a different Swagger document. For example, if you created a REST API descriptor from a Swagger document that has since changed to include a new service, resource, or document type, you can refresh the REST API descriptor. Refreshing the REST API descriptor does the following:
Updates the REST API descriptor or its associated services, document types, or resources to reflect changes in existing elements in the updated Swagger document.
Adds elements, such as services, document types, or resources to the REST API descriptor to reflect new elements in the updated Swagger document.
Removes REST API descriptor elements that correspond to elements that have been removed from the updated Swagger document.
Preserves any changes you made to the service implementation in the REST API descriptor since it was created from the original Swagger document.
Note: | In Designer, the option to refresh a REST API descriptor is available only for those REST API descriptors that are created using a Swagger document. |
To refresh a REST API Descriptor
1. In the Package Navigator view, right click the Rest API descriptor that you want to refresh.
2. Click Refresh REST API Descriptor.
3. Review the informational message about potential changes to the existing REST API descriptor and click OK to continue with refresh.
4. If the Source URI property specifies a location for the original Swagger document, Designer asks you if you want to use a different source file for refreshing the REST API descriptor. Click Yes to change the Swagger document or click No to use the file at the specified location as the source.
5. If you chose to change the Swagger document, in the Select the Swagger Document dialog box, do one of the following:
Select... | To generate a REST API descriptor from... |
API Portal | A REST resource present in the API Portal |
CentraSite | A REST resource available in CentraSite |
File/URL | A Swagger document that resides on the file system or on the Internet. |
6. If you specified API Portal as the source, click Next and then under Select the API from API Portal list, select the API that you want to use to create the REST API descriptor and click Finish.
7. If you specified CentraSite as the source, click Next and then under Select REST Resource from CentraSite, select the REST resource in CentraSite that you want to use to create the REST API descriptor and click Finish.
8. If you specified File/URL as the source, do one of the following and click Finish:
Enter the URL for the Swagger document. The URL should begin with http:// or https://.
Click
Browse to navigate to and select a Swagger document on your local file system.
Designer refreshes the REST API descriptor. If Designer cannot refresh a REST API descriptor, Designer rolls back to the last saved version of the REST API descriptor. If refresh is not successful, use the messages returned by Designer and the messages in the error log to determine why.