What is RAML and how does it differ from OpenAPI? #
Before OpenAPI became the dominant standard for describing REST APIs, several competing specifications vied for adoption. RAML — RESTful API Modeling Language — was one of the most widely adopted alternatives, particularly in enterprise environments. Created by MuleSoft in 2013 and backed by a consortium that included Salesforce, Cisco, and PayPal, RAML offered a clean, human-readable syntax for API description and introduced concepts that influenced the broader API specification ecosystem. Understanding RAML and how it differs from OpenAPI helps teams evaluate historical decisions and plan modernization efforts.
What is RAML? #
RAML is a YAML-based specification for describing RESTful APIs. It was designed with emphasis on:
- Human readability — RAML documents were intended to be readable by non-developers, particularly business analysts and product managers.
- Reusability — RAML introduced
resourceTypesandtraitsas first-class reuse mechanisms for API patterns. - Modeling before implementation — RAML was explicitly design-first, encouraging API design as a modeling activity separate from implementation.
A simple RAML document looks like this:
#%RAML 1.0
title: Users API
version: v1
baseUri: https://api.example.com/{version}
/users:
get:
description: List all users
responses:
200:
body:
application/json:
type: User[]
post:
description: Create a new user
body:
application/json:
type: UserInput
responses:
201:
body:
application/json:
type: User
types:
User:
type: object
properties:
id: string
email: string
name?: string
UserInput:
type: object
required: [email]
properties:
email: string
name?: string
The #%RAML 1.0 header and the types section are distinctive RAML features with no direct equivalent in OpenAPI’s document structure.
RAML’s Key Features #
Resource Types and Traits #
RAML’s most distinctive feature is its resourceTypes and traits mechanisms. A resourceType defines a reusable template for an HTTP resource — for example, a standard collection resource with GET (list) and POST (create) operations. A trait defines a reusable set of properties that can be applied to individual operations — for example, a pageable trait that adds page and per_page query parameters.
resourceTypes:
collection:
get:
description: List all <<resourcePathName>>
responses:
200:
body:
application/json:
type: <<resourcePathName | !singularize>>[]
post:
body:
application/json:
type: <<resourcePathName | !singularize>>Input
responses:
201:
body:
application/json:
type: <<resourcePathName | !singularize>>
traits:
pageable:
queryParameters:
page:
type: integer
default: 1
per_page:
type: integer
default: 25
These can be applied to resources with minimal repetition:
/users:
type: collection
get:
is: [pageable]
OpenAPI has no direct equivalent to resourceTypes and traits. In OpenAPI, similar reuse is achieved through $ref in components, path-level parameters, and tooling conventions — but the abstraction is less elegant.
RAML Type System #
RAML 1.0 introduced its own type system that predated OpenAPI’s full alignment with JSON Schema. RAML types support inheritance (type: User), union types (type: string | integer), and discriminators for polymorphism — all expressed with RAML-native syntax rather than JSON Schema keywords.
RAML also supported non-JSON data formats natively: XML schemas, CSV, and form data were first-class citizens in the type system, reflecting RAML’s enterprise heritage where XML-based APIs were common.
How RAML and OpenAPI Differ #
| Feature | RAML 1.0 | OpenAPI 3.1 |
|---|---|---|
| Syntax | YAML only | YAML or JSON |
| Schema vocabulary | RAML types (JSON Schema subset) | Full JSON Schema 2020-12 |
| Resource reuse | resourceTypes, traits | $ref, components |
| Governing body | MuleSoft / RAML Workgroup | OpenAPI Initiative (Linux Foundation) |
| Tooling ecosystem | Limited (declining) | Extensive and growing |
| Industry adoption | Declining | Dominant standard |
| Code generation | Limited tool support | Broad (openapi-generator, Kiota, etc.) |
| AI/LLM support | None | Native (GPT Actions, LangChain, etc.) |
Governing Body and Community #
OpenAPI is governed by the OpenAPI Initiative — a Linux Foundation consortium that includes Google, Microsoft, IBM, Salesforce, and many others. This broad industry backing gives OpenAPI significant tooling investment and long-term stability. RAML is maintained by the RAML Workgroup, which is primarily driven by MuleSoft (now owned by Salesforce). The RAML ecosystem has seen significantly less investment in recent years.
Tooling and Ecosystem #
OpenAPI’s tooling ecosystem is vastly larger than RAML’s. OpenAPI benefits from tools across every major language and framework — from code generators and SDK generators to linters, documentation portals, API gateways, and AI integration platforms. RAML’s tooling is primarily concentrated in the MuleSoft Anypoint Platform and has seen limited development outside that ecosystem.
JSON Schema Alignment #
OpenAPI 3.1 achieves full compatibility with JSON Schema 2020-12, making its schemas usable with any standards-compliant JSON Schema validator. RAML’s type system is distinct from JSON Schema, requiring RAML-specific tooling for schema validation and limiting portability.
Where RAML Still Has Presence #
RAML remains in use in organizations that built their API programs on the MuleSoft Anypoint Platform. MuleSoft’s Anypoint Design Center supports RAML natively, and many enterprises using MuleSoft for integration have large libraries of RAML documents.
For these organizations, migration to OpenAPI is possible but requires investment. Tools like oas-raml-converter can automate much of the translation, and MuleSoft’s own tooling has added increasing support for OpenAPI alongside RAML.
Should New API Projects Use RAML or OpenAPI? #
For new API projects, OpenAPI is the clear recommendation:
- Industry standard — OpenAPI is used by Google, Microsoft, AWS, Stripe, Twilio, and virtually every major API platform.
- Tooling breadth — code generators, linters, documentation tools, mock servers, API gateways, and AI platforms all support OpenAPI natively.
- Future-proof — OpenAPI 4.0 (Moonwalk) is in active development; RAML’s roadmap is unclear.
- Developer familiarity — far more developers have OpenAPI experience than RAML experience.
The only reason to choose RAML today is if the team is already heavily invested in the MuleSoft Anypoint Platform and the migration cost to OpenAPI cannot currently be justified.
Conclusion #
RAML was an innovative and influential API specification language that pioneered concepts like resource types, traits, and API modeling as a design discipline. In its prime, it competed seriously with Swagger/OpenAPI. Today, however, OpenAPI has won the market: it has broader industry backing, a vastly larger tooling ecosystem, full JSON Schema alignment, and active development toward OpenAPI 4.0. For teams encountering RAML in legacy systems, the path forward is a planned migration to OpenAPI — ideally using automated conversion tools and a phased approach that preserves existing API contracts while gaining access to the modern OpenAPI ecosystem.
Last updated on April 30, 2026.