What RAML gave you that OAS quietly doesn’t
The structural mapping between RAML and OAS clicks fast. paths instead of resources, components/schemas instead of types, info instead of…
What RAML gave you that OAS quietly doesn’t
The structural mapping between RAML and OAS clicks fast. paths instead of resources, components/schemas instead of types, info instead of root-level metadata, that part I figured out quickly. What took longer to internalize is something subtler: RAML was designed to help you design an API. OAS was designed to describe one. That distinction sounds philosophical until you start missing traits.
Traits: what I actually miss
If I had to name one thing that RAML does better, it’s traits. A trait bundles reusable behavior, pagination parameters, authentication headers, standard error responses, and applies it to any method with a single reference. is: [pageable, secured] and you're done. Clean, composable, and genuinely DRY.
OAS has no equivalent. What you get instead is components/parameters, components/responses, and components/requestBodies, a library of reusable pieces you explicitly $ref into each operation. The library exists. The automatic application doesn't.
In practice, this means more repetition. Every endpoint that needs pagination gets its own $ref to the shared parameter definition. It works, but it's manual. If you're used to a single trait applying behavior across an entire resource, writing out twenty $ref lines for the same parameter does feel like a step backwards. I won't pretend otherwise.
OAS makes that trade in exchange for broader tooling compatibility. Whether it’s a fair trade depends on your project, but it’s a real trade, and it’s worth knowing about before you start.
The Exchange rendering problem with allOf
RAML supports type inheritance directly. You define a base type, extend it, and the hierarchy is explicit. OAS uses allOf, oneOf, and anyOf from JSON Schema instead. allOf is the closest equivalent to inheritance, it merges schemas, and in most validators and tools it works fine.

In Anypoint Exchange, it doesn’t always render as expected.
This is the kind of thing that sounds like a minor annoyance until you’re on a project where Exchange is how your team reviews API contracts. If allOf compositions don't resolve correctly there, the people reading the spec are working from an incomplete picture. The workaround is opening the OAS file directly instead of relying on Exchange's rendered view. That's not hard, but it's friction that didn't exist in RAML.
My practical takeaway: if your team uses Exchange as the primary review surface, be careful with deep allOf hierarchies. Flatter schemas, even if more verbose, are safer until Exchange handles composition reliably in your environment.
How components actually works
components is OAS's reusability system, and it's more comprehensive than just schemas:
components/schemas— shared data types, equivalent to RAMLtypescomponents/parameters— reusable query, header, and path parameterscomponents/responses— standard responses likeNotFoundorUnauthorizedcomponents/requestBodies— reusable request payloadscomponents/securitySchemes— authentication definitions you can apply globally or per operation

The security schemes work well in practice. Define once, reference everywhere, and you get consistent auth across all endpoints without repeating yourself. That part I’ve had no complaints about.
What components doesn't do is apply anything automatically. Every reference is explicit. There's no trait-style shorthand. If you want every endpoint to return the same NotFound response shape, you write a $ref for each one. It's the price of the explicit-over-magic philosophy OAS follows.
JSON Schema vs OAS components: a distinction worth getting right early
In Anypoint Platform you can use API fragments with OAS, but there’s a distinction I’ve had to explain more than once: JSON Schema files and OAS component definitions are not the same thing, even though both end up describing schemas.
A JSON Schema file is standalone, follows the JSON Schema specification, and you reference it with a file path:
$ref: './schemas/user.schema.json'
An OAS component lives inside a spec’s components section and is referenced within that spec or via an OAS fragment:
$ref: '#/components/schemas/User'
Both are valid. Both work in Anypoint. The difference is scope and intent. JSON Schema fragments are useful when you want to share types across multiple OAS specs without tying them to one spec’s components. OAS component fragments are more natural for things that belong to a single API's vocabulary, standard responses, security schemes, parameters specific to that API's conventions.
If you’re coming from RAML, the JSON Schema fragment is the closest thing to an external RAML Library. The pattern is familiar; the syntax is just different.
Where it actually hurts: bounded context modeling
Honestly, the traits thing is annoying. The Exchange rendering thing is a real problem. But the place where I feel the OAS vs RAML gap most is bounded context modeling.
In RAML, building a shared domain model for an integration platform was a first-class workflow. Define types, extend them, reference them across fragments, publish to Exchange, reuse across multiple APIs. The tooling was built for it.
In OAS, that same model needs different patterns. Type extension becomes allOf composition. Cross-spec reuse means external JSON Schema or carefully structured OAS fragments. The result can work, but it doesn't feel like something OAS was designed for, because it wasn't.
For integration work specifically, this matters at the start of a project. If you go in expecting OAS to behave like RAML fragments in Anypoint, you’ll find out it doesn’t when you’re trying to apply the model in Studio or review it in Exchange. Fixing that later is harder than deciding early.
Before I start a bounded context model in OAS now, I check what allOf renders like in the team's Exchange instance, and I decide up front whether shared types will live in OAS components or external JSON Schema. Both can work. Knowing which before you start saves a lot of rework.

Key takeaways
- OAS has no
traitsorresourceTypes— reusable behavior requires explicit$refin each operation, usingcomponents/parametersandcomponents/responses allOfreplaces RAML type inheritance, but renders inconsistently in Anypoint Exchange — flat schemas are safer when Exchange is your team's review surfacecomponentscovers schemas, parameters, responses, request bodies, and security schemes — comprehensive, but all references are manual, nothing applies automatically- JSON Schema fragments and OAS component fragments both work in Anypoint but serve different scopes — distinguish them before you start, not after
- OAS is a spec format, not a modeling language — bounded context work requires different patterns than RAML, and the gap shows at design time
Mastered the Theory? Now Level Up Your Practice. > If you enjoyed this deep dive into API design, check out app.integrationtrails.io. You’ll find bite-sized microlearning courses and interactive DataWeave challenges designed to turn architectural insights into hands-on expertise.
메타데이터
- post_id
- fe0547c2b007
- slug
- what-raml-gave-you-that-oas-quietly-doesnt-fe0547c2b007
- url
- https://medium.com/another-integration-blog/what-raml-gave-you-that-oas-quietly-doesnt-fe0547c2b007
- canonical_url
- https://medium.com/another-integration-blog/what-raml-gave-you-that-oas-quietly-doesnt-fe0547c2b007
- author_url
- https://medium.com/@patryk.bandurski
- status
- ok
- fetched_at
- 2026-06-21 07:44:09