API Sync
The API Sync feature of Anypoint Studio enables you to:
-
Pull a published RAML or OAS 2.0 API specification from Exchange or a private Maven repository, into your Mule application project in Studio to scaffold a new project.
API sync also enables you to edit the API specification you imported from Exchange, and push your changes to Design Center.You can use API Sync on more than one API specification to scaffold multiple flows in different Mule configuration files.
-
Monitor the API versions that you implemented in your project and update your flows based on the latest published version.
-
Pull a RAML or OAS 2.0 API specification from Design Center into Studio, edit the specification offline, and pull the updates back to Design Center.
API Sync supports importing both RAML and OAS 2.0 specifications.
API Sync comes bundled by default in Studio 7.4.x and later, and requires Mule 4.1.4 and later.
API sync might not work properly if the RAML file exceeds 4,000 lines of text.
Using API Sync, you can develop your Mule applications following API Lifecycle development practices.
Import an API Specification from Exchange into a New Mule Project
-
Create an API specification in Design Center.
You can either Create an API Specification with the Text Editor in Design Center or Create an API Specification with the Visual API Editor in Design Center. -
Publish it to Exchange.
See Publish an API Specification for more information. -
Import the same API specification from Exchange to your Studio project.
See Importing an API Specification from Exchange for more information.
You can keep your Studio projects updated to the latest version of the API specification:
-
Right click in the project that implements the API for which you want to check for updates.
-
From the API Specs menu, select the API for which you want to check for updates, and click Update Version.
If a new version is found, API Sync asks you if you want to regenerate the flows based on the new version.
You can manage the API specifications in your project that are linked to Exchange from the API Project management view by clicking the Manage Mule Project APIs icon () in the top task bar.
Edit The Imported API Specification in Studio
You can also edit the imported API specification in your project as an API project.
-
Import the API specification from Exchange to your Studio project.
-
Synchronize it to Design Center,
-
Publish it to Exchange
-
Import the new version of your API spec.
See Edit Imported API Specifications in Your Projects in Studio for more information.
Import an API Specification from Design Center into an Editable API Project
-
Create an API specification in Design Center.
You can either Create an API Specification with the Text Editor in Design Center or Create an API Specification with the Visual API Editor in Design Center. -
Import the same API specification from Design Center to your Studio project.
See Synchronize API Specifications with Design Center to learn how to do this.