Medschool

Make your docs smarter! Medschool is a tool for documenting APIs that helps you keep your documentation in-sync with reality.

Installation

Add this line to your application's Gemfile:

gem 'medschool'

And then execute:

$ bundle

Or install it yourself as:

$ gem install medschool

Usage

Write markdown narrative in a *.md.msd file:

  ## Creating a new user

  This is how you create a new user!

Embed requests and responses:

  ## Creating a new user

  This is how you create a new user!

  @@@request: creating_a_user
    type: json
    method: post
    route: '/sports'
    data:
      user:
        properties:
          username:
            value: "Bobby"
            type: string
          password:
            value: "password"
            type: string
  @@@

  ### Response

  @@@response: creating_a_user
    type: json
    status: 200
    data:
      user:
        username: "Bobby"
  @@@

Using Medschool in tests

  msd = Medschool::Example.new(file, request_or_response_name)
  msd.request_hash # Request hash
  msd.validate_response(response) # Validates a response object

Generating HTML Docs

rake docs:generate

Contributing

  1. Fork it
  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 new Pull Request