Contact Us 1-800-596-4880

Import an API Specification from Maven

Anypoint Studio enables you to import a RAML or OAS 2.0 and 3.0 API specification into either a new Mule project or an existing one.

If you are using Mule runtime engine (Mule) 4.1.3 and earlier, or if you prefer to import an API specification that’s not in Exchange, follow the steps presented in import an API specification from a local file or import an API specification from Design Center depending on your preferred use case.

Import an API Specification From Maven Into a New Project

  1. In the taskbar at the top of the Anypoint Studio display, select File > New > Mule Project.

  2. Type a name for your project.

  3. Select a Mule runtime engine version 4.1.4 or later.

  4. In the API Specification section, select the From Exchange or Maven tab, click the Add icon (2%) and select From Maven.
    You can either specify the Maven coordinates of your API specification, or you can install a local file into your Maven repository.

Add an API Specification From Maven Coordinates

If your API specification is in your corporate Maven repository, you can add it as a dependency.

  1. In the Import From Maven screen, configure your API specification artifact definition:

    • Group ID

    • Artifact ID

    • Version

  2. In the Advanced Settings section, verify that the Classifier value for your dependency is the same as your API specification type (RAML, for example).

  3. Click OK.

Studio scaffolds your API specification. If you choose not to create flows out of your API specification, unselect the Scaffold Flows From These API Specifications checkbox.

After you import them, you can manage the API specifications in your project that are linked to Exchange from the API specification project management view by clicking the Manage Mule Project APIs icon (2%) in the top taskbar.

Add an API Specification From a Local File

If you can’t connect to the internet to download the API specification dependency from your corporate Maven repository, or if your API specification is not available in Maven, you can still make your specification available as a dependency by installing it to your local Maven installation:

  1. In the Import From Maven screen, next to the Install a local dependency field, click Install.

  2. In the File field, either type the location of your file or click Browse to find it in your files.
    If you select Browse, change the file type to any.
    You can add either a RAML or OAS 2.0 and 3.0 specification, or a ZIP bundle file as your API specification, and click Open.

  3. Set up the rest of your Maven coordinates for your API specification.

  4. In the Advanced Settings section, verify that the Classifier value for your dependency is the same as your API specification type (RAML, for example).

  5. Click Install and OK.

Studio scaffolds your API specification. If you choose not to create flows out of your API specification, unselect the Scaffold Flows From These API Specifications checkbox.

You can manage the API specifications in your project that are linked to Exchange from the API specification project management view by clicking the Manage Mule Project APIs icon (2%) in the top task bar.

Import an API Specification from Maven Into an Existing Project

  1. In the Package Explorer view, select your project.

  2. Click the Add icon (2%) and select From Maven.

  3. You can either specify the Maven coordinates of your API specification, or you can install a local file into your Maven repository.

Add an API Specification From Maven Coordinates

If your API specification is in your corporate Maven repository, you can add it as a dependency.

  1. In the Import From Maven screen, configure your API specification artifact definition:

    • Group ID

    • Artifact ID

    • Version

  2. In the Advanced Settings section, verify that the Classifier value for your dependency is the same as your API specification type (RAML, for example).

  3. Click OK.

Studio scaffolds your API specification. If you choose not to create flows out of your API specification, unselect the Scaffold Flows From These API Specifications checkbox.

After you import them, you can manage the API specifications in your project that are linked to Exchange from the API specification project management view by clicking the Manage Mule Project APIs icon (2%) in the top taskbar.

Add an API Specification From a Local File

If you can’t connect to the internet to download the API specification dependency from your corporate Maven repository, or if your API specification is not available in Maven, you can still make your specification available as a dependency by installing it to your local Maven installation:

  1. In the Import From Maven screen, next to the Install a local dependency field, click Install.

  2. In the File field, either type the location of your file or click Browse to find it in your files.
    If you select Browse, change the file type to any.
    You can add either a RAML or OAS 2.0 and 3.0 specification, or a ZIP bundle file as your API specification, and click Open.

  3. Set up the rest of your Maven coordinates for your API specification.

  4. In the Advanced Settings section, verify that the Classifier value for your dependency is the same as your API specification type (RAML, for example).

  5. Click Install and OK.

Studio scaffolds your API specification. If you choose not to create flows out of your API specification, unselect the Scaffold Flows From These API Specifications checkbox.

You can manage the API specifications in your project that are linked to Exchange from the API specification project management view by clicking the Manage Mule Project APIs icon (2%) in the top task bar.