DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Create a RESTful Interface for an App From RAML in Anypoint

Create a RESTful Interface for an App From RAML in Anypoint

You can generate an entire interface from one simple API definition.

nikhil bangar user avatar by
nikhil bangar
·
Jan. 21, 17 · Tutorial
Like (4)
Save
Tweet
Share
6.71K Views

Join the DZone community and get the full member experience.

Join For Free

A RESTful interface for an application will have the listener for each of the methods defined by the API to interact with it.

GET:cust\ 

GET:cust\{ID} 

POST:cust\ 

We can generate that interface from the API definition. Let's get started. 

1. Download and install the APIKit plugin in Anypoint Studio.

Image title

Image title

2. You should have an account on Anypoint Platform to have an access to RAML API definition.

3. Write any RAML definition in API Designer based on the requirements that I have written to Customer for the kickstart.                   

Image title

4. Create a Mule project from the RAML definition.

Image title

5. You can create a project from a RAML definition, which is either on your local system or on the Anypoint Platform. We are going with Anypoint Platform.

Image title

6. After clicking Next, you will get all of the RAML definitions written in you Anypoint platform. Notice that the following image depicts only a single RAML Definition.

Image title

7. Select the appropriate RAML Definition and hit OK.

8. Check the project explorer, which includes the RAML definition from Anypoint Platform.

Image title

9. Check the customer-api.xml canvas. It should show the main flow, the flow for each resource methods, and the flow for exception handling.

Image title

The main flow.

Image title

Flow for each resources methods.

Image title

The exception handling flow.

10. Check src/main/api in the project explorer or API async for RAML definition.

Image title

Image title

11. Running the RAML-Demo project, you can see the output either on the APIKit Console or on POSTMAN.

Image title

APIKit console.

Image title

POSTMAN.

Interface (computing) REST Web Protocols app

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • DevOps Roadmap for 2022
  • Utilize OpenAI API to Extract Information From PDF Files
  • Top 5 Java REST API Frameworks
  • Promises, Thenables, and Lazy-Evaluation: What, Why, How

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: