-
Use the keyboard shortcuts:
-
Mac: Cmd+Shift+p
-
Windows: Ctrl+Shift+p
-
-
In the desktop IDE, select View > Command Palette.
-
In the cloud IDE, click the (menu) icon, and select View > Command Palette.
Publishing API Specs and Fragments to Exchange
Publish your API spec or fragment to Anypoint Exchange so that other team members can find and use it.
Before You Begin
Before publishing an API spec or fragment:
-
Have some familiarity with business groups.
When you publish your API spec to Exchange from Anypoint Code Builder, the IDE requests the name of the business group. See Business Groups.
Publish an API spec to Exchange
To publish your API spec to Exchange:
-
Open your API specification in Anypoint Code Builder.
-
Open the Command Palette.
Show me how
-
Enter
publish
and select the following command:MuleSoft: Publish API Specification to Exchange
-
If prompted, click Allow, and follow the prompts to sign in to Anypoint Platform.
-
In Select a Business Group, find and select your business group for the project.
For more information, see Before You Begin.
-
In Set Project Name, confirm or type the project name and press Enter.
-
Confirm or change each item and press Enter:
-
Artifact ID, such as
OAS-Example
-
Asset version, such as
1.0.0
-
API version, such as
v1
Press Escape to cancel publishing.
The status bar shows the progress. When complete, you see a message that the API specification successfully published to Exchange:
-
-
When prompted to implement the API, select one of the following:
-
No to avoid scaffolding the API specification into your integration.
-
Yes to scaffold the API specification into a new project.
Show me how
-
In the field that opens, provide a name for your implementation project.
-
Navigate to a directory for your project, and click Select target folder.
-
Select a Mule runtime (Mule) version for your project.
-
Select a supported Java version for Mule.
-
After the scaffolding process completes, view the scaffolded interface for your project from the
src/main/mule
directory in the Explorer.If the scaffold fails, see Implementation Errors.
You can also open your new project’s
mule-artifact.json
file from the Explorer to check the Mule and Java versions, for example:{ "minMuleVersion": "4.6.2", "javaSpecificationVersions": [ "11" ] }
The
mule-artifact.json
file is located at the root level of the project directory.
-
-
Locate Your API in Exchange
After publishing your API specification, you can find it in Anypoint Exchange:
-
Navigate to Anypoint Platform and log in using your credentials.
Show me how
-
US cloud (non-EU host): Anypoint Platform (US)
-
EU cloud (EU host): Anypoint Platform (EU)
-
-
Navigate to Anypoint Exchange.
Show me how
-
US cloud (non-EU host): Exchange (US)
-
EU cloud (EU host): Exchange (EU)
Your API specification appears as an asset in your organization, for example:
-
You can select the API, navigate through its summary, and see all the endpoints you defined in the previous tasks.
Publish a GraphQL API Spec to Exchange
To publish a GraphQL API specification to Exchange:
-
Navigate to Anypoint Platform and log in using your credentials.
Show me how
-
US cloud (non-EU host): Anypoint Platform (US)
-
EU cloud (EU host): Anypoint Platform (EU)
-
-
Navigate to Anypoint Exchange.
Show me how
-
US cloud (non-EU host): Exchange (US)
-
EU cloud (EU host): Exchange (EU)
-
-
Click Publish new asset:
-
Complete the Publish a new asset form:
-
For Name, type a name for your asset.
-
For Asset types, select GraphQL API.
-
For Method, select Upload a GraphQL API Schema.
-
For File upload, click Choose file and browse for your
.graphql
schema file. -
Click Advanced to change the version number.
-
For Lifecycle state, select Stable.
-
-
Click Publish.
Your GraphQL API spec is now available on Exchange, for example: