RamlParser

build gem license

A parser for the RAML API modeling language.

Installation

Add this line to your application's Gemfile:

source 'https://rubygems.org'

gem 'raml_parser'

or for bleeding edge:

gem 'raml_parser', :git => 'https://github.com/ePages-de/raml_parser.git', :branch => 'develop'

And then execute:

$ bundle

Usage

require 'raml_parser'

raml = RamlParser::Parser.parse_file('path/to/api.raml')

# generate some markdown out of it
for res in raml.resources
  puts '# Resource ' + res.absolute_uri + "\n\n"
  for name, meth in res.methods
    puts '## Method ' + meth.method + "\n\n"
    unless meth.description.nil?
      puts meth.description + "\n\n"
    else
      puts "(TODO)\n\n"
    end
  end
end

What parts of RAML are not supported

These are features of the RAML 0.8 specification that are not fully handled yet. This list should be complete, i.e. everything not listed here should work.

Contributing

  1. Fork it ( https://github.com/ePages-de/raml_parser/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request