Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Typescript definition file for RAML


The following Typescript file will serve multiple purposes ( in order of importance ):

  1. Enable Typescript tools to consume the output of the raml-js-parser in a type-safe manner
  2. Provide an additional source of documentation for developers trying to get their heads around the RAML spec
  3. Move towards a canonical javascript/json representation for RAML that other Javascript based tools can support

Considering the above, some comments to keep in mind:

  • The starting point for this definition is highly influenced by the output of the pre-existing JS parser ( remember goal N1 ). We will probably be able to influence its design in future iterations as we move towards goal N3.
  • The official RAML Spec is the only authoritative source
  • Not every possible clever refactoring or Typescript idiom will be used ( to achieve goal N 2 )


  • YAML and JSON are differnet. This will leak
  • Even if we define one canonical RAML model for JSON, there will always be at least 3 different models in reality:
  • Complete/Strict model - ex: the output of parsing a valid RAML file
  • Incomplete model - ex: the output of parsing a RAML file which is being edited ( by a parser that supports this kind of use case )
  • Complete + Interpretation - The fully expanded model ( with resource types and traits interpreted )

How can you use this?

  • Read the source for now. Suggest edits, etc.
  • RAML is complex enough to require some advanced Typescript concepts that didn't make it to 1.3 ( Type Aliases and Union Types )
  • If you are in a hurry, check out the pre-release of the CATS IDE


Documentation references the official Spec

Everything is typed - autocomplete to the rescue ;)

Takes advantage of advanced Typescript features

Union Types

And more!


No description, website, or topics provided.



No releases published
You can’t perform that action at this time.