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
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Building REST API Backend Easily With Ballerina Language
  • Composite Requests in Salesforce Are a Great Idea
  • JSON-Based Serialized LOB Pattern
  • Serverless Patterns: Web

Trending

  • Rebuilding Elasticsearch Under Load: Unsafe Watermarks and a Sampling Blind Spot
  • Moving 900+ GB of Prometheus Without a Cutover Weekend
  • Vision-Language Models in 2026: From Research Breakthroughs to Cloud-Native Production Systems
  • To Switch, or Not to Switch the AI Model

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Software Design and Architecture
  3. Integration
  4. Different RAML 1.0 Behavior in Mule Anypoint Platform and Studio

Different RAML 1.0 Behavior in Mule Anypoint Platform and Studio

MuleSoft platforms act differently for RAML specifications 0.8 and 1.0. This is important to know for developers using Mule; take a look at the details here.

By 
Rakesh Kumar Jha
·
Sep. 01, 17 · Opinion
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
10.1K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

RESTful API Modeling Language (RAML) is a YAML-based language for describing RESTful APIs. It provides all the information necessary to describe RESTful APIs.

In RAML, we define API specifications like Resource, HTTP Methods, Traits, Query Parameters, URI Parameters, and JSON request and response schemas. For all the Headers, Queries, and URI parameters which we define in RAML, we mention the data type of the parameters (ex type: string) and specify whether parameters are mandatory or optional (ex required: true). 

Defining required attributes (ex required: true) for RAML parameters are optional; RAML applies the default setting if required attribute has not been mentioned specifcally for any parameters. However there has been a different default behaviors which can be seen using RAML in mulesoft anypoint platform and studio.

RAML 0.8 Specification

In RAML 0.8, the default value for a required attribute is false. So, if the required attribute is not defined specifically for any of the header, query, and URI parameters, the MuleSoft platform mock service treats it as an optional parameter.

Example:

queryParameters:
operation:
type: string
enum: [searchByCriteria]

In the above example, the query parameter will be treated as an optional parameter by the MuleSoft platform mock service.

Mule Studio also uses the RAML file inside project folder src/main/resources. On validating the incoming request against this RAML, the Studio also treats these parameters as optional. 

So, in RAML 0.8, Mule Anypoint Platform and Mule Studio behaviors are same and seem correct.

RAML 1.0 Specification

In RAML 1.0, the default value for a required attribute is true. So, if the required attribute is not defined specifically for any of the header, query and URI parameters, the MuleSoft platform mock service treats it as a required parameter.

Example:

queryParameters:
operation:
type: string
enum: [searchByCriteria]

In the above example, the query parameter will be treated as a required parameter by the MuleSoft platform mock service.

On validating the incoming request against this RAML file in Mule studio, it treats these parameters as optional.

So, in RAML 1.0, Mule Anypoint Platform and Mule Studio behaviors are different.

MuleSoft is working on this defect and hopefully will implement a solution in a future release.

Data Types Database Attribute (computing) MuleSoft Uniform Resource Identifier Modeling language Requests REST Web Protocols

Opinions expressed by DZone contributors are their own.

Related

  • Building REST API Backend Easily With Ballerina Language
  • Composite Requests in Salesforce Are a Great Idea
  • JSON-Based Serialized LOB Pattern
  • Serverless Patterns: Web

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

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

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook