Contact Free trial Login

Import Files into an API-Fragment Project

You can import RAML fragments into an API-fragment project. The fragments that you import can be written in RAML 0.8 or RAML 1.0. You can import annotation types, data types, examples of JSON response payloads, libraries, resource types, security schemes, and traits. You must set one of the fragments in your project as the root file of the project.

There are three locations that you can import from: your computer, a location at a URL, and Anypoint Exchange.

Procedures

  • Import a file or the content of a ZIP file that is stored on your computer, if you are using the text editor:

    1. Click the gear icon in the top-right corner of the text editor and select Import.

    2. In the Import dialog, select File or Zip.

    Result: The file or files are listed in the left pane of the editor. If you imported a ZIP file that contains files that are in a folder structure, the folder structure is represented in the pane.

  • Import a file that is available through a URL, if you are using the text editor:

    1. Click the gear icon in the top-right corner of the text editor and select Import.

    2. In the Import dialog, select URL.

      Result: The file is listed in the left pane of the editor.

      With this method of importing a file, you can import only one file at a time. If you import a library fragment, you must also import separately each file that the library uses.

  • To import an API fragment from Exchange, together with its dependencies:

    1. Open the Import Asset from Exchange dialog by using either of these methods:

      • If your project contains only the default file that API Designer created together with the project, click the linked text that appears in the Files pane.

      • If your project already contains files other than the default project file, click the gear icon in the top-right corner of the text editor and select Import from Exchange.

    2. In the drop-down menu in the top-left corner of the dialog, select the business group that owns the asset.

    3. Select one of the assets, which are listed in a table that has these columns:

      Name

      The name of an API specification or RAML fragment.

      Version

      The version of a specification or fragment.

      Select the Include snapshots checkbox in the bottom-left corner of the dialog to include snapshots in this column.

      Type

      The type of asset.

      The value must be API Fragment.

      Language

      The language for the API Fragment type is always RAML because OAS does not use fragments.

      Date modified

      The date that the currently selected version of the currently selected asset was published.

      Created by

      The user ID of the person who published the currently selected version of the currently selected asset.

    4. Click Import asset.

    Result: The file or files are listed in the left pane of the editor.

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub