RAML’s next Evolution
An Introduction to RAML 1.0
All contents © MuleSoft Inc.
What we discuss today
•  A Quick Recap about API Design
•  A Quick Recap about RAML
•  RAML’s Evolution to v1.0
•  Let me show you!
•  What’s other things are New
All contents © MuleSoft Inc.
About Me
•  API Addict
•  Technology = Love
•  Developer & Open Source
Contributor
•  Traveler or such
•  Community Product Manager
@ MuleSoft
@ChristianVogel_
All contents © MuleSoft Inc.
Imagine you’re building a city using Legos.
“I want my city to have a fire department, a
police department, and a park.”
All contents © MuleSoft Inc.
All contents © MuleSoft Inc.
All contents © MuleSoft Inc.
You didn’t have any specs…
All contents © MuleSoft Inc.
Let me introduce you to RAML
(Restful API Modeling Language)
All contents © MuleSoft Inc.
Design and
Document your
APIs in a single file
An open spec language
designed to be human
readable and to encompass
the entire API lifecycle
Core
What is RAML?
All contents © MuleSoft Inc.
What does RAML look like?
10
#%RAML	
  0.8	
  
	
  	
  
title:	
  World	
  Music	
  API	
  
baseUri:	
  http://example.api.com/{version}	
  
version:	
  v1	
  
	
  
/playlist:	
  #	
  resource	
  
	
  	
  get:	
  #	
  HTTP	
  method	
  
	
  	
  	
  	
  responses:	
  
	
  	
  	
  	
  	
  	
  200:	
  #	
  HTTP	
  response	
  code	
  
	
  	
  	
  	
  	
  	
  	
  	
  body:	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  application/json:	
  #	
  HTTP	
  response	
  media	
  type	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  example:	
  |	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  {	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  “playlistID”	
  :	
  1,	
  	
  	
  	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  “playlistName”	
  :	
  “My	
  Awesome	
  Playlist”,	
  	
  	
  	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  “genre”	
  	
  	
  	
  	
  	
  	
  	
  :	
  “top40”,	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  “songs”	
  	
  	
  	
  	
  	
  	
  	
  :	
  40	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  	
  	
  	
  	
  	
  
All contents © MuleSoft Inc.
Reusability &
Pattern
Core
What is RAML?
An open spec language
designed to be human
readable and to encompass
the entire API lifecycle
Create reusable
pattern-oriented
assets shareable
across multiple
APIs
traits
resource
types
security
schemes
schemas
All contents © MuleSoft Inc.
Data Modeling
Reusability &
Pattern
Core
RAML’s Evolution to v1.0
An open spec language
designed to be human
readable and to encompass
the entire API lifecycle
traits
resource
types
security
schemes
schemas
Libraries
Overlays &
Extensions
Typed Fragments
Increases RAMLs
core strengths
around reusability
and separation of
concerns; and
introduces a
unified,
streamlined, and
powerful way to
model data
Annotations
All contents © MuleSoft Inc.
Data Modeling
13
types:	
  
	
  	
  Email:	
  	
  
	
  	
  	
  	
  type:	
  object	
  
	
  	
  	
  	
  properties:	
  
	
  	
  	
  	
  	
  	
  subject:	
  string	
  
	
  	
  	
  	
  	
  	
  body:	
  string	
  
	
  	
  Emails:	
  	
  
	
  	
  	
  	
  type:	
  Email[]	
  	
  
	
  	
  	
  	
  minItems:	
  1	
  
	
  	
  	
  	
  uniqueItems:	
  true	
  
	
  	
  	
  	
  examples:	
  
	
  	
  	
  	
  	
  	
  emailExample1:	
  
	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  subject:	
  My	
  Email	
  1	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  body:	
  This	
  is	
  the	
  text	
  for	
  email	
  1.	
  
	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  subject:	
  My	
  Email	
  2	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  body:	
  This	
  is	
  the	
  text	
  for	
  email	
  2.	
  
	
  	
  	
  	
  	
  	
  emailExample2:	
  
	
  	
  	
  	
  	
  	
  	
  	
  -­‐	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  subject:	
  Another	
  Email	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  body:	
  This	
  is	
  another	
  example.	
  
Express your data
using YAML
Define multiple
Examples
Reuse existing
Types
Define Types and
Characteristics
All contents © MuleSoft Inc.
Libraries
14
RAML
Definition
Marketing
Dept
IT Dept
#%RAML	
  1.0	
  Library	
  
	
  
securitySchemes:	
  
	
  	
  oauth_2_0:	
  
	
  	
  jwt:	
  
	
  	
  ...	
  
#%RAML	
  1.0	
  Library	
  
	
  
types:	
  
	
  	
  customer:	
  
	
  	
  campaign:	
  
	
  	
  ...	
  
Separate and group reusable
RAML assets into libraries,
which can then be pulled into
the RAML definition in a
namespaced format
All contents © MuleSoft Inc.
Annotations
15
RAML
Definition
#%RAML	
  1.0	
  
title:	
  My	
  API	
  
	
  
/send:	
  
	
  	
  get:	
  
...	
  
Describe your general
API structure
Describe your metadata
characteristics
#%RAML	
  1.0	
  Library	
  
	
  
annotationTypes:	
  
	
  	
  throttling:	
  
	
  	
  	
  	
  properties:	
  
	
  	
  	
  	
  	
  	
  limit:	
  integer	
  
	
  	
  	
  	
  	
  	
  ...	
  
#%RAML	
  1.0	
  
title:	
  My	
  API	
  
	
  
...	
  
	
  
/send:	
  
	
  	
  (throttling):	
  
	
  	
  	
  	
  limit:	
  10	
  
	
  	
  get:	
  
...	
  
Enhance your RAML definition with additional
user-defined metadata either for documentation
or processing.
All contents © MuleSoft Inc.
Overlays / Extensions
1616
non-API
details
RAML
Definition
extends
Simplify your RAML definition by separating non-API
details into overlays / extensions
#%RAML	
  1.0	
  Overlay	
  
	
  
extends:	
  api.raml	
  
usage:	
  Add	
  AWS	
  Configuration	
  Details	
  
	
  
/customer:	
  
	
  	
  (AWS.Configuration):	
  
	
  	
  	
  	
  ...	
  
#%RAML	
  1.0	
  
	
  
/customer:	
  
	
  	
  description:	
  Acquisition	
  of	
  Customers	
  
All contents © MuleSoft Inc.
and other changes ...
17
1.  More possibilities to better document your API
2.  Consistency changes
3.  New and improved security schemes
4.  Smaller clarifications and fixes
Let me show you!
18
What else is new?
19
All contents © MuleSoft Inc.
API Workbench
a brand new IDE to design APIs offline, built on top of GitHub’s Atom project,
meaning collaboration and versioning have never been easier! Finally, a tool for
developers to design APIs with!
All contents © MuleSoft Inc.
Brand new Website
21
All contents © MuleSoft Inc.
RAML Projects
22
All contents © MuleSoft Inc.
and lots more ...
23
1.  RAML Newsletter
2.  RAML MVP Program
3.  RAML 1.0 Book
4.  ...
All contents © MuleSoft Inc. 24
come and visit us on
raml.org
@ramlapi
All contents © MuleSoft Inc. 25
and the most important
CONTRIBUTE / SEND FEEDBACK
https://github.com/raml-org/raml-spec
All contents © MuleSoft Inc. 26

ApiAddicts Meetup Sept 2016, Madrid

  • 1.
    RAML’s next Evolution AnIntroduction to RAML 1.0
  • 2.
    All contents ©MuleSoft Inc. What we discuss today •  A Quick Recap about API Design •  A Quick Recap about RAML •  RAML’s Evolution to v1.0 •  Let me show you! •  What’s other things are New
  • 3.
    All contents ©MuleSoft Inc. About Me •  API Addict •  Technology = Love •  Developer & Open Source Contributor •  Traveler or such •  Community Product Manager @ MuleSoft @ChristianVogel_
  • 4.
    All contents ©MuleSoft Inc. Imagine you’re building a city using Legos. “I want my city to have a fire department, a police department, and a park.”
  • 5.
    All contents ©MuleSoft Inc.
  • 6.
    All contents ©MuleSoft Inc.
  • 7.
    All contents ©MuleSoft Inc. You didn’t have any specs…
  • 8.
    All contents ©MuleSoft Inc. Let me introduce you to RAML (Restful API Modeling Language)
  • 9.
    All contents ©MuleSoft Inc. Design and Document your APIs in a single file An open spec language designed to be human readable and to encompass the entire API lifecycle Core What is RAML?
  • 10.
    All contents ©MuleSoft Inc. What does RAML look like? 10 #%RAML  0.8       title:  World  Music  API   baseUri:  http://example.api.com/{version}   version:  v1     /playlist:  #  resource      get:  #  HTTP  method          responses:              200:  #  HTTP  response  code                  body:                      application/json:  #  HTTP  response  media  type                              example:  |                              {                                    “playlistID”  :  1,                                                “playlistName”  :  “My  Awesome  Playlist”,                                          “genre”                :  “top40”,                                  “songs”                :  40                              }            
  • 11.
    All contents ©MuleSoft Inc. Reusability & Pattern Core What is RAML? An open spec language designed to be human readable and to encompass the entire API lifecycle Create reusable pattern-oriented assets shareable across multiple APIs traits resource types security schemes schemas
  • 12.
    All contents ©MuleSoft Inc. Data Modeling Reusability & Pattern Core RAML’s Evolution to v1.0 An open spec language designed to be human readable and to encompass the entire API lifecycle traits resource types security schemes schemas Libraries Overlays & Extensions Typed Fragments Increases RAMLs core strengths around reusability and separation of concerns; and introduces a unified, streamlined, and powerful way to model data Annotations
  • 13.
    All contents ©MuleSoft Inc. Data Modeling 13 types:      Email:            type:  object          properties:              subject:  string              body:  string      Emails:            type:  Email[]            minItems:  1          uniqueItems:  true          examples:              emailExample1:                  -­‐                        subject:  My  Email  1                      body:  This  is  the  text  for  email  1.                  -­‐                        subject:  My  Email  2                      body:  This  is  the  text  for  email  2.              emailExample2:                  -­‐                      subject:  Another  Email                      body:  This  is  another  example.   Express your data using YAML Define multiple Examples Reuse existing Types Define Types and Characteristics
  • 14.
    All contents ©MuleSoft Inc. Libraries 14 RAML Definition Marketing Dept IT Dept #%RAML  1.0  Library     securitySchemes:      oauth_2_0:      jwt:      ...   #%RAML  1.0  Library     types:      customer:      campaign:      ...   Separate and group reusable RAML assets into libraries, which can then be pulled into the RAML definition in a namespaced format
  • 15.
    All contents ©MuleSoft Inc. Annotations 15 RAML Definition #%RAML  1.0   title:  My  API     /send:      get:   ...   Describe your general API structure Describe your metadata characteristics #%RAML  1.0  Library     annotationTypes:      throttling:          properties:              limit:  integer              ...   #%RAML  1.0   title:  My  API     ...     /send:      (throttling):          limit:  10      get:   ...   Enhance your RAML definition with additional user-defined metadata either for documentation or processing.
  • 16.
    All contents ©MuleSoft Inc. Overlays / Extensions 1616 non-API details RAML Definition extends Simplify your RAML definition by separating non-API details into overlays / extensions #%RAML  1.0  Overlay     extends:  api.raml   usage:  Add  AWS  Configuration  Details     /customer:      (AWS.Configuration):          ...   #%RAML  1.0     /customer:      description:  Acquisition  of  Customers  
  • 17.
    All contents ©MuleSoft Inc. and other changes ... 17 1.  More possibilities to better document your API 2.  Consistency changes 3.  New and improved security schemes 4.  Smaller clarifications and fixes
  • 18.
    Let me showyou! 18
  • 19.
    What else isnew? 19
  • 20.
    All contents ©MuleSoft Inc. API Workbench a brand new IDE to design APIs offline, built on top of GitHub’s Atom project, meaning collaboration and versioning have never been easier! Finally, a tool for developers to design APIs with!
  • 21.
    All contents ©MuleSoft Inc. Brand new Website 21
  • 22.
    All contents ©MuleSoft Inc. RAML Projects 22
  • 23.
    All contents ©MuleSoft Inc. and lots more ... 23 1.  RAML Newsletter 2.  RAML MVP Program 3.  RAML 1.0 Book 4.  ...
  • 24.
    All contents ©MuleSoft Inc. 24 come and visit us on raml.org @ramlapi
  • 25.
    All contents ©MuleSoft Inc. 25 and the most important CONTRIBUTE / SEND FEEDBACK https://github.com/raml-org/raml-spec
  • 26.
    All contents ©MuleSoft Inc. 26