Tuesday, November 12, 2019

How to create and use a RAML in Mulesoft 4.1


How to create and use a RAML in Mulesoft 4.1


In this blog I have covered 2 concepts

  1. Creation of a RAML.
  2. Import a RAML in Mulesoft Anypoint studio and deploy it successfully.
Pre-Requirements :       
1)User should have Access to Mulesoft Anypoint platform.
                        2)User Should Install Anypoint studio in his/her local system.

Creation of a RAML

Navigation to create a RAML file:

Navigate to given URL https://anypoint.mulesoft.com/


Provide the Username and Password.

Navigate to Design Center.




Click on Create.

Click on Create API specification.

Give API name as shown in below fig and select RAML language, click on Create Specification.


Add the RAML in code editor.

Consider below fig as sample.





  1. Enable the Mocking service
  2. Click on the show symbols 


After enable the Mocking services we can see URL which is helpful to run this RAML.
                                                  1) Click on Download project.

It will download the project automatically as a Zip  file. Go to the particular location where the file is located download and unzip it.



Import a RAML in Mulesoft Anypoint studio and deploy it successfully.

Open Mulesoft Anypoint studio which is installed in his/her local system.


Click on file,New,Mule Project.
Specify the project name and click on finish as shown in below fig.

Paste the RAML which we have unzip under Src/main/resources api folder below is the screenshot for reference.
Right click on the RAML file, Click on Mule -> Generate Flows from REST API


Note: Generate flows from REST API will appear when the RAML is correct. 

Flows fill be generated automatically. Below is the screenshot for reference.
Change the port name and Run the project. 
Right click on project name and select Run As and click on Run Configurations.
Select the project name which we need to run and click on RUN.
Project is success fully deployed and Ready to use.




Result: Successfully RAML is created and deployed Mulesoft Anypoint studio.  




Further, any queries reach me,

Thank you,
Sai Prasad D,
Sr Technical Consultant,
saiprasadd.in@mouritech.com,
Mouri Tech Pvt Ltd.