How to create and use a RAML in Mulesoft 4.1
In this blog I have covered 2 concepts
- Creation of a RAML.
- 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 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.
- Enable the Mocking service
- Click on the show symbols
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
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,
saiprasadd.in@mouritech.com,
Mouri Tech Pvt Ltd.