Create and Publish a RAML API Fragment in the Text Editor in API Designer
You can create API fragments directly in RAML with the help of code suggestions that appear within the text editor.
An API fragment is a RAML document that has a version and an identifier, but is not in itself a complete RAML specification. An API fragment is one of the following types defined by RAML.org. See the RAML 0.8 or 1.0 specification (depending on which you want to use) for descriptions of the types.
On the Projects page in Design Center, click Create new.
Select New Fragment.
In the New Fragment dialog, type a name for the Fragment project.
You can change the name or fragment type later, if necessary.
Select the type of API fragment that you want to create and click Create Fragment.
Result: The text editor opens. The editor is divided into three panels:
+ * The left panel lists the files in your project.
+ By default, the editor creates a RAML file that has the same name as the project. This file is set as the root file of the project.
The left panel also lists the file
exchange.json, which is a file that contains metadata required by Anypoint Exchange at the time that you publish your project to Exchange. This file is read-only.
* The central panel displays the editor in which you create your API fragment.
* The right panel lists the types and resources that are in the API fragment that is displayed in the central panel.
Draft your API fragment.
As you draft, the text editor suggests RAML nodes, methods, and other elements that you can add at the location of your cursor.
You can import files into your project, either separately or bundled in .zip files. The files can be RAML 1.0 files, JSON files, or OpenAPI Specification (OAS) 2.0 or 3.0 files. The files can be on your computer or you can specify a URL for them if they are located online.
You can publish the API fragment to Anypoint Exchange.
Click the Publish button that is in the top-right corner of the text editor, and then click Publish to Exchange.
Specify a version number for the project, which Exchange treats as an asset. This number is displayed in Exchange in the Version section of the right pane in the page for the project.
After you publish the API-fragment project, other developers can include its fragments as dependencies in their own API-specification projects.
When you publish the API-fragment project, Exchange automatically creates an API portal for it.